// (C) Copyright Jeremy Siek 2000. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // This file checks to see if various standard container // implementations live up to requirements specified in the C++ // standard. As many implementations do not live to the requirements, // it is not uncommon for this file to fail to compile. The // BOOST_HIDE_EXPECTED_ERRORS macro is provided here if you want to // see as much of this file compile as possible. // #include #include #include #include #include #include #include #ifndef BOOST_NO_SLIST #include #endif // Define this macro if you want to hide the expected error, that is, // error in the various C++ standard library implementations. // //#define BOOST_HIDE_EXPECTED_ERRORS int main() { using namespace boost; #if defined(_ITERATOR_) && defined(BOOST_HIDE_EXPECTED_ERRORS) // VC++ STL implementation is not standard conformant and // fails to pass these concept checks #else typedef std::vector Vector; typedef std::deque Deque; typedef std::list List; // VC++ missing pointer and const_pointer typedefs function_requires< Mutable_RandomAccessContainerConcept >(); function_requires< BackInsertionSequenceConcept >(); #if !(defined(__GNUC__) && defined(BOOST_HIDE_EXPECTED_ERRORS)) #if !(defined(__sgi) && defined(BOOST_HIDE_EXPECTED_ERRORS)) // old deque iterator missing n + iter operation function_requires< Mutable_RandomAccessContainerConcept >(); #endif // warnings about signed and unsigned in old deque version function_requires< FrontInsertionSequenceConcept >(); function_requires< BackInsertionSequenceConcept >(); #endif // VC++ missing pointer and const_pointer typedefs function_requires< Mutable_ReversibleContainerConcept >(); function_requires< FrontInsertionSequenceConcept >(); function_requires< BackInsertionSequenceConcept >(); #ifndef BOOST_NO_SLIST typedef BOOST_STD_EXTENSION_NAMESPACE::slist SList; function_requires< FrontInsertionSequenceConcept >(); #endif typedef std::set Set; typedef std::multiset MultiSet; typedef std::map Map; typedef std::multimap MultiMap; function_requires< SortedAssociativeContainerConcept >(); function_requires< SimpleAssociativeContainerConcept >(); function_requires< UniqueAssociativeContainerConcept >(); function_requires< SortedAssociativeContainerConcept >(); function_requires< SimpleAssociativeContainerConcept >(); function_requires< MultipleAssociativeContainerConcept >(); function_requires< SortedAssociativeContainerConcept >(); function_requires< UniqueAssociativeContainerConcept >(); function_requires< PairAssociativeContainerConcept >(); function_requires< SortedAssociativeContainerConcept >(); function_requires< MultipleAssociativeContainerConcept >(); function_requires< PairAssociativeContainerConcept >(); #endif return 0; }