forked from boostorg/function_types
Compare commits
59 Commits
svn-branch
...
master
Author | SHA1 | Date | |
---|---|---|---|
895335874d | |||
f285a08088 | |||
9dc87ec137 | |||
95997705ed | |||
72ccfa3b96 | |||
867588b91e | |||
0f29b01478 | |||
fa90de2a36 | |||
669f083f33 | |||
920574cb75 | |||
c448940ca6 | |||
79620e3e60 | |||
5f41eff589 | |||
ae4fde2e2a | |||
4f247c06e4 | |||
78dabb2dd8 | |||
f542321082 | |||
842b853351 | |||
b7e56e1c35 | |||
9699db7e6c | |||
4c250985a1 | |||
ed059784b9 | |||
1e434eff75 | |||
27aeab935b | |||
fd39273e0d | |||
b3e185a544 | |||
85cf2ccd77 | |||
d81450d8ca | |||
915d444667 | |||
77dffdafff | |||
e74cb4aa4a | |||
22c5c2ae4f | |||
290a8e88e7 | |||
26e800a52f | |||
fa1a0fec9c | |||
0c7bebd130 | |||
f99be38d89 | |||
c86381fb4c | |||
222884c4f7 | |||
8af990ab6f | |||
3ec0754b4f | |||
caed0a6ee8 | |||
2cc2141906 | |||
46f56ef9ae | |||
e7fcc6818b | |||
38cc207b23 | |||
1f2bc4d8d3 | |||
7e239167da | |||
a7f9fa0eda | |||
4e48421f9d | |||
5f0d9dd0a8 | |||
6ba2a45f5f | |||
91f47b7bc6 | |||
f451e18ef2 | |||
cde937faaa | |||
6f100429eb | |||
51aca6c98c | |||
291304b704 | |||
e04f655cc7 |
42
.travis.yml
Normal file
42
.travis.yml
Normal file
@ -0,0 +1,42 @@
|
||||
# Copyright 2016 Edward Diener
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
python: "2.7"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init tools/boostdep
|
||||
- git submodule update --init tools/boost_install
|
||||
- git submodule update --init libs/headers
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/function_types
|
||||
- python tools/boostdep/depinst/depinst.py -I example function_types
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
script:
|
||||
- TOOLSET=gcc,clang
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then TOOLSET=clang; fi
|
||||
- ./b2 --verbose-test libs/config/test//config_info toolset=$TOOLSET || true
|
||||
- ./b2 libs/function_types/test toolset=$TOOLSET
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: always
|
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
# Copyright 2019 Mike Dev
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
cmake_minimum_required( VERSION 3.5...3.20 )
|
||||
project( boost_function_types VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX )
|
||||
|
||||
add_library( boost_function_types INTERFACE )
|
||||
add_library( Boost::function_types ALIAS boost_function_types )
|
||||
|
||||
target_include_directories( boost_function_types INTERFACE include )
|
||||
|
||||
target_link_libraries( boost_function_types
|
||||
INTERFACE
|
||||
Boost::config
|
||||
Boost::core
|
||||
Boost::detail
|
||||
Boost::mpl
|
||||
Boost::preprocessor
|
||||
Boost::type_traits
|
||||
)
|
48
appveyor.yml
Normal file
48
appveyor.yml
Normal file
@ -0,0 +1,48 @@
|
||||
# Copyright 2017 Edward Diener
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
version: 1.0.{build}-{branch}
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-10.0,msvc-11.0
|
||||
ADDRMD: 32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-12.0,msvc-14.0
|
||||
ADDRESS_MODEL: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1
|
||||
CXXSTD: 14,17
|
||||
ADDRESS_MODEL: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
TOOLSET: msvc-14.2
|
||||
CXXSTD: 14,17
|
||||
ADDRESS_MODEL: 32,64
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init tools/boostdep
|
||||
- git submodule update --init tools/boost_install
|
||||
- git submodule update --init libs/headers
|
||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\function_types
|
||||
- python tools/boostdep/depinst/depinst.py -I example function_types
|
||||
- bootstrap
|
||||
- b2 headers
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- b2 libs/function_types/test toolset=%TOOLSET%
|
@ -19,3 +19,9 @@ boostbook standalone
|
||||
<xsl:param>toc.max.depth=1
|
||||
;
|
||||
|
||||
|
||||
###############################################################################
|
||||
alias boostdoc ;
|
||||
explicit boostdoc ;
|
||||
alias boostrelease : standalone ;
|
||||
explicit boostrelease ;
|
||||
|
@ -837,6 +837,43 @@ values for the same property the value of the rightmost argument is used.
|
||||
|
||||
[endsect]
|
||||
|
||||
[section:has_property_tag has_property_tag]
|
||||
|
||||
template<class Tag, class PropertyTag>
|
||||
struct has_property_tag;
|
||||
|
||||
[*Header]
|
||||
|
||||
#include <boost/function_types/property_tags.hpp>
|
||||
|
||||
[variablelist
|
||||
[[[^Tag]][Possibly compound property tag]]
|
||||
[[[^PropertyTag]][Single property tag]]
|
||||
[[[^has_property_tag<Tag,PropertyTag>]][Test (possibly) compound property tag for single property tag]]
|
||||
]
|
||||
|
||||
A metafunction for testing that a compound property tag has a particular single
|
||||
property tag in its composition. Returns a boolean value of true if the particular single
|
||||
property tag is part of the compound property tag, otherwise false.
|
||||
|
||||
For convenience there are also individual metafunctions for the built-in property tags of the form
|
||||
|
||||
template<class Tag>
|
||||
struct has_'name'_property_tag;
|
||||
|
||||
which works exactly the same as `has_property_tag`, where name can be
|
||||
[^variadic],[^default_cc],[^const],[^volatile],[^cv],or [^null].
|
||||
In these individual metafunctions [^const] is short for [^const_qualified],
|
||||
[^volatile] is short for [^volatile_qualified],
|
||||
[^cv] is short for [^cv_qualified], and [^null] is short for [^null_tag].
|
||||
|
||||
[note Testing for the [^null_tag], with either `has_property_tag<Tag,null_tag>`
|
||||
or `has_null_property_tag<Tag>`, always tests whether the [^Tag] is the single
|
||||
[^null_tag] property_tag.
|
||||
]
|
||||
|
||||
[endsect]
|
||||
|
||||
[endsect] [/ Tag Types]
|
||||
|
||||
[/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ]
|
||||
|
@ -62,7 +62,7 @@
|
||||
// ============
|
||||
//
|
||||
// [Dimov1] Dimov, P., Hinnant H., Abrahams, D. The Forwarding Problem
|
||||
// http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1385.htm
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm
|
||||
//
|
||||
// [Dimov2] Dimov, P. Documentation of boost::mem_fn
|
||||
// http://www.boost.org/libs/bind/mem_fn.html
|
||||
|
@ -26,7 +26,7 @@
|
||||
//
|
||||
// [Gregor02] Gregor, D. A uniform method for computing function object return
|
||||
// types (revision 1)
|
||||
// http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1454.html
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1454.html
|
||||
|
||||
#include <boost/function_types/result_type.hpp>
|
||||
#include <boost/function_types/is_callable_builtin.hpp>
|
||||
@ -57,7 +57,7 @@ namespace example
|
||||
typedef typename F::template result<Desc>::type type;
|
||||
};
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x564))
|
||||
#if !BOOST_WORKAROUND(BOOST_BORLANDC,BOOST_TESTED_AT(0x564))
|
||||
template<typename F>
|
||||
struct result_member_template< F, F(void) >
|
||||
{
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
@ -23,7 +22,7 @@
|
||||
#include <boost/mpl/integral_c.hpp>
|
||||
#include <boost/mpl/vector/vector0.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x565)
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x565)
|
||||
# include <boost/type_traits/remove_cv.hpp>
|
||||
|
||||
# include <boost/mpl/identity.hpp>
|
||||
@ -47,7 +46,6 @@
|
||||
|
||||
#include <boost/function_types/config/config.hpp>
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
# if BOOST_FT_MAX_ARITY < 10
|
||||
# include <boost/mpl/vector/vector10.hpp>
|
||||
# elif BOOST_FT_MAX_ARITY < 20
|
||||
@ -59,9 +57,6 @@
|
||||
# elif BOOST_FT_MAX_ARITY < 50
|
||||
# include <boost/mpl/vector/vector50.hpp>
|
||||
# endif
|
||||
#else
|
||||
# include <boost/function_types/detail/classifier.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/function_types/detail/class_transform.hpp>
|
||||
#include <boost/function_types/property_tags.hpp>
|
||||
@ -81,14 +76,14 @@ namespace boost
|
||||
namespace detail
|
||||
{
|
||||
template<typename T, typename L> struct components_impl;
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x565)
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x565)
|
||||
template<typename T, typename OrigT, typename L> struct components_bcc;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T, typename ClassTypeTransform>
|
||||
struct components
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x565)
|
||||
#if !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x565)
|
||||
: detail::components_impl<T, ClassTypeTransform>
|
||||
#else
|
||||
: detail::components_bcc<typename remove_cv<T>::type,T,
|
||||
@ -260,7 +255,7 @@ namespace boost
|
||||
typename detail::class_transform<C,L>::type > types;
|
||||
};
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x565)
|
||||
#if !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x565)
|
||||
# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer
|
||||
|
||||
template<typename T, class C, typename L>
|
||||
@ -420,8 +415,6 @@ namespace boost
|
||||
|
||||
} } // namespace function_types::detail
|
||||
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::components)
|
||||
|
||||
} // namespace ::boost
|
||||
|
||||
#include <boost/function_types/detail/components_as_mpl_sequence.hpp>
|
||||
|
@ -91,11 +91,11 @@
|
||||
# define __fastcall __attribute__((__fastcall__))
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
#elif defined(BOOST_BORLANDC)
|
||||
|
||||
# if __BORLANDC__ < 0x550
|
||||
# if BOOST_BORLANDC < 0x550
|
||||
# error "unsupported compiler version"
|
||||
# elif __BORLANDC__ > 0x565
|
||||
# elif BOOST_BORLANDC > 0x565
|
||||
# pragma message("WARNING: library untested with this compiler version")
|
||||
# endif
|
||||
|
||||
|
@ -28,7 +28,6 @@ struct class_transform
|
||||
{ typedef typename mpl::apply1<L,T>::type type; };
|
||||
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
// We can short-circuit the mechanism implemented in the primary template for
|
||||
// the most common lambda expression and save both the "un-lambdaing" and the
|
||||
// type traits invocation (we know that T can only be a class type).
|
||||
@ -53,7 +52,6 @@ template<typename T> struct class_transform< T, add_pointer< remove_cv<_> > >
|
||||
|
||||
template<typename T, typename U> struct class_transform< T, mpl::always<U> >
|
||||
{ typedef U type; };
|
||||
#endif
|
||||
|
||||
|
||||
} } } // namespace ::boost::function_types::detail
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#include <boost/type.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/config.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
|
||||
@ -31,7 +30,13 @@ template<bits_t Flags, bits_t CCID, std::size_t Arity> struct encode_charr
|
||||
>::type type;
|
||||
};
|
||||
|
||||
char BOOST_TT_DECL classifier_impl(...);
|
||||
#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && !defined(BOOST_DISABLE_WIN32))
|
||||
# define BOOST_FT_DECL __cdecl
|
||||
#else
|
||||
# define BOOST_FT_DECL /**/
|
||||
#endif
|
||||
|
||||
char BOOST_FT_DECL classifier_impl(...);
|
||||
|
||||
#define BOOST_FT_variations BOOST_FT_function|BOOST_FT_pointer|\
|
||||
BOOST_FT_member_pointer
|
||||
|
@ -12,8 +12,7 @@
|
||||
#include <cstddef>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, <= 0x582)
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x582)
|
||||
# include <boost/type_traits/remove_cv.hpp>
|
||||
# include <boost/type_traits/remove_pointer.hpp>
|
||||
# include <boost/type_traits/remove_reference.hpp>
|
||||
@ -23,8 +22,7 @@
|
||||
|
||||
namespace boost { namespace function_types { namespace detail {
|
||||
|
||||
#if ! (defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, <= 0x582))
|
||||
#if !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x582)
|
||||
|
||||
template<typename T> struct cv_traits
|
||||
{ typedef non_cv tag; typedef T type; };
|
||||
|
@ -32,14 +32,12 @@ struct to_sequence
|
||||
type;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
// reduce template instantiations, if possible
|
||||
template<typename T, typename U>
|
||||
struct to_sequence< components<T,U> >
|
||||
{
|
||||
typedef typename components<T,U>::types type;
|
||||
};
|
||||
#endif
|
||||
|
||||
} } } // namespace ::boost::function_types::detail
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/is_callable_builtin.hpp>
|
||||
#include <boost/function_types/components.hpp>
|
||||
@ -31,7 +30,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,function_arity,(T))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,function_types::function_arity)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_FUNCTION_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/function_type.hpp>
|
||||
|
||||
@ -25,7 +24,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,function_pointer,(Types,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::function_pointer)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_FUNCTION_REFERENCE_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/function_type.hpp>
|
||||
|
||||
@ -25,7 +24,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,function_reference,(Types,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::function_reference)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -22,7 +22,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,function_type,(Types,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::function_type)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_IS_CALLABLE_BUILTIN_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
@ -28,7 +27,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_callable_builtin,(T,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::is_callable_builtin)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -9,7 +9,6 @@
|
||||
#define BOOST_FT_IS_FUNCTION_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
@ -27,7 +26,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_function,(T,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::is_function)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_IS_FUNCTION_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
@ -28,7 +27,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_function_pointer,(T,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::is_function_pointer)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_IS_FUNCTION_REFERENCE_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
@ -27,7 +26,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_function_reference,(T,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::is_function_reference)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
@ -27,7 +26,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_member_function_pointer,(T,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::is_member_function_pointer)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
@ -27,7 +26,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_member_object_pointer,(T))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,function_types::is_member_object_pointer)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -9,7 +9,6 @@
|
||||
#define BOOST_FT_IS_MEMBER_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
@ -27,7 +26,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_member_pointer,(T,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::is_member_pointer)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_IS_NONMEMBER_CALLABLE_BUILTIN_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
@ -28,7 +27,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_nonmember_callable_builtin,(T,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::is_nonmember_callable_builtin)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/detail/synthesize.hpp>
|
||||
#include <boost/function_types/detail/to_sequence.hpp>
|
||||
@ -26,7 +25,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,member_function_pointer,(Types,Tag))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::member_function_pointer)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define BOOST_FT_MEMBER_OBJECT_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/function_types/detail/synthesize.hpp>
|
||||
#include <boost/function_types/detail/to_sequence.hpp>
|
||||
@ -26,7 +25,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,member_object_pointer,(Types))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,function_types::member_object_pointer)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/mpl/pop_front.hpp>
|
||||
|
||||
@ -48,7 +47,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,parameter_types,(T,ClassTypeTransform))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::parameter_types)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/mpl/bitxor.hpp>
|
||||
|
||||
|
||||
@ -102,7 +103,6 @@ struct tag
|
||||
detail::compound_tag<Tag3,Tag4> >
|
||||
{ };
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
template<class Tag1, class Tag2, class Tag3> struct tag<Tag1,Tag2,Tag3,null_tag>
|
||||
: detail::compound_tag<detail::compound_tag<Tag1,Tag2>,Tag3>
|
||||
{ };
|
||||
@ -112,7 +112,6 @@ template<class Tag1, class Tag2> struct tag<Tag1,Tag2,null_tag,null_tag>
|
||||
template<class Tag1> struct tag<Tag1,null_tag,null_tag,null_tag>
|
||||
: Tag1
|
||||
{ };
|
||||
#endif
|
||||
|
||||
|
||||
template<class Tag, class QueryTag> struct represents
|
||||
@ -136,6 +135,20 @@ template<class Tag, class QueryTag> struct extract
|
||||
> mask;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
The following is a metafunction which checks whether a
|
||||
property tag is in a possibly compounded tag type.
|
||||
|
||||
Here both the possibly compounded tag type and a property tag
|
||||
is given.
|
||||
|
||||
*/
|
||||
|
||||
template<class Tag, class PropertyTag> struct has_property_tag
|
||||
: detail::represents_impl<Tag, PropertyTag>
|
||||
{ };
|
||||
|
||||
} } // namespace ::boost::function_types
|
||||
|
||||
#include <boost/function_types/detail/pp_tags/preprocessed.hpp>
|
||||
@ -143,6 +156,43 @@ template<class Tag, class QueryTag> struct extract
|
||||
namespace boost { namespace function_types {
|
||||
#define BOOST_FT_cc_file <boost/function_types/detail/pp_tags/cc_tag.hpp>
|
||||
#include <boost/function_types/detail/pp_loop.hpp>
|
||||
|
||||
/*
|
||||
|
||||
The following are metafunctions which check whether the
|
||||
specific property tag is in a possibly compounded tag type.
|
||||
Here only the possibly compounded tag type is given.
|
||||
|
||||
*/
|
||||
|
||||
template<class Tag> struct has_property_tag<Tag,null_tag>
|
||||
: ::boost::is_same<Tag, null_tag>
|
||||
{ };
|
||||
|
||||
template<class Tag> struct has_variadic_property_tag
|
||||
: has_property_tag<Tag, variadic>
|
||||
{ };
|
||||
|
||||
template<class Tag> struct has_default_cc_property_tag
|
||||
: has_property_tag<Tag, default_cc>
|
||||
{ };
|
||||
|
||||
template<class Tag> struct has_const_property_tag
|
||||
: has_property_tag<Tag, const_qualified>
|
||||
{ };
|
||||
|
||||
template<class Tag> struct has_volatile_property_tag
|
||||
: has_property_tag<Tag, volatile_qualified>
|
||||
{ };
|
||||
|
||||
template<class Tag> struct has_cv_property_tag
|
||||
: has_property_tag<Tag, cv_qualified>
|
||||
{ };
|
||||
|
||||
template<class Tag> struct has_null_property_tag
|
||||
: has_property_tag<Tag, null_tag>
|
||||
{ };
|
||||
|
||||
} } // namespace boost::function_types
|
||||
|
||||
#endif
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
#include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
|
||||
#include <boost/mpl/at.hpp>
|
||||
|
||||
@ -43,7 +42,6 @@ namespace boost
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,result_type,(T))
|
||||
};
|
||||
}
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,function_types::result_type)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
16
meta/libraries.json
Normal file
16
meta/libraries.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"key": "function_types",
|
||||
"name": "Function Types",
|
||||
"authors": [
|
||||
"Tobias Schwinger"
|
||||
],
|
||||
"description": "Boost.FunctionTypes provides functionality to classify, decompose and synthesize function, function pointer, function reference and pointer to member types.",
|
||||
"category": [
|
||||
"Generic",
|
||||
"Metaprogramming"
|
||||
],
|
||||
"maintainers": [
|
||||
"Tobias Schwinger <tschwinger -at- isonews2.com>"
|
||||
],
|
||||
"cxxstd": "03"
|
||||
}
|
12
test/Jamfile
12
test/Jamfile
@ -64,11 +64,15 @@ import testing ;
|
||||
|
||||
# Custom calling conventions
|
||||
|
||||
[ compile custom_ccs/nonmember_ccs.cpp ]
|
||||
[ compile custom_ccs/nonmember_ccs_exact.cpp ]
|
||||
[ compile custom_ccs/member_ccs.cpp ]
|
||||
[ compile custom_ccs/member_ccs_exact.cpp ]
|
||||
[ compile custom_ccs/nonmember_ccs.cpp : <address-model>64:<build>no ]
|
||||
[ compile custom_ccs/nonmember_ccs_exact.cpp : <address-model>64:<build>no ]
|
||||
[ compile custom_ccs/member_ccs.cpp : <address-model>64:<build>no ]
|
||||
[ compile custom_ccs/member_ccs_exact.cpp : <address-model>64:<build>no ]
|
||||
|
||||
# Property tag
|
||||
|
||||
[ compile custom_ccs/property_tag.cpp ]
|
||||
|
||||
# Code from the examples
|
||||
|
||||
[ compile ../example/interpreter_example.cpp ]
|
||||
|
64
test/custom_ccs/property_tag.cpp
Normal file
64
test/custom_ccs/property_tag.cpp
Normal file
@ -0,0 +1,64 @@
|
||||
|
||||
// (C) Copyright Edward Diener 2019
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/function_types/property_tags.hpp>
|
||||
|
||||
namespace ft = boost::function_types;
|
||||
namespace mpl = boost::mpl;
|
||||
|
||||
typedef ft::tag<ft::variadic,ft::non_volatile,ft::non_const,ft::default_cc> tag1;
|
||||
typedef ft::tag<ft::const_non_volatile,ft::const_qualified> tag2;
|
||||
typedef ft::tag<ft::cv_qualified,ft::variadic> tag3;
|
||||
typedef ft::null_tag tag4;
|
||||
typedef ft::tag<ft::variadic,ft::volatile_non_const> tag5;
|
||||
typedef ft::tag<ft::volatile_qualified,ft::non_const,ft::variadic> tag6;
|
||||
typedef ft::tag<ft::non_variadic,ft::const_non_volatile,ft::default_cc> tag7;
|
||||
typedef ft::tag<ft::non_cv,ft::default_cc> tag8;
|
||||
|
||||
BOOST_MPL_ASSERT((ft::has_property_tag<tag1, ft::variadic>));
|
||||
BOOST_MPL_ASSERT((ft::has_property_tag<tag2, ft::const_qualified>));
|
||||
BOOST_MPL_ASSERT((ft::has_property_tag<tag3, ft::cv_qualified>));
|
||||
BOOST_MPL_ASSERT((ft::has_property_tag<tag4, ft::null_tag>));
|
||||
BOOST_MPL_ASSERT((ft::has_property_tag<tag5, ft::volatile_qualified>));
|
||||
BOOST_MPL_ASSERT((ft::has_property_tag<tag6, ft::volatile_qualified>));
|
||||
BOOST_MPL_ASSERT((ft::has_property_tag<tag7, ft::const_qualified>));
|
||||
BOOST_MPL_ASSERT((ft::has_property_tag<tag8, ft::default_cc>));
|
||||
|
||||
BOOST_MPL_ASSERT((ft::has_variadic_property_tag<tag1>));
|
||||
BOOST_MPL_ASSERT((ft::has_variadic_property_tag<tag3>));
|
||||
BOOST_MPL_ASSERT((ft::has_variadic_property_tag<tag5>));
|
||||
BOOST_MPL_ASSERT((ft::has_variadic_property_tag<tag6>));
|
||||
BOOST_MPL_ASSERT((ft::has_default_cc_property_tag<tag1>));
|
||||
BOOST_MPL_ASSERT((ft::has_default_cc_property_tag<tag7>));
|
||||
BOOST_MPL_ASSERT((ft::has_default_cc_property_tag<tag8>));
|
||||
BOOST_MPL_ASSERT((ft::has_const_property_tag<tag2>));
|
||||
BOOST_MPL_ASSERT((ft::has_const_property_tag<tag3>));
|
||||
BOOST_MPL_ASSERT((ft::has_const_property_tag<tag7>));
|
||||
BOOST_MPL_ASSERT((ft::has_volatile_property_tag<tag3>));
|
||||
BOOST_MPL_ASSERT((ft::has_volatile_property_tag<tag5>));
|
||||
BOOST_MPL_ASSERT((ft::has_volatile_property_tag<tag6>));
|
||||
BOOST_MPL_ASSERT((ft::has_cv_property_tag<tag3>));
|
||||
BOOST_MPL_ASSERT((ft::has_null_property_tag<tag4>));
|
||||
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag1, ft::const_qualified>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag2, ft::cv_qualified>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag3, ft::null_tag>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag4, ft::volatile_qualified>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag5, ft::const_qualified>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag6, ft::default_cc>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag7, ft::variadic>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag8, ft::volatile_qualified>));
|
||||
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_variadic_property_tag<tag2>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_default_cc_property_tag<tag6>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_const_property_tag<tag4>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_const_property_tag<tag5>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_volatile_property_tag<tag7>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_cv_property_tag<tag1>));
|
||||
BOOST_MPL_ASSERT_NOT((ft::has_null_property_tag<tag8>));
|
Reference in New Issue
Block a user