Subject: [Boost-bugs] [Boost C++ Libraries] #12442: container_traits is closed for extension
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-09-08 22:38:37
#12442: container_traits is closed for extension
-------------------------------------------------+-------------------------
Reporter: erdem.cilingir@⦠| Owner: jewillco
Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
Version: Boost 1.61.0 | Severity: Problem
Keywords: graph, container_traits, |
container_category |
-------------------------------------------------+-------------------------
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.
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.
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.
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:
{
return push_dispatch(c, BOOST_PENDING_FWD_VALUE(T, v),
container_category(c));
}
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.
Please see the attached repro.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12442> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC