Compare commits

...

30 Commits

Author SHA1 Message Date
895335874d Update CMakeLists.txt 2021-06-10 01:02:01 +03:00
f285a08088 Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries whose minumum C++ standard compilation level is C++11 on up. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-11 11:26:46 -05:00
9dc87ec137 VC++ 10 and VC++ 11 are only supported for 32 bits in Appveyor 2020-11-24 16:00:31 -05:00
95997705ed Merge pull request #10 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74. Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost conf…
2020-04-17 11:09:22 -04:00
72ccfa3b96 Updated Appveyor configuration 2020-04-17 09:51:46 -04:00
867588b91e Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-30 16:55:12 -04:00
0f29b01478 Merge pull request #9 from eldiener/develop
Added metafunction for testing a property tag
2020-01-25 03:03:31 -05:00
fa90de2a36 Added documentation for the new metafunctions has_property_tag and its individual equivalents. 2020-01-18 11:40:22 -05:00
669f083f33 Added functionality and tests that allow a possibly compound property tag to be queried to see if a given property tag is in it. This is useful if the end-user needs to know if, let's say, a const property has been set in the property tag. Since a property tag may be a compound property tag consisting of more than one property tag it is not possible to determine such a thing by just using boost::is_same to see if the two are equal. 2020-01-18 03:35:19 -05:00
920574cb75 Merge pull request #8 from Mike-Devel/min_cmake
[CMake] Add minimal cmake support
2019-03-04 16:47:14 -05:00
c448940ca6 [CMake] Remove dot from project name 2019-03-04 22:43:37 +01:00
79620e3e60 [CMake] Add minimal cmake support
- CMake file only supports add_subdirectory workflow.
- Provides Boost::function_types target,
  but no installation and no unit tests.
2019-02-14 18:56:56 +01:00
5f41eff589 Updated for b2 cmake support. 2018-12-19 22:17:18 -05:00
ae4fde2e2a Removed --depth 1 2017-10-29 21:41:25 -04:00
4f247c06e4 Merge pull request #6 from boostorg/pr/depinst-include-example
Add `-I example` to depinst invocation
2017-10-25 22:03:25 -04:00
78dabb2dd8 Add -I example to depinst invocation 2017-10-26 01:13:09 +03:00
f542321082 Remove comments in appveyor and travis files. 2017-10-14 19:54:13 -04:00
842b853351 Use boostdep to find dependencies in the example subdirectory. 2017-10-14 18:57:40 -04:00
b7e56e1c35 More appveyor/travis dependencies. 2017-10-14 12:14:09 -04:00
9699db7e6c Added concept_check as a travis/appveyor dependency. 2017-10-14 11:16:57 -04:00
4c250985a1 Merge branch 'develop' of https://github.com/boostorg/function_types into develop
# Conflicts:
#	.travis.yml
#	appveyor.yml
2017-10-14 10:47:02 -04:00
ed059784b9 Corrected numeric_conversion to numeric/conversion 2017-10-14 10:44:50 -04:00
1e434eff75 Added more travis/appveyor dependencies. 2017-10-14 07:09:03 -04:00
27aeab935b Add timer and iterator dependencies for examples. 2017-10-13 22:10:49 -04:00
fd39273e0d Add tokenizer library manually since it is used when testing the examples. 2017-10-13 19:31:13 -04:00
b3e185a544 Disable custom calling conventions test for 64-bit address model. 2017-10-13 16:14:25 -04:00
85cf2ccd77 Better appveyor file setup. 2017-10-09 12:06:15 -04:00
d81450d8ca Added Appveyor file and Travis CI file. 2017-10-09 08:13:29 -04:00
915d444667 Merge branch 'master' into develop 2017-04-24 12:20:28 -04:00
e74cb4aa4a Add, and update, documentation build targets. 2016-10-07 23:07:34 -05:00
13 changed files with 285 additions and 16 deletions

42
.travis.yml Normal file
View 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
View 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
View 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%

View File

@ -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]
[/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ]

View File

@ -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) >
{

View File

@ -22,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>
@ -76,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,
@ -255,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>

View File

@ -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

View File

@ -30,7 +30,7 @@ template<bits_t Flags, bits_t CCID, std::size_t Arity> struct encode_charr
>::type type;
};
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && !defined(BOOST_DISABLE_WIN32))
# define BOOST_FT_DECL __cdecl
#else
# define BOOST_FT_DECL /**/

View File

@ -12,7 +12,7 @@
#include <cstddef>
#include <boost/detail/workaround.hpp>
#if 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>
@ -22,7 +22,7 @@
namespace boost { namespace function_types { namespace detail {
#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x582)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x582)
template<typename T> struct cv_traits
{ typedef non_cv tag; typedef T type; };

View File

@ -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>
@ -134,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>
@ -141,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

View File

@ -11,5 +11,6 @@
],
"maintainers": [
"Tobias Schwinger <tschwinger -at- isonews2.com>"
]
],
"cxxstd": "03"
}

View File

@ -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 ]

View 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>));