added optional ref swap

and also chaned the copyright year in docs
This commit is contained in:
Andrzej Krzemienski
2016-02-13 15:33:07 +01:00
parent b5b8414c06
commit 94c735af2d
39 changed files with 159 additions and 37 deletions

View File

@ -37,4 +37,3 @@ struct none_t
} // namespace boost
#endif // header guard

View File

@ -167,6 +167,12 @@ public:
#endif // BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
};
template <class T>
void swap ( optional<T&>& x, optional<T&>& y) BOOST_NOEXCEPT
{
x.swap(y);
}
} // namespace boost
#endif // 1/0

View File

@ -1,4 +1,5 @@
// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
// Copyright (C) 2016 Andrzej Krzemienski
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -15,16 +16,25 @@
#ifndef BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
#define BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
#include <boost/config/suffix.hpp>
namespace boost {
template<class T> class optional ;
// This forward is needed to refer to namespace scope swap from the member swap
template<class T> void swap ( optional<T>& , optional<T>& );
template<class T> void swap ( optional<T>& , optional<T>& ) ;
template<class T> struct optional_swap_should_use_default_constructor ;
#ifndef BOOST_OPTIONAL_CONFIG_DONT_SPECIALIZE_OPTIONAL_REFS
template<class T> class optional<T&> ;
template<class T> void swap ( optional<T&>& , optional<T&>& ) BOOST_NOEXCEPT;
#endif
} // namespace boost
#endif