forked from boostorg/system
Constrain explicit value and error constructors to not accept zero arguments. Fixes #86.
This commit is contained in:
@ -135,7 +135,8 @@ public:
|
|||||||
template<class... A, class En = typename std::enable_if<
|
template<class... A, class En = typename std::enable_if<
|
||||||
std::is_constructible<T, A...>::value &&
|
std::is_constructible<T, A...>::value &&
|
||||||
!(detail::is_errc_t<A...>::value && std::is_arithmetic<T>::value) &&
|
!(detail::is_errc_t<A...>::value && std::is_arithmetic<T>::value) &&
|
||||||
!std::is_constructible<E, A...>::value
|
!std::is_constructible<E, A...>::value &&
|
||||||
|
sizeof...(A) >= 1
|
||||||
>::type>
|
>::type>
|
||||||
explicit constexpr result( A&&... a )
|
explicit constexpr result( A&&... a )
|
||||||
noexcept( std::is_nothrow_constructible<T, A...>::value )
|
noexcept( std::is_nothrow_constructible<T, A...>::value )
|
||||||
@ -146,7 +147,8 @@ public:
|
|||||||
// explicit, error
|
// explicit, error
|
||||||
template<class... A, class En2 = void, class En = typename std::enable_if<
|
template<class... A, class En2 = void, class En = typename std::enable_if<
|
||||||
!std::is_constructible<T, A...>::value &&
|
!std::is_constructible<T, A...>::value &&
|
||||||
std::is_constructible<E, A...>::value
|
std::is_constructible<E, A...>::value &&
|
||||||
|
sizeof...(A) >= 1
|
||||||
>::type>
|
>::type>
|
||||||
explicit constexpr result( A&&... a )
|
explicit constexpr result( A&&... a )
|
||||||
noexcept( std::is_nothrow_constructible<E, A...>::value )
|
noexcept( std::is_nothrow_constructible<E, A...>::value )
|
||||||
|
Reference in New Issue
Block a user