mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-22 16:47:18 +02:00
More constexpr and noexcept support.
Note 1: Forwarding functions are specified as a C++14 constexpr since std::forward is not a constexpr within C++11. Note 2: Though I'm not sure why it doesn't compile, some declarations are specified as a C++14 constexpr or non-constexpr. Note 3: Boost.Tuple adaptation and TR1-based tuple implementations are not constexpr.
This commit is contained in:
@ -22,65 +22,67 @@ namespace boost { namespace fusion
|
||||
{
|
||||
struct unused_type
|
||||
{
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
unused_type()
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
unused_type() BOOST_NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
unused_type(T const&)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
unused_type(T const&) BOOST_NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
unused_type const&
|
||||
operator=(T const&) const
|
||||
operator=(T const&) const BOOST_NOEXCEPT
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
unused_type&
|
||||
operator=(T const&)
|
||||
operator=(T const&) BOOST_NOEXCEPT
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
unused_type const&
|
||||
operator=(unused_type const&) const
|
||||
operator=(unused_type const&) const BOOST_NOEXCEPT
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
unused_type&
|
||||
operator=(unused_type const&)
|
||||
operator=(unused_type const&) BOOST_NOEXCEPT
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
unused_type const unused = unused_type();
|
||||
BOOST_CONSTEXPR unused_type const unused = unused_type();
|
||||
|
||||
namespace detail
|
||||
{
|
||||
struct unused_only
|
||||
{
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
unused_only(unused_type const&) {}
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
unused_only(unused_type const&) BOOST_NOEXCEPT {}
|
||||
};
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&)
|
||||
BOOST_CONSTEXPR
|
||||
inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&) BOOST_NOEXCEPT
|
||||
{
|
||||
return out;
|
||||
}
|
||||
|
||||
inline std::istream& operator>>(std::istream& in, unused_type&)
|
||||
BOOST_CONSTEXPR
|
||||
inline std::istream& operator>>(std::istream& in, unused_type&) BOOST_NOEXCEPT
|
||||
{
|
||||
return in;
|
||||
}
|
||||
|
Reference in New Issue
Block a user