1 // Boost.Container varray
3 // Copyright (c) 2012-2013 Andrew Hundt.
4 // Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland.
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_CONTAINER_VARRAY_CONCEPT_HPP
11 #define BOOST_CONTAINER_VARRAY_CONCEPT_HPP
13 #include <boost/concept_check.hpp>
15 namespace boost { namespace container { namespace dtl { namespace concept {
18 * VArrayStrategyConcept
20 * \brief Checks strategy for varray<Value,Capacity,Strategy>, which has similarities to std::allocator
23 template<typename Strategy>
24 struct VArrayStrategy {
25 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
27 // typedefs are the same as in std::allocator
28 typedef typename Strategy::value_type value_type;
29 typedef typename Strategy::size_type size_type;
30 typedef typename Strategy::difference_type difference_type;
31 typedef typename Strategy::pointer pointer;
32 typedef typename Strategy::const_pointer const_pointer;
33 typedef typename Strategy::reference reference;
34 typedef typename Strategy::const_reference const_reference;
40 Strategy const* str = 0;
42 // must implement allocate_failed
43 str->allocate_failed();
45 boost::ignore_unused_variable_warning(str);
50 BOOST_CONCEPT_USAGE(VArrayStrategy)
52 check_methods::apply();
58 }}}} // namespace boost::container::dtl::concept
60 #endif //BOOST_CONTAINER_VARRAY_CONCEPT_HPP