Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ install:

- git submodule init libs/array
- git submodule init libs/assert
- git submodule init libs/bimap
- git submodule init libs/bind
- git submodule init libs/concept_check
- git submodule init libs/config
- git submodule init libs/container
- git submodule init libs/container_hash
- git submodule init libs/conversion
- git submodule init libs/core
Expand All @@ -195,6 +197,7 @@ install:
- git submodule init libs/function_types
- git submodule init libs/functional
- git submodule init libs/integer
- git submodule init libs/intrusive
- git submodule init libs/iterator
- git submodule init libs/lambda
- git submodule init libs/move
Expand Down
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ install:

- git submodule init libs/array
- git submodule init libs/assert
- git submodule init libs/bimap
- git submodule init libs/bind
- git submodule init libs/concept_check
- git submodule init libs/config
- git submodule init libs/container
- git submodule init libs/container_hash
- git submodule init libs/conversion
- git submodule init libs/core
Expand All @@ -57,6 +59,7 @@ install:
- git submodule init libs/function_types
- git submodule init libs/functional
- git submodule init libs/integer
- git submodule init libs/intrusive
- git submodule init libs/iterator
- git submodule init libs/lambda
- git submodule init libs/move
Expand Down
104 changes: 104 additions & 0 deletions doc/adapted.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,110 @@ __boost_array_library__

[endsect]

[section:structured_pair boost::bimaps::relation::structured_pair]

This module provides adapters for
`boost::bimaps::relation::structured_pair`. Including the module header
makes `boost::bimaps::relation::structured_pair` a fully conforming
__random_access_sequence__.

[heading Header]

#include <boost/fusion/adapted/boost_bimap_pair.hpp>
#include <boost/fusion/include/boost_bimap_pair.hpp>

[heading Model of]

* __random_access_sequence__

[heading Example]

boost::bimaps::relation::structured_pair<
int
, std::string
> p(123, "Hola!!!");
std::cout << __at_c__<0>(p) << std::endl;
std::cout << __at_c__<1>(p) << std::endl;
std::cout << p << std::endl;

[endsect]

[section:compressed_pair boost::compressed_pair]

This module provides adapters for __boost_compressed_pair__. Including the
module header makes __boost_compressed_pair__ a fully conforming
__random_access_sequence__.

[heading Header]

#include <boost/fusion/adapted/boost_compressed_pair.hpp>
#include <boost/fusion/include/boost_compressed_pair.hpp>

[heading Model of]

* __random_access_sequence__

[heading Example]

boost::compressed_pair<int, std::string> p(123, "Hola!!!");
std::cout << __at_c__<0>(p) << std::endl;
std::cout << __at_c__<1>(p) << std::endl;
std::cout << p << std::endl;

[endsect]

[section:container_pair boost::container::map/multimap<>::movable_value_type]

This module provides adapters for the `mutable_value_type` definition nested
within __boost_container_map__ and __boost_container_multimap__. Including
the module header makes `mutable_value_type` a fully conforming
__random_access_sequence__.

[heading Header]

#include <boost/fusion/adapted/boost_container_pair.hpp>
#include <boost/fusion/include/boost_container_pair.hpp>

[heading Model of]

* __random_access_sequence__

[heading Example]

boost::container::map<
int
, std::string
>::movable_value_type p(123, "Hola!!!");
std::cout << __at_c__<0>(p) << std::endl;
std::cout << __at_c__<1>(p) << std::endl;
std::cout << p << std::endl;

[endsect]

[section:compressed_pair boost::compressed_pair]

This module provides adapters for __boost_compressed_pair__. Including the
module header makes __boost_compressed_pair__ a fully conforming
__random_access_sequence__.

[heading Header]

#include <boost/fusion/adapted/boost_compressed_pair.hpp>
#include <boost/fusion/include/boost_compressed_pair.hpp>

[heading Model of]

* __random_access_sequence__

[heading Example]

boost::compressed_pair<int, std::string> p(123, "Hola!!!");
std::cout << __at_c__<0>(p) << std::endl;
std::cout << __at_c__<1>(p) << std::endl;
std::cout << p << std::endl;

[endsect]

[section boost::tuple]
This module provides adapters for `boost::tuple`. Including the module
header makes `boost::tuple` a fully conforming __forward_sequence__.
Expand Down
6 changes: 6 additions & 0 deletions doc/fusion.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
[def __boost_any__ [@http://www.boost.org/libs/any Boost.Any Library]]
[def __new_iterator_concepts__ [@http://www.boost.org/libs/iterator/doc/new-iter-concepts.html New Iterator Concepts]]
[def __boost_array_library__ [@http://www.boost.org/libs/array Boost.Array Library]]
[def __boost_container_map__ [@http://www.boost.org/doc/html/boost/container/map.html `boost::container::map`]]
[def __boost_container_multimap__ [@http://www.boost.org/doc/html/boost/container/multimap.html `boost::container::multimap`]]
[def __boost_compressed_pair__ [@http://www.boost.org/libs/utility/doc/html/compressed_pair.html `boost::compressed_pair`]]
[def __boost_variant_library__ [@http://www.boost.org/libs/variant Boost.Variant Library]]
[def __boost_tuple_library__ [@http://www.boost.org/libs/tuple Boost.Tuple Library]]
[def __boost_ref__ [@http://www.boost.org/libs/core/ref.html Ref utility]]
Expand Down Expand Up @@ -134,6 +137,9 @@
[def __array__ [link fusion.adapted.array array]]
[def __std_pair__ [link fusion.adapted.std__pair `std::pair`]]
[def __boost_array__ [link fusion.adapted.boost__array `boost::array`]]
[def __structured_pair__ [link fusion.adapted.structured_pair `boost::bimaps::relation::structured_pair`]]
[def __container_pair__ [link fusion.adapted.container_pair `boost::container::map/multimap<>::movable_value_type`]]
[def __compressed_pair__ [link fusion.adapted.compressed_pair `boost::compressed_pair`]]
[def __mpl_sequence__ [link fusion.adapted.mpl_sequence mpl sequence]]
[def __adapt_tpl_struct__ [link fusion.adapted.adapt_tpl_struct `BOOST_FUSION_ADAPT_TPL_STRUCT`]]
[def __adapt_struct_named__ [link fusion.adapted.adapt_struct_named `BOOST_FUSION_ADAPT_STRUCT_NAMED`]]
Expand Down
9 changes: 9 additions & 0 deletions doc/sequence.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ For any Forward Sequence s the following invariants always hold:
[heading Models]

* __std_pair__
* __structured_pair__
* __container_pair__
* __compressed_pair__
* __boost_array__
* __vector__
* __cons__
Expand Down Expand Up @@ -193,6 +196,9 @@ are not defined in __forward_sequence__.
[heading Models]

* __std_pair__
* __structured_pair__
* __container_pair__
* __compressed_pair__
* __boost_array__
* __vector__
* __map__
Expand Down Expand Up @@ -281,6 +287,9 @@ are not defined in __bidirectional_sequence__.
[heading Models]

* __std_pair__
* __structured_pair__
* __container_pair__
* __compressed_pair__
* __boost_array__
* __vector__
* __map__
Expand Down
17 changes: 11 additions & 6 deletions include/boost/fusion/adapted.hpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
/*=============================================================================
/*============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
============================================================================*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

superfluous edit?

#if !defined(BOOST_FUSION_ADAPTED_30122005_1420)
#define BOOST_FUSION_ADAPTED_30122005_1420

#include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/adt.hpp>
#include <boost/fusion/adapted/array.hpp>
#include <boost/fusion/adapted/boost_array.hpp>
#include <boost/fusion/adapted/boost_tuple.hpp>
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/adapted/std_pair.hpp>
#include <boost/fusion/adapted/boost_bimap_pair.hpp>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it some more, perhaps it's good to have a preprocessor define for bringing these in? Perhaps initially undefined. E.g. BOOST_FUSION_ADAPT_BIMAP

#include <boost/fusion/adapted/boost_compressed_pair.hpp>
#include <boost/fusion/adapted/boost_container_pair.hpp>
#include <boost/fusion/adapted/struct.hpp>
#include <boost/fusion/support/config.hpp>

// The std_tuple_iterator adaptor only supports implementations
// using variadic templates
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#include <boost/fusion/adapted/std_tuple.hpp>
#endif

#endif
#endif // include guard

71 changes: 71 additions & 0 deletions include/boost/fusion/adapted/boost_bimap_pair.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*============================================================================
Copyright (c) 2013-2018 Cromwell D. Enage

Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
============================================================================*/
#if !defined(BOOST_FUSION_ADAPTED_BOOST_BIMAP_PAIR_HPP)
#define BOOST_FUSION_ADAPTED_BOOST_BIMAP_PAIR_HPP

#include <boost/bimap/tags/support/default_tagged.hpp>
#include <boost/bimap/relation/member_at.hpp>

namespace boost { namespace fusion { namespace detail { namespace bimap_pair
{
template <typename T>
struct first_type
{
typedef typename ::boost::bimaps::tags::support::default_tagged<
T
, ::boost::bimaps::relation::member_at::left
>::type::value_type type;
};

template <typename T>
struct second_type
{
typedef typename ::boost::bimaps::tags::support::default_tagged<
T
, ::boost::bimaps::relation::member_at::right
>::type::value_type type;
};
}}}}

#include <boost/bimap/relation/structured_pair.hpp>
#include <boost/fusion/adapted/struct/adapt_struct.hpp>

BOOST_FUSION_ADAPT_TPL_STRUCT(
(T1)(T2)
, (::boost::bimaps::relation::structured_pair)
(T1)
(T2)
(boost::bimaps::relation::normal_layout)
, (
typename ::boost::fusion::detail::bimap_pair::first_type<T1>::type
, first
)
(
typename ::boost::fusion::detail::bimap_pair::second_type<T2>::type
, second
)
)

BOOST_FUSION_ADAPT_TPL_STRUCT(
(T1)(T2)
, (::boost::bimaps::relation::structured_pair)
(T1)
(T2)
(boost::bimaps::relation::mirror_layout)
, (
typename ::boost::fusion::detail::bimap_pair::second_type<T2>::type
, second
)
(
typename ::boost::fusion::detail::bimap_pair::first_type<T1>::type
, first
)
)

#endif // include guard

33 changes: 33 additions & 0 deletions include/boost/fusion/adapted/boost_compressed_pair.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*============================================================================
Copyright (c) 2013-2018 Cromwell D. Enage

Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
============================================================================*/
#if !defined(BOOST_FUSION_ADAPTED_BOOST_COMPRESSED_PAIR_HPP)
#define BOOST_FUSION_ADAPTED_BOOST_COMPRESSED_PAIR_HPP

#include <boost/fusion/adapted/adt/adapt_adt.hpp>
#include <boost/compressed_pair.hpp>
#include <boost/call_traits.hpp>

BOOST_FUSION_ADAPT_TPL_ADT(
(T1)(T2)
, (::boost::compressed_pair)(T1)(T2)
, (
typename ::boost::call_traits<T1>::reference
, typename ::boost::call_traits<T1>::const_reference
, obj.first()
, obj.first() = val
)
(
typename ::boost::call_traits<T2>::reference
, typename ::boost::call_traits<T2>::const_reference
, obj.second()
, obj.second() = val
)
)

#endif // include guard

19 changes: 19 additions & 0 deletions include/boost/fusion/adapted/boost_container_pair.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*============================================================================
Copyright (c) 2013-2018 Cromwell D. Enage

Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
============================================================================*/
#if !defined(BOOST_FUSION_ADAPTED_BOOST_CONTAINER_PAIR_HPP)
#define BOOST_FUSION_ADAPTED_BOOST_CONTAINER_PAIR_HPP

#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/container/detail/pair.hpp>

BOOST_FUSION_ADAPT_TPL_STRUCT(
(T1)(T2), (::boost::container::dtl::pair)(T1)(T2), (T1, first)(T2, second)
)

#endif // include guard

14 changes: 14 additions & 0 deletions include/boost/fusion/include/boost_bimap_pair.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*============================================================================
Copyright (c) 2013-2018 Cromwell D. Enage

Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
============================================================================*/
#if !defined(BOOST_FUSION_INCLUDE_BOOST_BIMAP_PAIR_HPP)
#define BOOST_FUSION_INCLUDE_BOOST_BIMAP_PAIR_HPP

#include <boost/fusion/adapted/boost_bimap_pair.hpp>

#endif // include guard

14 changes: 14 additions & 0 deletions include/boost/fusion/include/boost_compressed_pair.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*============================================================================
Copyright (c) 2013-2018 Cromwell D. Enage

Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
============================================================================*/
#if !defined(BOOST_FUSION_INCLUDE_BOOST_COMPRESSED_PAIR_HPP)
#define BOOST_FUSION_INCLUDE_BOOST_COMPRESSED_PAIR_HPP

#include <boost/fusion/adapted/boost_compressed_pair.hpp>

#endif // include guard

Loading