SFINAE out the converting constructor of arg<I> to avoid hard errors with is_convertible on g++ 4.8/4.9

This commit is contained in:
Peter Dimov
2016-08-20 01:32:42 +03:00
parent 2821b51a50
commit 3c56630b54
5 changed files with 112 additions and 3 deletions
+10 -3
View File
@@ -21,20 +21,27 @@
#include <boost/config.hpp>
#include <boost/is_placeholder.hpp>
#include <boost/static_assert.hpp>
namespace boost
{
template< int I, int J > struct _arg_eq
{
};
template< int I > struct _arg_eq< I, I>
{
typedef void type;
};
template< int I > struct arg
{
BOOST_CONSTEXPR arg()
{
}
template< class T > BOOST_CONSTEXPR arg( T const & /* t */ )
template< class T > BOOST_CONSTEXPR arg( T const & /* t */, typename _arg_eq< I, is_placeholder<T>::value >::type * = 0 )
{
BOOST_STATIC_ASSERT( I == is_placeholder<T>::value );
}
};