Chris@16: Chris@16: // Copyright (C) 2009-2012 Lorenzo Caminiti Chris@16: // Distributed under the Boost Software License, Version 1.0 Chris@16: // (see accompanying file LICENSE_1_0.txt or a copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Home at http://www.boost.org/libs/local_function Chris@16: Chris@16: #ifndef BOOST_LOCAL_FUNCTION_AUX_MEMBER_HPP_ Chris@16: #define BOOST_LOCAL_FUNCTION_AUX_MEMBER_HPP_ Chris@16: Chris@16: namespace boost { namespace local_function { namespace aux { Chris@16: Chris@16: // Metafunctions to manipulate data members. Chris@16: Chris@16: template struct member_type { Chris@16: typedef T& reference; Chris@16: typedef T* pointer; Chris@16: }; Chris@16: Chris@16: template struct member_type { Chris@16: typedef T*& reference; Chris@16: typedef T* pointer; Chris@16: }; Chris@16: Chris@16: template struct member_type { Chris@16: typedef T* const& reference; Chris@16: typedef T* pointer; Chris@16: }; Chris@16: Chris@16: template struct member_type { Chris@16: typedef T const*& reference; Chris@16: typedef T const* pointer; Chris@16: }; Chris@16: Chris@16: template struct member_type { Chris@16: typedef T const* const& reference; Chris@16: typedef T const* pointer; Chris@16: }; Chris@16: Chris@16: // NOTE: Do not add specializations for T const[&/*] (ambiguous on VACPP). Chris@16: template T* member_addr(T& data) { return &data; } Chris@16: template T* member_addr(T* data) { return data; } Chris@16: Chris@16: // NOTE: Do not add specializations for T const[&/*] (ambiguous on VACPP). Chris@16: template T& member_deref(T& data) { return data; } Chris@16: template T& member_deref(T* data) { return *data; } Chris@16: Chris@16: } } } // namespace Chris@16: Chris@16: #endif // #include guard Chris@16: