[ublas] FYI: msvc12 compilation errors and some questions
Hi, FYI, ublas is broken for MSVC 12 due to the use of constexpr which is not suported by this compiler. I might fix it however I assume there are people who would like to do it. Btw, would you be so kind and answer for some questions? I'm curious about the design. Why BOOST_UBLAS_CPP_GE_2011 library-wide #define is usedto enable fixed_vector<>? This makes it available only on some compilers which allows the users to write non-portable code. Shouldn't Boost libraries use language featureswhen they're available or emulate them rather than enable/disable some functionalities? Especially when it could be easily done, like in this case. Variadic templates may be emulated with Boost.Preprocessor, e.g. see how emplace_back() is implemented in boost::container::vector<> : https://github.com/boostorg/container/blob/develop/include/boost/container/v... lines 1309-1380. constexpr may be conditionally used e.g. like this: #ifndefBOOST_NO_CXX11_CONSTEXPR #define CONSTEXPR_OR_STATIC constexpr #else #define CONSTEXPR_OR_STATIC static #endif So I'm wondering was the decision about the design made to push the library towards "pure" C++11? If yes, does this mean that all new features will require C++11? Regards, Adam
On Thu, Apr 17, 2014 at 4:17 PM, Adam Wulkiewicz
Hi,
FYI, ublas is broken for MSVC 12 due to the use of constexpr which is not suported by this compiler. I might fix it however I assume there are people who would like to do it.
Btw, would you be so kind and answer for some questions? I'm curious about the design.
Why BOOST_UBLAS_CPP_GE_2011 library-wide #define is usedto enable fixed_vector<>? This makes it available only on some compilers which allows the users to write non-portable code. Shouldn't Boost libraries use language featureswhen they're available or emulate them rather than enable/disable some functionalities? Especially when it could be easily done, like in this case.
Variadic templates may be emulated with Boost.Preprocessor, e.g. see how emplace_back() is implemented in boost::container::vector<> :
https://github.com/boostorg/container/blob/develop/ include/boost/container/vector.hpp lines 1309-1380.
constexpr may be conditionally used e.g. like this:
#ifndefBOOST_NO_CXX11_CONSTEXPR
#define CONSTEXPR_OR_STATIC constexpr
#else
#define CONSTEXPR_OR_STATIC static
#endifhttp:
See http://www.boost.org/doc/libs/1_55_0/libs/config/doc/html/boost_config/boost... --Beman
Beman Dawes wrote:
On Thu, Apr 17, 2014 at 4:17 PM, Adam Wulkiewicz
wrote: Hi,
FYI, ublas is broken for MSVC 12 due to the use of constexpr which is not suported by this compiler. I might fix it however I assume there are people who would like to do it.
Btw, would you be so kind and answer for some questions? I'm curious about the design.
Why BOOST_UBLAS_CPP_GE_2011 library-wide #define is usedto enable fixed_vector<>? This makes it available only on some compilers which allows the users to write non-portable code. Shouldn't Boost libraries use language featureswhen they're available or emulate them rather than enable/disable some functionalities? Especially when it could be easily done, like in this case.
Variadic templates may be emulated with Boost.Preprocessor, e.g. see how emplace_back() is implemented in boost::container::vector<> :
https://github.com/boostorg/container/blob/develop/ include/boost/container/vector.hpp lines 1309-1380.
constexpr may be conditionally used e.g. like this:
#ifndefBOOST_NO_CXX11_CONSTEXPR
#define CONSTEXPR_OR_STATIC constexpr
#else
#define CONSTEXPR_OR_STATIC static
#endifhttp:
See http://www.boost.org/doc/libs/1_55_0/libs/config/doc/html/boost_config/boost...
uBlas is still broken so I created a ticket: https://svn.boost.org/trac/boost/ticket/9954 Regards, Adam
participants (2)
-
Adam Wulkiewicz
-
Beman Dawes