Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interoperability between Boost and C++11

Tags:

c++

c++11

boost

What is the extent of interoperability between C++11 and a recent version of Boost (say 1.55) built with a C++11 compiler.

  1. Does the behavior of any library feature change depending on whether I built the libraries with c++11 flags enabled or not?
  2. How do language features like lambda functions cooperate with Boost's lambdas?
like image 309
CppNoob Avatar asked Mar 26 '14 11:03

CppNoob


People also ask

Does Boost work with C?

Boost can't be used with C as it uses OOP features from C++.

Does boost support C ++ 20?

Known Issues. Boost. Operators is currently incompatible with C++20 compilers, which in some cases may manifest as an infinite recursion or infinite loop in runtime when a comparison operator is called.

Is boost cross platform?

Boost. Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach. An overview of the features included in Boost.

Is Boost part of C++?

Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries (as of version 1.76).


1 Answers

  1. You cannot use objects built with gcc with and without -std=c++11 together. You will get link errors or even runtime crashes. I cannot vouch for other C++ implementations. So at least with gcc, you do need to build a separate version of Boost with c++11 mode enabled.
  2. They are pretty much independent. They don't cooperate and don't interfere with each other.

EDIT I see people are still reading (and upvoting!) this answer. Point 1 is no longer true (or perhaps never was true). Versions of gcc from I think 5.1 upwards use an ABI compatible with -std=<anything> by default.

like image 144
n. 1.8e9-where's-my-share m. Avatar answered Sep 23 '22 07:09

n. 1.8e9-where's-my-share m.