Imported Upstream version 1.64.0
[platform/upstream/boost.git] / boost / hana / fwd / map.hpp
index 25ff7ad..bff0b01 100644 (file)
@@ -2,7 +2,7 @@
 @file
 Forward declares `boost::hana::map`.
 
-@copyright Louis Dionne 2013-2016
+@copyright Louis Dionne 2013-2017
 Distributed under the Boost Software License, Version 1.0.
 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  */
@@ -17,14 +17,17 @@ Distributed under the Boost Software License, Version 1.0.
 #include <boost/hana/fwd/insert.hpp>
 #include <boost/hana/fwd/keys.hpp>
 
-#include <utility>
-
 
 BOOST_HANA_NAMESPACE_BEGIN
     //! Tag representing `hana::map`s.
     //! @relates hana::map
     struct map_tag { };
 
+    namespace detail {
+        template <typename ...Pairs>
+        struct make_map_type;
+    }
+
     //! @ingroup group-datatypes
     //! Basic associative container requiring unique, `Comparable` and
     //! `Hashable` keys.
@@ -42,7 +45,7 @@ BOOST_HANA_NAMESPACE_BEGIN
     //! - the fact that `hana::map<Pairs...>` is, or is not, a dependent type
     //!
     //! In particular, the last point is very important; `hana::map<Pairs...>`
-    //! is only a shortcut for
+    //! is basically equivalent to
     //! @code
     //!     decltype(hana::make_pair(std::declval<Pairs>()...))
     //! @endcode
@@ -106,6 +109,14 @@ BOOST_HANA_NAMESPACE_BEGIN
         template <typename ...P>
         explicit constexpr map(P&& ...pairs);
 
+        //! Assign a map to another map __with the exact same type__. Only
+        //! exists when all the elements of the map are copy-assignable.
+        constexpr map& operator=(map const& other);
+
+        //! Move-assign a map to another map __with the exact same type__.
+        //! Only exists when all the elements of the map are move-assignable.
+        constexpr map& operator=(map&& other);
+
         //! Equivalent to `hana::equal`
         template <typename X, typename Y>
         friend constexpr auto operator==(X&& x, Y&& y);
@@ -120,7 +131,7 @@ BOOST_HANA_NAMESPACE_BEGIN
     };
 #else
     template <typename ...Pairs>
-    using map = decltype(hana::make<map_tag>(std::declval<Pairs>()...));
+    using map = typename detail::make_map_type<Pairs...>::type;
 #endif
 
     //! Function object for creating a `hana::map`.