scide: implement selectionLength for openDocument
[supercollider.git] / external_libraries / boost-lockfree / boost / lockfree / detail / parameter.hpp
blobcb2be45515be0b05c5dc30b973d359b00634518f
1 // boost lockfree
2 //
3 // Copyright (C) 2011 Tim Blechmann
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_LOCKFREE_DETAIL_PARAMETER_HPP
10 #define BOOST_LOCKFREE_DETAIL_PARAMETER_HPP
12 #include <boost/lockfree/policies.hpp>
13 #include <boost/integer_traits.hpp>
15 namespace boost {
16 namespace lockfree {
17 namespace detail {
19 namespace mpl = boost::mpl;
21 template <typename bound_args, typename tag_type>
22 struct has_arg
24 typedef typename parameter::binding<bound_args, tag_type, mpl::void_>::type type;
25 static const bool value = mpl::is_not_void_<type>::type::value;
29 template <typename bound_args>
30 struct extract_capacity
32 static const bool has_capacity = has_arg<bound_args, tag::capacity>::value;
34 typedef typename mpl::if_c<has_capacity,
35 typename has_arg<bound_args, tag::capacity>::type,
36 mpl::size_t< boost::integer_traits<size_t>::const_max >
37 >::type capacity_t;
39 static const std::size_t capacity = capacity_t::value;
43 template <typename bound_args, typename T>
44 struct extract_allocator
46 static const bool has_allocator = has_arg<bound_args, tag::allocator>::value;
48 typedef typename mpl::if_c<has_allocator,
49 typename has_arg<bound_args, tag::allocator>::type,
50 std::allocator<T>
51 >::type allocator_arg;
53 typedef typename allocator_arg::template rebind<T>::other type;
56 template <typename bound_args, bool default_ = false>
57 struct extract_fixed_sized
59 static const bool has_fixed_sized = has_arg<bound_args, tag::fixed_sized>::value;
61 typedef typename mpl::if_c<has_fixed_sized,
62 typename has_arg<bound_args, tag::fixed_sized>::type,
63 mpl::bool_<default_>
64 >::type type;
66 static const bool value = type::value;
70 } /* namespace detail */
71 } /* namespace lockfree */
72 } /* namespace boost */
74 #endif /* BOOST_LOCKFREE_DETAIL_PARAMETER_HPP */