What is the difference between std :: deque and boost: deque?

std::dequepretty well documented in CppReference , but boost::dequeseems to be equivalent to a standard standard, with the addition of several methods such as nthand index_of.

Are there other differences between the two classes that I am missing?

+4
source share
1 answer

Yes, there are other differences. For example, boost::dequecan be created with incomplete types. So you can get the following:

struct foo
{
  boost::deque<foo> foos;
};

whereas the following behavior is undefined (although it may work well with certain implementations.)

struct foo
{
  std::deque<foo> foos;
};
+3
source

Source: https://habr.com/ru/post/1623642/


All Articles