Chris@16: // boost lockfree Chris@16: // Chris@16: // Copyright (C) 2011 Tim Blechmann Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_LOCKFREE_DETAIL_PARAMETER_HPP Chris@16: #define BOOST_LOCKFREE_DETAIL_PARAMETER_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace lockfree { Chris@16: namespace detail { Chris@16: Chris@16: namespace mpl = boost::mpl; Chris@16: Chris@16: template Chris@16: struct has_arg Chris@16: { Chris@16: typedef typename parameter::binding::type type; Chris@16: static const bool value = mpl::is_not_void_::type::value; Chris@16: }; Chris@16: Chris@16: Chris@16: template Chris@16: struct extract_capacity Chris@16: { Chris@16: static const bool has_capacity = has_arg::value; Chris@16: Chris@16: typedef typename mpl::if_c::type, Chris@16: mpl::size_t< 0 > Chris@16: >::type capacity_t; Chris@16: Chris@16: static const std::size_t capacity = capacity_t::value; Chris@16: }; Chris@16: Chris@16: Chris@16: template Chris@16: struct extract_allocator Chris@16: { Chris@16: static const bool has_allocator = has_arg::value; Chris@16: Chris@16: typedef typename mpl::if_c::type, Chris@16: std::allocator Chris@16: >::type allocator_arg; Chris@16: Chris@16: typedef typename allocator_arg::template rebind::other type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct extract_fixed_sized Chris@16: { Chris@16: static const bool has_fixed_sized = has_arg::value; Chris@16: Chris@16: typedef typename mpl::if_c::type, Chris@16: mpl::bool_ Chris@16: >::type type; Chris@16: Chris@16: static const bool value = type::value; Chris@16: }; Chris@16: Chris@16: Chris@16: } /* namespace detail */ Chris@16: } /* namespace lockfree */ Chris@16: } /* namespace boost */ Chris@16: Chris@16: #endif /* BOOST_LOCKFREE_DETAIL_PARAMETER_HPP */