// Copyright 2016 Klemens Morgenstern
+// Copyright 2019-2020 Antony Polukhin
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// For more information, see http://www.boost.org
+#include <boost/config.hpp>
#include <boost/predef.h>
+#if (__cplusplus >= 201103L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
+// Make sure that it at least compiles
+# include <boost/dll/smart_library.hpp>
+#endif
+
#if (__cplusplus >= 201402L) || (BOOST_COMP_MSVC >= BOOST_VERSION_NUMBER(14,0,0))
#include "../example/b2_workarounds.hpp"
-#include <boost/dll/smart_library.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/filesystem.hpp>
#include <boost/variant.hpp>
auto& unscoped_var = sm.get_variable<int>("unscoped_var");
BOOST_TEST(unscoped_var == 42);
+ BOOST_TEST(unscoped_var == get<int>(sm, "unscoped_var"));
+ BOOST_TEST(&unscoped_var == &get<int>(sm, "unscoped_var"));
+
std::cerr << 2 << ' ';
auto& unscoped_c_var = sm.get_variable<const double>("unscoped_c_var");
BOOST_TEST(unscoped_c_var == 1.234);
-
std::cerr << 3 << ' ';
auto& sp_variable = sm.get_variable<double>("some_space::variable");
BOOST_TEST(sp_variable == 0.2);
BOOST_TEST(ovl1 != nullptr);
BOOST_TEST(ovl2 != nullptr);
BOOST_TEST(reinterpret_cast<void*>(ovl1) != reinterpret_cast<void*>(ovl2));
+ BOOST_TEST(ovl1 == get<void(int)>(sm, "overloaded"));
std::cerr << 8 << ' ';
ovl1(12);
BOOST_TEST(unscoped_var == 12);