1

As I see many std classes from c++11 take their origin from boost library. So boost library has array, mutex, shared_ptr, unique_ptr, function etc, and std analogs with almost the same interface and semantics. And I wonder, why not to have build mode for boost, where I can add compiler flag like -DUSE_CXX11_CLASSES, and boost low level stuff become just typedef to std one?

So, for example, if I use boost:program_options and c++11, I don't have in my program many duplicates.

I mean, yes it is good to have boost low level classes, for compilers that not support c++11, but why not, for compilers, which support c++11 use already available stuff?

user1244932
  • 7,352
  • 5
  • 46
  • 103
  • The boost versions generally have additional functionality and plumbing which the boost library itself relies on, the templates and classes aren't necessarily compatible. – user657267 Nov 20 '15 at 06:17

1 Answers1

1

Some libraries use c++11 classes automatically when detected. It depends on the library author.

There is no such general compilation flag you can use.

sehe
  • 374,641
  • 47
  • 450
  • 633
  • Thanks, can you point out one example, please? So I can use this example and create pull request at least for program_options. – user1244932 Nov 20 '15 at 23:38
  • For one, Spirit X3 uses it. Boost fusion supports it (`fusion/adapted/std_tuple.hpp`). Boost ASIO supports `std::chrono` instead of `boost::chrono` (`BOOST_ASIO_HAS_STD_CHRONO`) etc. etc. – sehe Nov 20 '15 at 23:43
  • Related answer: http://stackoverflow.com/questions/8851670/which-boost-features-overlap-with-c11/8852558#8852558 – sehe Nov 20 '15 at 23:44