Boost C++ Libraries: Ticket #12442: container_traits is closed for extension https://svn.boost.org/trac10/ticket/12442 <p> I was split between filing this as a request to add support for std::deque to boost/pending/container_traits or the current title. Chose the latter. I believe container traits is only used by graph library and I could not see a component for "pending" so filing as a graph ticket. </p> <p> Summary: The problem is that the definitions for the supported containers and all the functions used for dispatching wrt to the given container are within a single file. So it is not easy/possible to extend it to add support for new containers. Especially for containers within the std namespace where it would be illegal extend into. </p> <p> Details: When trying to add support for std::deque to be used with adjacency_list, I kept getting compile errors as the compiler would not pick up the definitions for the specialized container traits. </p> <p> The attached file fails to compile with basically multiple variations of the error message "no matching function for container_category(...)" in the push_dispatch() function: </p> <p> { </p> <blockquote> <p> return push_dispatch(c, BOOST_PENDING_FWD_VALUE(T, v), container_category(c)); </p> </blockquote> <p> } </p> <p> Possible fix: Separate the container_traits to multiple files so that it would be possible to define specializations for other containers using the existing tags. For example for std::deque, existing tags are completely enough to specify. It can be defined by "random_access_container_tag" and "back_insertion_sequence_tag". If the tag definitions would be moved to another header file, then it would be possible to include that to define a new container in terms of the existing tag specifications. </p> <p> Please see the attached repro. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12442 Trac 1.4.3 anonymous Thu, 08 Sep 2016 22:39:02 GMT attachment set https://svn.boost.org/trac10/ticket/12442 https://svn.boost.org/trac10/ticket/12442 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">container_traits_issue.cpp</span> </li> </ul> Ticket