#ifndef ORIGIN_VECTOR_POLICIES_HPP #define ORIGIN_VECTOR_POLICIES_HPP #include #include #include namespace origin { /** @internal * The vector_policies class template is used to deduce policies or assign * default values, and provide a central location for storing any policy * objects. This class is inherited by the vector base. */ template struct vector_policies { typedef Policies policies_type; // Deduce and rebind the allocator typedef typename rebind_allocator::type allocator_type; typedef typename extract_visitor::type visitor_type; typedef typename extract_bounds_error::type bounds_error_type; typedef typename extract_length_error::type length_error_type; typedef typename vector_::extract_grow::type>::type grower; typedef typename vector_::extract_shrink::type>::type shrinker; /** Return a copy of the vector's visitor. */ visitor_type get_visitor() const { return get(_policies); } /** Return an object that can be used to grow the vector. */ grower grow_function() const { return grower(); } /** Return an object that can be used to shrink the vector. */ shrinker shrink_function() const { return shrinker(); } /** Return the bounds error policy. */ bounds_error_type get_bounds_error() const { return bounds_error_type(); } /** Return the length error policiy. */ length_error_type get_length_error() const { return length_error_type(); } policies_type _policies; }; } // namespace origin #endif