From 9a14e20bc5eb04677d62537ca287a9136a77aa5f Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Sun, 11 Jun 2006 12:05:52 +0000 Subject: [PATCH] *** empty log message *** [SVN r34270] --- include/boost/typeof/binding_workaround.hpp | 42 --------------------- test/Jamfile | 3 ++ test/function_binding.cpp | 10 +++++ test/function_ref.cpp | 8 ---- 4 files changed, 13 insertions(+), 50 deletions(-) delete mode 100755 include/boost/typeof/binding_workaround.hpp create mode 100755 test/function_binding.cpp diff --git a/include/boost/typeof/binding_workaround.hpp b/include/boost/typeof/binding_workaround.hpp deleted file mode 100755 index 1b5fc1d..0000000 --- a/include/boost/typeof/binding_workaround.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef BOOST_TYPEOF_BINDING_WORKAROUND_HPP_INCLUDED -#define BOOST_TYPEOF_BINDING_WORKAROUND_HPP_INCLUDED - -// workarounds related to inability to bind to const T& - -/* -MSVC 7.1-, from inside a template, -can't bind a function pointer to const T& -*/ - -#include - -#if BOOST_WORKAROUND(BOOST_MSVC,==1310) && defined(BOOST_TYPEOF_EMULATION) - -#include -#include - -namespace boost { namespace type_of { - - template - sizer::type> encode(T*, - typename enable_if::type>::type* = 0); - -}} - -#elif BOOST_WORKAROUND(BOOST_MSVC,<=1310) && defined(BOOST_TYPEOF_NATIVE) - -#include -#include - -namespace boost { namespace type_of { - - template - char (*encode_start(T*))[encode_type::value]; - -}} - -#endif - -// - -#endif//BOOST_TYPEOF_BINDING_WORKAROUND_HPP_INCLUDED diff --git a/test/Jamfile b/test/Jamfile index f02d93c..8cac5c4 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -50,6 +50,9 @@ test-suite "typeof" [ compile function.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_native ] [ compile function.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_emulation ] + [ compile function_binding.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_binding_native ] + [ compile function_binding.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_binding_emulation ] + [ compile function_ptr.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_native ] [ compile function_ptr.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_ptr_emulation ] diff --git a/test/function_binding.cpp b/test/function_binding.cpp new file mode 100755 index 0000000..4bee3a9 --- /dev/null +++ b/test/function_binding.cpp @@ -0,0 +1,10 @@ +#include +#include +#include +#include + +int foo(double); +typedef int(&FREF)(double); +FREF fref = *foo; + +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/test/function_ref.cpp b/test/function_ref.cpp index 560ef53..bc9f6ec 100755 --- a/test/function_ref.cpp +++ b/test/function_ref.cpp @@ -2,11 +2,3 @@ BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); - -// check that function values/refs can be bound - -int foo(double); -typedef int(&FREF)(double); -FREF fref = *foo; - -BOOST_STATIC_ASSERT((boost::is_same::value));