forked from boostorg/fusion
Compare commits
8 Commits
boost-1.81
...
boost-1.86
Author | SHA1 | Date | |
---|---|---|---|
53da4e0b2c | |||
7d4c03fa03 | |||
5d19cc2d57 | |||
049303436c | |||
8c32ebea0b | |||
3044c2beaf | |||
d6298309fb | |||
0a2da9d0ac |
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
|
||||
|
@ -24,4 +24,6 @@ target_link_libraries(boost_fusion
|
||||
Boost::typeof
|
||||
Boost::utility
|
||||
Boost::functional
|
||||
Boost::describe
|
||||
Boost::mp11
|
||||
)
|
||||
|
@ -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>
|
||||
|
@ -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