forked from boostorg/tuple
Tuple: Remove obsolete MSVC version check.
[SVN r86038]
This commit is contained in:
@ -103,14 +103,8 @@ namespace tuples {
|
|||||||
template <class MyTail>
|
template <class MyTail>
|
||||||
struct init_tail
|
struct init_tail
|
||||||
{
|
{
|
||||||
// Each of vc6 and vc7 seem to require a different formulation
|
|
||||||
// of this return type
|
|
||||||
template <class H, class T>
|
template <class H, class T>
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
|
||||||
static typename add_reference<typename add_const<T>::type>::type
|
|
||||||
#else
|
|
||||||
static typename add_const_reference<T>::type
|
static typename add_const_reference<T>::type
|
||||||
#endif
|
|
||||||
execute( cons<H,T> const& u, long )
|
execute( cons<H,T> const& u, long )
|
||||||
{
|
{
|
||||||
return u.get_tail();
|
return u.get_tail();
|
||||||
@ -313,59 +307,6 @@ namespace tuples {
|
|||||||
};
|
};
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
#if defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
|
|
||||||
// special workaround for vc7:
|
|
||||||
|
|
||||||
template <bool x>
|
|
||||||
struct reference_adder
|
|
||||||
{
|
|
||||||
template <class T>
|
|
||||||
struct rebind
|
|
||||||
{
|
|
||||||
typedef T& type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct reference_adder<true>
|
|
||||||
{
|
|
||||||
template <class T>
|
|
||||||
struct rebind
|
|
||||||
{
|
|
||||||
typedef T type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Return a reference to the Nth type of the given Tuple
|
|
||||||
template<int N, typename Tuple>
|
|
||||||
struct element_ref
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
typedef typename element<N, Tuple>::RET elt_type;
|
|
||||||
enum { is_ref = is_reference<elt_type>::value };
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef reference_adder<is_ref>::rebind<elt_type>::type RET;
|
|
||||||
typedef RET type;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Return a const reference to the Nth type of the given Tuple
|
|
||||||
template<int N, typename Tuple>
|
|
||||||
struct element_const_ref
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
typedef typename element<N, Tuple>::RET elt_type;
|
|
||||||
enum { is_ref = is_reference<elt_type>::value };
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef reference_adder<is_ref>::rebind<const elt_type>::type RET;
|
|
||||||
typedef RET type;
|
|
||||||
};
|
|
||||||
|
|
||||||
#else // vc7
|
|
||||||
|
|
||||||
// Return a reference to the Nth type of the given Tuple
|
// Return a reference to the Nth type of the given Tuple
|
||||||
template<int N, typename Tuple>
|
template<int N, typename Tuple>
|
||||||
struct element_ref
|
struct element_ref
|
||||||
@ -389,8 +330,6 @@ namespace tuples {
|
|||||||
typedef typename add_reference<const elt_type>::type RET;
|
typedef typename add_reference<const elt_type>::type RET;
|
||||||
typedef RET type;
|
typedef RET type;
|
||||||
};
|
};
|
||||||
#endif // vc7
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
// Get length of this tuple
|
// Get length of this tuple
|
||||||
|
Reference in New Issue
Block a user