mirror of
https://github.com/boostorg/utility.git
synced 2025-10-08 23:00:55 +02:00
Compare commits
11 Commits
feature/fi
...
boost-1.77
Author | SHA1 | Date | |
---|---|---|---|
|
375382e1e6 | ||
|
6cca23a63a | ||
|
9ad7e51912 | ||
|
601f80e8c1 | ||
|
c960bef6ef | ||
|
6ab27d5689 | ||
|
3e2f0199cf | ||
|
9c2aa8d193 | ||
|
601fc9371f | ||
|
7aafdf92a0 | ||
|
a7570d7608 |
@@ -3,12 +3,9 @@
|
|||||||
# Distributed under the Boost Software License, Version 1.0.
|
# 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
|
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
# Partial (add_subdirectory only) and experimental CMake support
|
cmake_minimum_required(VERSION 3.5...3.20)
|
||||||
# Subject to change; please do not rely on the contents of this file yet.
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
project(boost_utility VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||||
|
|
||||||
project(BoostUtility LANGUAGES CXX)
|
|
||||||
|
|
||||||
add_library(boost_utility INTERFACE)
|
add_library(boost_utility INTERFACE)
|
||||||
add_library(Boost::utility ALIAS boost_utility)
|
add_library(Boost::utility ALIAS boost_utility)
|
||||||
@@ -18,7 +15,6 @@ target_include_directories(boost_utility INTERFACE include)
|
|||||||
target_link_libraries(boost_utility
|
target_link_libraries(boost_utility
|
||||||
INTERFACE
|
INTERFACE
|
||||||
Boost::config
|
Boost::config
|
||||||
Boost::container_hash
|
|
||||||
Boost::core
|
Boost::core
|
||||||
Boost::io
|
Boost::io
|
||||||
Boost::preprocessor
|
Boost::preprocessor
|
||||||
|
@@ -112,6 +112,8 @@
|
|||||||
// Define BOOST_OPERATORS_CONSTEXPR to be like BOOST_CONSTEXPR but empty under MSVC < v19.22
|
// Define BOOST_OPERATORS_CONSTEXPR to be like BOOST_CONSTEXPR but empty under MSVC < v19.22
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1922)
|
#if BOOST_WORKAROUND(BOOST_MSVC, < 1922)
|
||||||
#define BOOST_OPERATORS_CONSTEXPR
|
#define BOOST_OPERATORS_CONSTEXPR
|
||||||
|
#elif defined __sun
|
||||||
|
#define BOOST_OPERATORS_CONSTEXPR
|
||||||
#else
|
#else
|
||||||
#define BOOST_OPERATORS_CONSTEXPR BOOST_CONSTEXPR
|
#define BOOST_OPERATORS_CONSTEXPR BOOST_CONSTEXPR
|
||||||
#endif
|
#endif
|
||||||
|
190
include/boost/utility/detail/result_of_variadic.hpp
Normal file
190
include/boost/utility/detail/result_of_variadic.hpp
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
// Boost result_of library
|
||||||
|
|
||||||
|
// Copyright Douglas Gregor 2004. Use, modification and
|
||||||
|
// distribution is 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)
|
||||||
|
|
||||||
|
// Copyright Daniel Walker, Eric Niebler, Michel Morin 2008-2012.
|
||||||
|
// Use, modification and distribution is 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)
|
||||||
|
|
||||||
|
// For more information, see http://www.boost.org/libs/utility
|
||||||
|
|
||||||
|
#ifndef BOOST_RESULT_OF_HPP
|
||||||
|
# error Boost result_of - do not include this file!
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct tr1_result_of<F(Args...)>
|
||||||
|
: conditional<
|
||||||
|
is_pointer<F>::value || is_member_function_pointer<F>::value
|
||||||
|
, boost::detail::tr1_result_of_impl<
|
||||||
|
typename remove_cv<F>::type,
|
||||||
|
typename remove_cv<F>::type(Args...),
|
||||||
|
(boost::detail::result_of_has_result_type<F>::value)>
|
||||||
|
, boost::detail::tr1_result_of_impl<
|
||||||
|
F,
|
||||||
|
F(Args...),
|
||||||
|
(boost::detail::result_of_has_result_type<F>::value)> >::type { };
|
||||||
|
|
||||||
|
#ifdef BOOST_RESULT_OF_USE_DECLTYPE
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct result_of<F(Args...)>
|
||||||
|
: detail::cpp0x_result_of<F(Args...)> { };
|
||||||
|
#endif // BOOST_RESULT_OF_USE_DECLTYPE
|
||||||
|
|
||||||
|
#ifdef BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct result_of<F(Args...)>
|
||||||
|
: conditional<detail::result_of_has_result_type<F>::value || detail::result_of_has_result<F>::value,
|
||||||
|
tr1_result_of<F(Args...)>,
|
||||||
|
detail::cpp0x_result_of<F(Args...)> >::type { };
|
||||||
|
#endif // BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK
|
||||||
|
|
||||||
|
#if defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK)
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct cpp0x_result_of<F(Args...)>
|
||||||
|
: conditional<
|
||||||
|
is_member_function_pointer<F>::value
|
||||||
|
, detail::tr1_result_of_impl<
|
||||||
|
typename remove_cv<F>::type,
|
||||||
|
typename remove_cv<F>::type(Args...), false
|
||||||
|
>
|
||||||
|
, detail::cpp0x_result_of_impl<
|
||||||
|
F(Args...)
|
||||||
|
>
|
||||||
|
>::type
|
||||||
|
{};
|
||||||
|
|
||||||
|
#ifdef BOOST_NO_SFINAE_EXPR
|
||||||
|
|
||||||
|
template<typename F>
|
||||||
|
struct result_of_callable_fun_2;
|
||||||
|
|
||||||
|
template<typename R, typename... Args>
|
||||||
|
struct result_of_callable_fun_2<R(Args...)> {
|
||||||
|
R operator()(Args...) const;
|
||||||
|
typedef result_of_private_type const &(*pfn_t)(...);
|
||||||
|
operator pfn_t() const volatile;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename F>
|
||||||
|
struct result_of_callable_fun
|
||||||
|
: result_of_callable_fun_2<F>
|
||||||
|
{};
|
||||||
|
|
||||||
|
template<typename F>
|
||||||
|
struct result_of_callable_fun<F *>
|
||||||
|
: result_of_callable_fun_2<F>
|
||||||
|
{};
|
||||||
|
|
||||||
|
template<typename F>
|
||||||
|
struct result_of_select_call_wrapper_type
|
||||||
|
: conditional<
|
||||||
|
is_class<typename remove_reference<F>::type>::value,
|
||||||
|
result_of_wrap_callable_class<F>,
|
||||||
|
type_identity<result_of_callable_fun<typename remove_cv<typename remove_reference<F>::type>::type> >
|
||||||
|
>::type
|
||||||
|
{};
|
||||||
|
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct result_of_is_callable {
|
||||||
|
typedef typename result_of_select_call_wrapper_type<F>::type wrapper_t;
|
||||||
|
static const bool value = (
|
||||||
|
sizeof(result_of_no_type) == sizeof(detail::result_of_is_private_type(
|
||||||
|
(boost::declval<wrapper_t>()(boost::declval<Args>()...), result_of_weird_type())
|
||||||
|
))
|
||||||
|
);
|
||||||
|
typedef integral_constant<bool, value> type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct cpp0x_result_of_impl<F(Args...), true>
|
||||||
|
: lazy_enable_if<
|
||||||
|
result_of_is_callable<F, Args...>
|
||||||
|
, cpp0x_result_of_impl<F(Args...), false>
|
||||||
|
>
|
||||||
|
{};
|
||||||
|
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct cpp0x_result_of_impl<F(Args...), false>
|
||||||
|
{
|
||||||
|
typedef decltype(
|
||||||
|
boost::declval<F>()(
|
||||||
|
boost::declval<Args>()...
|
||||||
|
)
|
||||||
|
) type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#else // BOOST_NO_SFINAE_EXPR
|
||||||
|
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct cpp0x_result_of_impl<F(Args...),
|
||||||
|
typename result_of_always_void<decltype(
|
||||||
|
boost::declval<F>()(
|
||||||
|
boost::declval<Args>()...
|
||||||
|
)
|
||||||
|
)>::type> {
|
||||||
|
typedef decltype(
|
||||||
|
boost::declval<F>()(
|
||||||
|
boost::declval<Args>()...
|
||||||
|
)
|
||||||
|
) type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BOOST_NO_SFINAE_EXPR
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
#else // defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK)
|
||||||
|
|
||||||
|
template<typename F, typename... Args>
|
||||||
|
struct result_of<F(Args...)>
|
||||||
|
: tr1_result_of<F(Args...)> { };
|
||||||
|
|
||||||
|
#endif // defined(BOOST_RESULT_OF_USE_DECLTYPE)
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
|
||||||
|
template<typename R, typename FArgs, typename... Args>
|
||||||
|
struct tr1_result_of_impl<R (*)(Args...), FArgs, false>
|
||||||
|
{
|
||||||
|
typedef R type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename R, typename FArgs, typename... Args>
|
||||||
|
struct tr1_result_of_impl<R (&)(Args...), FArgs, false>
|
||||||
|
{
|
||||||
|
typedef R type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename R, typename FArgs, typename C, typename... Args>
|
||||||
|
struct tr1_result_of_impl<R (C::*)(Args...), FArgs, false>
|
||||||
|
{
|
||||||
|
typedef R type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename R, typename FArgs, typename C, typename... Args>
|
||||||
|
struct tr1_result_of_impl<R (C::*)(Args...) const, FArgs, false>
|
||||||
|
{
|
||||||
|
typedef R type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename R, typename FArgs, typename C, typename... Args>
|
||||||
|
struct tr1_result_of_impl<R (C::*)(Args...) volatile, FArgs, false>
|
||||||
|
{
|
||||||
|
typedef R type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename R, typename FArgs, typename C, typename... Args>
|
||||||
|
struct tr1_result_of_impl<R (C::*)(Args...) const volatile, FArgs, false>
|
||||||
|
{
|
||||||
|
typedef R type;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@@ -10,13 +10,6 @@
|
|||||||
#define BOOST_RESULT_OF_HPP
|
#define BOOST_RESULT_OF_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/preprocessor/cat.hpp>
|
|
||||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
|
||||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
|
||||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
|
||||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
|
||||||
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
|
|
||||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
#include <boost/type_traits/is_class.hpp>
|
#include <boost/type_traits/is_class.hpp>
|
||||||
#include <boost/type_traits/is_pointer.hpp>
|
#include <boost/type_traits/is_pointer.hpp>
|
||||||
@@ -29,6 +22,20 @@
|
|||||||
#include <boost/type_traits/integral_constant.hpp>
|
#include <boost/type_traits/integral_constant.hpp>
|
||||||
#include <boost/core/enable_if.hpp>
|
#include <boost/core/enable_if.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||||
|
# undef BOOST_RESULT_OF_NO_VARIADIC_TEMPLATES
|
||||||
|
# define BOOST_RESULT_OF_NO_VARIADIC_TEMPLATES
|
||||||
|
#endif
|
||||||
|
#ifdef BOOST_RESULT_OF_NO_VARIADIC_TEMPLATES
|
||||||
|
# include <boost/preprocessor/cat.hpp>
|
||||||
|
# include <boost/preprocessor/iteration/iterate.hpp>
|
||||||
|
# include <boost/preprocessor/repetition/enum_params.hpp>
|
||||||
|
# include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||||
|
# include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||||
|
# include <boost/preprocessor/repetition/enum_shifted_params.hpp>
|
||||||
|
# include <boost/preprocessor/facilities/intercept.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef BOOST_RESULT_OF_NUM_ARGS
|
#ifndef BOOST_RESULT_OF_NUM_ARGS
|
||||||
# define BOOST_RESULT_OF_NUM_ARGS 16
|
# define BOOST_RESULT_OF_NUM_ARGS 16
|
||||||
#endif
|
#endif
|
||||||
@@ -217,8 +224,12 @@ struct tr1_result_of_impl<F, FArgs, false>
|
|||||||
|
|
||||||
} // end namespace detail
|
} // end namespace detail
|
||||||
|
|
||||||
#define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_RESULT_OF_NUM_ARGS,<boost/utility/detail/result_of_iterate.hpp>))
|
#ifndef BOOST_RESULT_OF_NO_VARIADIC_TEMPLATES
|
||||||
#include BOOST_PP_ITERATE()
|
# include <boost/utility/detail/result_of_variadic.hpp>
|
||||||
|
#else
|
||||||
|
# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_RESULT_OF_NUM_ARGS,<boost/utility/detail/result_of_iterate.hpp>))
|
||||||
|
# include BOOST_PP_ITERATE()
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// inform dependency trackers, as they can't see through macro includes
|
// inform dependency trackers, as they can't see through macro includes
|
||||||
|
@@ -23,7 +23,6 @@
|
|||||||
#include <boost/io/ostream_put.hpp>
|
#include <boost/io/ostream_put.hpp>
|
||||||
#include <boost/utility/string_view_fwd.hpp>
|
#include <boost/utility/string_view_fwd.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/container_hash/hash_fwd.hpp>
|
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@@ -652,6 +651,9 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Forward declaration of Boost.ContainerHash function
|
||||||
|
template <class It> std::size_t hash_range(It, It);
|
||||||
|
|
||||||
template <class charT, class traits>
|
template <class charT, class traits>
|
||||||
std::size_t hash_value(basic_string_view<charT, traits> s) {
|
std::size_t hash_value(basic_string_view<charT, traits> s) {
|
||||||
return boost::hash_range(s.begin(), s.end());
|
return boost::hash_range(s.begin(), s.end());
|
||||||
|
@@ -13,7 +13,8 @@
|
|||||||
"Memory",
|
"Memory",
|
||||||
"Miscellaneous",
|
"Miscellaneous",
|
||||||
"Patterns"
|
"Patterns"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "utility/call_traits",
|
"key": "utility/call_traits",
|
||||||
@@ -25,7 +26,8 @@
|
|||||||
"documentation": "call_traits.htm",
|
"documentation": "call_traits.htm",
|
||||||
"category": [
|
"category": [
|
||||||
"Generic"
|
"Generic"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "utility/compressed_pair",
|
"key": "utility/compressed_pair",
|
||||||
@@ -38,7 +40,8 @@
|
|||||||
"category": [
|
"category": [
|
||||||
"Data",
|
"Data",
|
||||||
"Patterns"
|
"Patterns"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "utility/identity_type",
|
"key": "utility/identity_type",
|
||||||
@@ -53,7 +56,8 @@
|
|||||||
],
|
],
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"Lorenzo Caminiti <lorcaminiti -at- gmail.com>"
|
"Lorenzo Caminiti <lorcaminiti -at- gmail.com>"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "utility/in_place_factories",
|
"key": "utility/in_place_factories",
|
||||||
@@ -65,7 +69,8 @@
|
|||||||
"documentation": "in_place_factories.html",
|
"documentation": "in_place_factories.html",
|
||||||
"category": [
|
"category": [
|
||||||
"Generic"
|
"Generic"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "utility/operators",
|
"key": "utility/operators",
|
||||||
@@ -83,7 +88,8 @@
|
|||||||
],
|
],
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"Daniel Frey <d.frey -at- gmx.de>"
|
"Daniel Frey <d.frey -at- gmx.de>"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "utility/result_of",
|
"key": "utility/result_of",
|
||||||
@@ -96,7 +102,8 @@
|
|||||||
"authors": "",
|
"authors": "",
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"Daniel Walker <daniel.j.walker -at- gmail.com>"
|
"Daniel Walker <daniel.j.walker -at- gmail.com>"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "utility/string_ref",
|
"key": "utility/string_ref",
|
||||||
@@ -109,7 +116,8 @@
|
|||||||
"authors": "Marshall Clow",
|
"authors": "Marshall Clow",
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"Marshall Clow <marshall -at- idio.com>"
|
"Marshall Clow <marshall -at- idio.com>"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "utility/value_initialized",
|
"key": "utility/value_initialized",
|
||||||
@@ -121,6 +129,7 @@
|
|||||||
"documentation": "value_init.htm",
|
"documentation": "value_init.htm",
|
||||||
"category": [
|
"category": [
|
||||||
"Miscellaneous"
|
"Miscellaneous"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user