diff --git a/gtsam/base/boost_variant_with_workaround.h b/gtsam/base/boost_variant_with_workaround.h deleted file mode 100644 index d9de4456a..000000000 --- a/gtsam/base/boost_variant_with_workaround.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ---------------------------------------------------------------------------- - - * GTSAM Copyright 2010, Georgia Tech Research Corporation, - * Atlanta, Georgia 30332-0415 - * All Rights Reserved - * Authors: Frank Dellaert, et al. (see THANKS for the full author list) - - * See LICENSE for the license information - - * -------------------------------------------------------------------------- */ - -/** - * @file boost_variant_with_workaround.h - * @brief Includes boost/variant.hpp with a workaround for a variant/boost graph conflict, by defining the variant 'get' function in a new variant_workaround namespace. - * @author Richard Roberts - */ - -#pragma once - -#include -#include - -namespace variant_workaround { - - /* ************************************************************************* */ - // The following functions are pasted from boost/variant/get.hpp, but in a - // 'variant_workaround' namespace to avoid a conflict with 'get' in the boost - // graph library that exists in boost < 1.47. -#if BOOST_VERSION >= 104700 - using boost::get; -#else - template - inline - typename boost::add_pointer::type - get( - boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand - BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) - ) - { - typedef typename boost::add_pointer::type U_ptr; - if (!operand) return static_cast(0); - - boost::detail::variant::get_visitor v; - return operand->apply_visitor(v); - } - - template - inline - typename boost::add_pointer::type - get( - const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand - BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) - ) - { - typedef typename boost::add_pointer::type U_ptr; - if (!operand) return static_cast(0); - - boost::detail::variant::get_visitor v; - return operand->apply_visitor(v); - } - - template - inline - typename boost::add_reference::type - get( - boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& operand - BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) - ) - { - typedef typename boost::add_pointer::type U_ptr; - U_ptr result = variant_workaround::get(&operand); - - if (!result) - throw boost::bad_get(); - return *result; - } - - template - inline - typename boost::add_reference::type - get( - const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& operand - BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) - ) - { - typedef typename boost::add_pointer::type U_ptr; - U_ptr result = variant_workaround::get(&operand); - - if (!result) - throw boost::bad_get(); - return *result; - } -#endif - -}