forked from boostorg/fusion
Compare commits
32 Commits
esp-idf-co
...
master
Author | SHA1 | Date | |
---|---|---|---|
53da4e0b2c | |||
7d4c03fa03 | |||
5d19cc2d57 | |||
049303436c | |||
8c32ebea0b | |||
3044c2beaf | |||
d6298309fb | |||
0a2da9d0ac | |||
036b90cd5d | |||
cd2d748648 | |||
05c2c97ea0 | |||
a884709253 | |||
8d8db27953 | |||
72c5c094b9 | |||
b13fc27cf2 | |||
efe3d59c73 | |||
622e048cf2 | |||
2a9a44ee7c | |||
aca00012d1 | |||
c4e7f2bb1a | |||
3a98d9dbeb | |||
116768f3b2 | |||
df37668501 | |||
2a70da0170 | |||
60408efa18 | |||
d49b59bdf9 | |||
e15016adb6 | |||
24138813d6 | |||
0c6c0b17e5 | |||
95b6ebdc61 | |||
dd3bf8aa3e | |||
3f6f947233 |
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -344,6 +344,8 @@ jobs:
|
||||
git submodule init libs/type_traits
|
||||
git submodule init libs/typeof
|
||||
git submodule init libs/utility
|
||||
git submodule init libs/describe
|
||||
git submodule init libs/mp11
|
||||
git submodule init libs/headers tools/boost_install tools/build
|
||||
git submodule update
|
||||
rm -rf libs/fusion
|
||||
@ -452,6 +454,8 @@ jobs:
|
||||
git submodule init libs/type_traits
|
||||
git submodule init libs/typeof
|
||||
git submodule init libs/utility
|
||||
git submodule init libs/describe
|
||||
git submodule init libs/mp11
|
||||
git submodule init libs/headers tools/boost_install tools/build
|
||||
git submodule update
|
||||
rm -rf libs/fusion
|
||||
@ -464,4 +468,4 @@ jobs:
|
||||
|
||||
./b2 -j`(nproc || sysctl -n hw.ncpu) 2> /dev/null` libs/fusion/test toolset=$TOOLSET cxxstd=$CXXSTD
|
||||
|
||||
fi
|
||||
fi
|
||||
|
@ -2,8 +2,6 @@
|
||||
# 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
|
||||
|
||||
if(NOT DEFINED IDF_TARGET)
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.20)
|
||||
project(boost_fusion VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
@ -26,30 +24,6 @@ target_link_libraries(boost_fusion
|
||||
Boost::typeof
|
||||
Boost::utility
|
||||
Boost::functional
|
||||
Boost::describe
|
||||
Boost::mp11
|
||||
)
|
||||
|
||||
else()
|
||||
|
||||
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
|
||||
|
||||
idf_component_register(
|
||||
SRCS
|
||||
${headers}
|
||||
INCLUDE_DIRS
|
||||
include
|
||||
REQUIRES
|
||||
boost_config
|
||||
boost_container_hash
|
||||
boost_core
|
||||
boost_function_types
|
||||
boost_mpl
|
||||
boost_preprocessor
|
||||
boost_static_assert
|
||||
boost_tuple
|
||||
boost_type_traits
|
||||
boost_typeof
|
||||
boost_utility
|
||||
boost_functional
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -82,6 +82,8 @@ install:
|
||||
- git submodule init libs/type_traits
|
||||
- git submodule init libs/typeof
|
||||
- git submodule init libs/utility
|
||||
- git submodule init libs/describe
|
||||
- git submodule init libs/mp11
|
||||
|
||||
- git submodule init libs/headers tools/boost_install tools/build
|
||||
- git submodule update
|
||||
|
@ -143,7 +143,7 @@
|
||||
I, \
|
||||
ATTRIBUTE)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1935)
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM(R,_,ELEM) \
|
||||
typedef ELEM ELEM;
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL(SEQ) \
|
||||
|
@ -6,7 +6,7 @@
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_INCLUDE_ADAPT_ASSOC_ADT_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_ADR_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_ADT_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define FUSION_IN_05052005_0121
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <istream>
|
||||
#include <boost/fusion/sequence/io/detail/manip.hpp>
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
@ -36,10 +36,10 @@ namespace boost { namespace fusion
|
||||
namespace detail
|
||||
{
|
||||
template <typename Tag>
|
||||
int get_xalloc_index(Tag* = 0)
|
||||
int get_xalloc_index(int xalloc())
|
||||
{
|
||||
// each Tag will have a unique index
|
||||
static int index = std::ios::xalloc();
|
||||
static int const index = xalloc();
|
||||
return index;
|
||||
}
|
||||
|
||||
@ -66,12 +66,12 @@ namespace boost { namespace fusion
|
||||
{
|
||||
static arena ar; // our arena
|
||||
ar.data.push_back(new T(data));
|
||||
stream.pword(get_xalloc_index<Tag>()) = ar.data.back();
|
||||
stream.pword(get_xalloc_index<Tag>(stream.xalloc)) = ar.data.back();
|
||||
}
|
||||
|
||||
static T const* get(Stream& stream)
|
||||
{
|
||||
return (T const*)stream.pword(get_xalloc_index<Tag>());
|
||||
return (T const*)stream.pword(get_xalloc_index<Tag>(stream.xalloc));
|
||||
}
|
||||
};
|
||||
|
||||
@ -114,7 +114,6 @@ namespace boost { namespace fusion
|
||||
{
|
||||
// read a delimiter
|
||||
string_type const* p = stream_data_t::get(stream);
|
||||
std::ws(stream);
|
||||
|
||||
if (p)
|
||||
{
|
||||
@ -141,7 +140,7 @@ namespace boost { namespace fusion
|
||||
if (stream.get() != c)
|
||||
{
|
||||
stream.unget();
|
||||
stream.setstate(std::ios::failbit);
|
||||
stream.setstate(Stream::failbit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define FUSION_OUT_05052005_0121
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <ostream>
|
||||
#include <boost/fusion/sequence/io/detail/manip.hpp>
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
@ -10,9 +10,9 @@
|
||||
#define BOOST_IN_05042005_0120
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <istream>
|
||||
#include <boost/fusion/sequence/io/detail/in.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
|
@ -10,11 +10,11 @@
|
||||
#define BOOST_OUT_05042005_0120
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <ostream>
|
||||
#include <boost/fusion/sequence/io/detail/out.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
|
@ -120,6 +120,17 @@ namespace boost { namespace fusion
|
||||
return pair<First, typename detail::as_fusion_element<Second>::type>(val);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <typename First, typename Second>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::make_pair<First,Second>::type
|
||||
make_pair(Second&& val)
|
||||
{
|
||||
return pair<First, typename detail::as_fusion_element<Second>::type>(
|
||||
BOOST_FUSION_FWD_ELEM(Second, val));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename First, typename Second>
|
||||
inline std::ostream&
|
||||
operator<<(std::ostream& os, pair<First, Second> const& p)
|
||||
|
@ -48,11 +48,17 @@ namespace boost { namespace fusion
|
||||
{
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag)
|
||||
|
||||
template<typename Sequence, typename Active=void>
|
||||
struct tag_of_fallback
|
||||
{
|
||||
typedef non_fusion_tag type;
|
||||
};
|
||||
|
||||
template <typename Sequence, typename Active>
|
||||
struct tag_of_impl
|
||||
: mpl::if_<fusion::detail::is_mpl_sequence<Sequence>,
|
||||
mpl::identity<mpl_sequence_tag>,
|
||||
mpl::identity<non_fusion_tag> >::type
|
||||
mpl::identity<typename tag_of_fallback<Sequence>::type> >::type
|
||||
{};
|
||||
|
||||
template <typename Sequence>
|
||||
|
@ -9,6 +9,13 @@
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
|
@ -23,6 +23,11 @@
|
||||
#include <boost/fusion/view/transform_view/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/view/transform_view/detail/deref_data_impl.hpp>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4512) // assignment operator could not be generated.
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
// Unary Version
|
||||
@ -44,9 +49,6 @@ namespace boost { namespace fusion
|
||||
|
||||
first_type first;
|
||||
transform_type f;
|
||||
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
BOOST_DELETED_FUNCTION(transform_view_iterator& operator= (transform_view_iterator const&))
|
||||
};
|
||||
|
||||
// Binary Version
|
||||
@ -71,12 +73,13 @@ namespace boost { namespace fusion
|
||||
first1_type first1;
|
||||
first2_type first2;
|
||||
transform_type f;
|
||||
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
BOOST_DELETED_FUNCTION(transform_view_iterator2& operator= (transform_view_iterator2 const&))
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
|
@ -271,6 +271,11 @@ project
|
||||
: [ requires cxx11_variadic_templates ] ]
|
||||
[ compile support/tag_of.cpp ]
|
||||
[ compile support/unused.cpp ]
|
||||
[ compile support/detail/tag_of_fallback.cpp ]
|
||||
|
||||
[ compile-fail support/make_pair_r-value.cpp ]
|
||||
[ compile support/make_pair_r-value.cpp
|
||||
: [ requires cxx11_rvalue_references ] ]
|
||||
|
||||
# [ compile-fail xxx.cpp ]
|
||||
|
||||
|
50
test/support/detail/tag_of_fallback.cpp
Normal file
50
test/support/detail/tag_of_fallback.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2022 Denis Mikhailov
|
||||
|
||||
Distributed under 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/fusion/support/tag_of.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace mpl = boost::mpl;
|
||||
|
||||
template<typename T>
|
||||
struct my_is_implicitly_reflectable;
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct boost_my_reflectable_tag;
|
||||
namespace detail
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct tag_of_fallback<Sequence, typename boost::enable_if<boost::is_same<Sequence, Sequence> >::type>
|
||||
{
|
||||
typedef typename mpl::if_<my_is_implicitly_reflectable<Sequence>
|
||||
, boost_my_reflectable_tag
|
||||
, non_fusion_tag
|
||||
>::type type;
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
struct reflectable {};
|
||||
struct non_reflectable {};
|
||||
|
||||
template<typename T>
|
||||
struct my_is_implicitly_reflectable : mpl::false_ {};
|
||||
template<>
|
||||
struct my_is_implicitly_reflectable<reflectable> : mpl::true_ {};
|
||||
|
||||
typedef boost::fusion::traits::tag_of<reflectable>::type ReflectableTag;
|
||||
typedef boost::fusion::traits::tag_of<non_reflectable>::type NonReflectableTag;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<ReflectableTag, boost::fusion::boost_my_reflectable_tag>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<NonReflectableTag, boost::fusion::non_fusion_tag>::value));
|
||||
|
||||
int
|
||||
main() { }
|
||||
|
24
test/support/make_pair_r-value.cpp
Normal file
24
test/support/make_pair_r-value.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2022 niXman (github dot nixman at pm.me)
|
||||
Distributed under 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/fusion/support/pair.hpp>
|
||||
|
||||
struct noncopyable_type {
|
||||
noncopyable_type(const noncopyable_type &) = delete;
|
||||
noncopyable_type& operator=(const noncopyable_type &) = delete;
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
noncopyable_type(noncopyable_type &&) = default;
|
||||
noncopyable_type& operaotr=(noncopyable_type &&) = default;
|
||||
#endif
|
||||
};
|
||||
|
||||
int main() {
|
||||
using namespace boost::fusion;
|
||||
|
||||
pair<int, noncopyable_type> val = make_pair<int>(noncopyable_type{});
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user