Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/icl/concept/set_value.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 /*-----------------------------------------------------------------------------+ | |
2 Copyright (c) 2010-2010: Joachim Faulhaber | |
3 +------------------------------------------------------------------------------+ | |
4 Distributed under the Boost Software License, Version 1.0. | |
5 (See accompanying file LICENCE.txt or copy at | |
6 http://www.boost.org/LICENSE_1_0.txt) | |
7 +-----------------------------------------------------------------------------*/ | |
8 #ifndef BOOST_ICL_CONCEPT_SET_VALUE_HPP_JOFA_100924 | |
9 #define BOOST_ICL_CONCEPT_SET_VALUE_HPP_JOFA_100924 | |
10 | |
11 #include <boost/icl/type_traits/is_set.hpp> | |
12 #include <boost/icl/type_traits/codomain_type_of.hpp> | |
13 | |
14 namespace boost{ namespace icl | |
15 { | |
16 | |
17 //============================================================================== | |
18 //= AlgoUnifiers<Set> | |
19 //============================================================================== | |
20 template<class Type, class Iterator> | |
21 inline typename enable_if<is_set<Type>, const typename Type::key_type>::type& | |
22 key_value(Iterator it_) | |
23 { | |
24 return *it_; | |
25 } | |
26 | |
27 template<class Type> | |
28 inline typename enable_if<is_set<Type>, typename Type::value_type>::type | |
29 make_value(const typename Type::key_type& key_val, | |
30 const typename codomain_type_of<Type>::type& ) | |
31 { | |
32 return typename Type::value_type(key_val); | |
33 } | |
34 | |
35 | |
36 }} // namespace boost icl | |
37 | |
38 #endif | |
39 | |
40 |