diff --git a/recursive_wrapper.hpp b/recursive_wrapper.hpp index 7af51a5..99c3ebf 100644 --- a/recursive_wrapper.hpp +++ b/recursive_wrapper.hpp @@ -1,9 +1,9 @@ -#ifndef UTIL_VARIANT_RECURSIVE_WRAPPER_HPP -#define UTIL_VARIANT_RECURSIVE_WRAPPER_HPP +#ifndef MAPBOX_UTIL_VARIANT_RECURSIVE_WRAPPER_HPP +#define MAPBOX_UTIL_VARIANT_RECURSIVE_WRAPPER_HPP #include -namespace util { +namespace mapbox { namespace util { template class recursive_wrapper @@ -123,6 +123,6 @@ inline void swap(recursive_wrapper& lhs, recursive_wrapper& rhs) noexcept lhs.swap(rhs); } -} +}} -#endif // UTIL_VARIANT_RECURSIVE_WRAPPER_HPP +#endif // MAPBOX_UTIL_VARIANT_RECURSIVE_WRAPPER_HPP diff --git a/test/bench_variant.cpp b/test/bench_variant.cpp index e4be3f5..533994d 100644 --- a/test/bench_variant.cpp +++ b/test/bench_variant.cpp @@ -9,6 +9,9 @@ #define TEXT "Testing various variant implementations with a longish string ........................................." //#define BOOST_VARIANT_MINIMIZE_SIZE + +using namespace mapbox; + namespace test { template diff --git a/test/binary_visitor_test.cpp b/test/binary_visitor_test.cpp index 8c0fa89..b3de952 100644 --- a/test/binary_visitor_test.cpp +++ b/test/binary_visitor_test.cpp @@ -10,6 +10,8 @@ #include #include "variant.hpp" +using namespace mapbox; + namespace test { template diff --git a/test/recursive_wrapper_test.cpp b/test/recursive_wrapper_test.cpp index 36616c2..a84e6f3 100644 --- a/test/recursive_wrapper_test.cpp +++ b/test/recursive_wrapper_test.cpp @@ -9,6 +9,8 @@ #include #include "variant.hpp" +using namespace mapbox; + namespace test { struct add; diff --git a/test/unique_ptr_test.cpp b/test/unique_ptr_test.cpp index d760eeb..33edd01 100644 --- a/test/unique_ptr_test.cpp +++ b/test/unique_ptr_test.cpp @@ -9,6 +9,8 @@ #include #include "variant.hpp" +using namespace mapbox; + namespace test { struct add; diff --git a/test/unit.cpp b/test/unit.cpp index 4f3c3b6..b981a8a 100644 --- a/test/unit.cpp +++ b/test/unit.cpp @@ -8,6 +8,8 @@ #include #include +using namespace mapbox; + TEST_CASE( "variant version", "[variant]" ) { unsigned int version = VARIANT_VERSION; REQUIRE(version == 100); @@ -50,7 +52,7 @@ TEST_CASE( "variant should support built-in types", "[variant]" ) { // FIXME: does not compile: ./variant.hpp:340:14: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::__1::basic_ostream' and 'const nullptr_t') // https://github.com/mapbox/variant/issues/14 //REQUIRE(v == util::variant(nullptr)); - } + } SECTION( "unique_ptr" ) { typedef std::unique_ptr value_type; util::variant v(value_type(new std::string("hello"))); diff --git a/test/variant_hello_world.cpp b/test/variant_hello_world.cpp index 6246772..7b52954 100644 --- a/test/variant_hello_world.cpp +++ b/test/variant_hello_world.cpp @@ -2,6 +2,8 @@ #include #include +using mapbox; + struct check : util::static_visitor<> { template diff --git a/variant.hpp b/variant.hpp index bfb4546..39e7d7b 100644 --- a/variant.hpp +++ b/variant.hpp @@ -1,5 +1,5 @@ -#ifndef UTIL_VARIANT_HPP -#define UTIL_VARIANT_HPP +#ifndef MAPBOX_UTIL_VARIANT_HPP +#define MAPBOX_UTIL_VARIANT_HPP #include #include @@ -34,9 +34,7 @@ // translates to 100 #define VARIANT_VERSION (VARIANT_MAJOR_VERSION*100000) + (VARIANT_MINOR_VERSION*100) + (VARIANT_PATCH_VERSION) -namespace util { - -namespace detail { +namespace mapbox { namespace util { namespace detail { static constexpr std::size_t invalid_value = std::size_t(-1); @@ -545,6 +543,6 @@ operator<< (std::basic_ostream& out, Variant const& rhs) return out; } -} +}} -#endif // UTIL_VARIANT_HPP +#endif // MAPBOX_UTIL_VARIANT_HPP