From 966c338bf09e95b7449c9ac5932f5360eb9104ae Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Sat, 18 Feb 2006 12:56:43 +0000 Subject: [PATCH] LVALUE_TYPEOF dropped [SVN r32989] --- include/boost/typeof/lvalue_typeof.hpp | 111 ------------------------- test/Jamfile | 3 - test/lvalue.cpp | 26 ------ 3 files changed, 140 deletions(-) delete mode 100755 include/boost/typeof/lvalue_typeof.hpp delete mode 100755 test/lvalue.cpp diff --git a/include/boost/typeof/lvalue_typeof.hpp b/include/boost/typeof/lvalue_typeof.hpp deleted file mode 100755 index fa3ec4e..0000000 --- a/include/boost/typeof/lvalue_typeof.hpp +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (C) 2004 Arkadiy Vertleyb -// Copyright (C) 2004 Peder Holt -// Use, modification and distribution is subject to the Boost Software -// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED -#define BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED - -#include - -namespace boost -{ - namespace type_of - { - enum - { - RVALUE = 1, - LVALUE, - CONST_LVALUE - }; - - char(*classify_expression(...))[ - RVALUE - ]; - - template - char(*classify_expression(T&))[ - is_const::value ? CONST_LVALUE : LVALUE - ]; -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - template struct decorate_type - { - typedef T type; - }; - template struct decorate_type - { - typedef T& type; - }; - template struct decorate_type - { - typedef const T& type; - }; -#else - template - struct decorate_type_impl { - template - struct inner { - typedef T type; - }; - }; - template<> - struct decorate_type_impl { - template - struct inner { - typedef T& type; - }; - }; - - template<> - struct decorate_type_impl { - template - struct inner { - typedef T const& type; - }; - }; - - template struct decorate_type - { - typedef decorate_type_impl::inner::type type; - }; -#endif - } -} - - -// Since this is always a type, -// just add "typename" when using in templates - -#ifndef BOOST_TYPEOF_COMPLIANT - -#define BOOST_LVALUE_TYPEOF(expr) \ - boost::type_of::decorate_type< \ - BOOST_TYPEOF(expr), \ - sizeof(*boost::type_of::classify_expression(expr)) \ - >::type - -#else //BOOST_TYPEOF_COMPLIANT - -#include - -namespace boost { namespace type_of { - - template - struct decorate_decode_begin - { - typedef typename decorate_type< - typename decode_begin::type, - n - >::type type; - }; -}} - -#define BOOST_LVALUE_TYPEOF(expr) \ - boost::type_of::decorate_decode_begin< \ - BOOST_TYPEOF_ENCODED_VECTOR(expr), \ - sizeof(*boost::type_of::classify_expression(expr)) \ - >::type - -#endif - -#endif//BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED diff --git a/test/Jamfile b/test/Jamfile index a52b559..acd2783 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -62,9 +62,6 @@ test-suite "typeof" [ compile data_member.cpp : BOOST_TYPEOF_NATIVE special-requirements : data_member_native ] [ compile data_member.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : data_member_emulation ] - [ compile lvalue.cpp : BOOST_TYPEOF_NATIVE special-requirements : lvalue_native ] - [ compile lvalue.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : lvalue_emulation ] - [ compile noncopyable.cpp : BOOST_TYPEOF_NATIVE special-requirements : noncopyable_native ] [ compile noncopyable.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : noncopyable_emulation ] diff --git a/test/lvalue.cpp b/test/lvalue.cpp deleted file mode 100755 index eed202a..0000000 --- a/test/lvalue.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include - -#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() - -struct x{}; -BOOST_TYPEOF_REGISTER_TYPE(x) - -x n; -const x cn = n; -x& rn = n; -const x& rcn = cn; -x f(); -const x cf(); -x& rf(); -const x& rcf(); - -BOOST_STATIC_ASSERT((boost::is_same::value)); -BOOST_STATIC_ASSERT((boost::is_same::value)); -BOOST_STATIC_ASSERT((boost::is_same::value)); -BOOST_STATIC_ASSERT((boost::is_same::value)); -BOOST_STATIC_ASSERT((boost::is_same::value)); -BOOST_STATIC_ASSERT((boost::is_same::value)); -BOOST_STATIC_ASSERT((boost::is_same::value)); -BOOST_STATIC_ASSERT((boost::is_same::value));