1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

add conversion to atd classes

This commit is contained in:
bolero-MURAKAMI 2016-02-21 16:49:14 +09:00
parent 5bf0907974
commit 60362f5419
3 changed files with 29 additions and 2 deletions

View file

@ -12,6 +12,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/index_tuple/metafunction.hpp>
#include <sprout/type_traits/is_nothrow_copy_constructible.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/utility/swap.hpp>
#include <sprout/utility/pair/pair_fwd.hpp>
@ -162,6 +163,12 @@ namespace sprout {
sprout::swap(first, other.first);
sprout::swap(second, other.second);
}
SPROUT_EXPLICIT_CONVERSION SPROUT_CONSTEXPR operator std::pair<T1, T2>() const
SPROUT_NOEXCEPT_IF(sprout::is_nothrow_copy_constructible<T1>::value && sprout::is_nothrow_copy_constructible<T2>::value)
{
return std::pair<T1, T2>(first, second);
}
};
//