/* * File: container_traits_issue.cpp * Author: erdem * * Created on September 8, 2016, 3:09 PM */ #include #include namespace boost { // If contents of the graph_details namespace below are put inside // boost/pending/graph_traits.hpp, compile succeeds, namespace graph_detail { struct deque_tag : virtual public random_access_container_tag, virtual public back_insertion_sequence_tag { }; template deque_tag container_category(const std::deque&) { return deque_tag(); } template unstable_tag iterator_stability(const std::deque&) { return unstable_tag(); } template struct container_traits< std::deque > { typedef deque_tag category; typedef unstable_tag iterator_stability; }; } //ns: graph_detail } // ns: boost #include namespace boost { struct dequeS; template struct container_gen { typedef std::deque type; }; template <> struct parallel_edge_traits { typedef allow_parallel_edge_tag type; }; namespace detail { template <> struct is_random_access { enum { value = true }; typedef mpl::true_ type; }; } } int main(int argc, char** argv) { using namespace boost; typedef adjacency_list graph_t; graph_t g(2); boost::add_edge(0ul, 1ul, g); return 0; }