diff options
author | Stefan Radomski <github@mintwerk.de> | 2017-06-27 11:11:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-27 11:11:13 (GMT) |
commit | e24393f41834f116038faf6c6d5012575a67136a (patch) | |
tree | a1e83679e55781bc92849a07c5acda7b5c09908c /contrib/src/boost/random/detail/seed.hpp | |
parent | b3a2d91805feb81f79ee52c30a077521912b0bf9 (diff) | |
parent | 3a5692f40663282640775f8ff497c4860d265a2a (diff) | |
download | uscxml-e24393f41834f116038faf6c6d5012575a67136a.zip uscxml-e24393f41834f116038faf6c6d5012575a67136a.tar.gz uscxml-e24393f41834f116038faf6c6d5012575a67136a.tar.bz2 |
Merge pull request #149 from tklab-tud/sradomski
remerge
Diffstat (limited to 'contrib/src/boost/random/detail/seed.hpp')
-rw-r--r-- | contrib/src/boost/random/detail/seed.hpp | 230 |
1 files changed, 115 insertions, 115 deletions
diff --git a/contrib/src/boost/random/detail/seed.hpp b/contrib/src/boost/random/detail/seed.hpp index 1c01f92..557482a 100644 --- a/contrib/src/boost/random/detail/seed.hpp +++ b/contrib/src/boost/random/detail/seed.hpp @@ -1,115 +1,115 @@ -/* boost random/detail/seed.hpp header file
- *
- * Copyright Steven Watanabe 2009
- * 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)
- *
- * See http://www.boost.org for most recent version including documentation.
- *
- * $Id$
- */
-
-#ifndef BOOST_RANDOM_DETAIL_SEED_HPP
-#define BOOST_RANDOM_DETAIL_SEED_HPP
-
-#include <boost/config.hpp>
-
-// Sun seems to have trouble with the use of SFINAE for the
-// templated constructor. So does Borland.
-#if !defined(BOOST_NO_SFINAE) && !defined(__SUNPRO_CC) && !defined(__BORLANDC__)
-
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/mpl/bool.hpp>
-
-namespace boost {
-namespace random {
-namespace detail {
-
-template<class T>
-struct disable_seed : boost::disable_if<boost::is_arithmetic<T> > {};
-
-template<class Engine, class T>
-struct disable_constructor : disable_seed<T> {};
-
-template<class Engine>
-struct disable_constructor<Engine, Engine> {};
-
-#define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \
- template<class Generator> \
- explicit Self(Generator& gen, typename ::boost::random::detail::disable_constructor<Self, Generator>::type* = 0)
-
-#define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \
- template<class Generator> \
- void seed(Generator& gen, typename ::boost::random::detail::disable_seed<Generator>::type* = 0)
-
-#define BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(Self, SeedSeq, seq) \
- template<class SeedSeq> \
- explicit Self(SeedSeq& seq, typename ::boost::random::detail::disable_constructor<Self, SeedSeq>::type* = 0)
-
-#define BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(Self, SeedSeq, seq) \
- template<class SeedSeq> \
- void seed(SeedSeq& seq, typename ::boost::random::detail::disable_seed<SeedSeq>::type* = 0)
-
-#define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \
- explicit Self(const T& x)
-
-#define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \
- void seed(const T& x)
-}
-}
-}
-
-#else
-
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/mpl/bool.hpp>
-
-#define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \
- Self(Self& other) { *this = other; } \
- Self(const Self& other) { *this = other; } \
- template<class Generator> \
- explicit Self(Generator& gen) { \
- boost_random_constructor_impl(gen, ::boost::is_arithmetic<Generator>());\
- } \
- template<class Generator> \
- void boost_random_constructor_impl(Generator& gen, ::boost::mpl::false_)
-
-#define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \
- template<class Generator> \
- void seed(Generator& gen) { \
- boost_random_seed_impl(gen, ::boost::is_arithmetic<Generator>());\
- }\
- template<class Generator>\
- void boost_random_seed_impl(Generator& gen, ::boost::mpl::false_)
-
-#define BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(Self, SeedSeq, seq) \
- Self(Self& other) { *this = other; } \
- Self(const Self& other) { *this = other; } \
- template<class SeedSeq> \
- explicit Self(SeedSeq& seq) { \
- boost_random_constructor_impl(seq, ::boost::is_arithmetic<SeedSeq>());\
- } \
- template<class SeedSeq> \
- void boost_random_constructor_impl(SeedSeq& seq, ::boost::mpl::false_)
-
-#define BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(Self, SeedSeq, seq) \
- template<class SeedSeq> \
- void seed(SeedSeq& seq) { \
- boost_random_seed_impl(seq, ::boost::is_arithmetic<SeedSeq>()); \
- } \
- template<class SeedSeq> \
- void boost_random_seed_impl(SeedSeq& seq, ::boost::mpl::false_)
-
-#define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \
- explicit Self(const T& x) { boost_random_constructor_impl(x, ::boost::mpl::true_()); }\
- void boost_random_constructor_impl(const T& x, ::boost::mpl::true_)
-
-#define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \
- void seed(const T& x) { boost_random_seed_impl(x, ::boost::mpl::true_()); }\
- void boost_random_seed_impl(const T& x, ::boost::mpl::true_)
-
-#endif
-
-#endif
+/* boost random/detail/seed.hpp header file + * + * Copyright Steven Watanabe 2009 + * 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) + * + * See http://www.boost.org for most recent version including documentation. + * + * $Id$ + */ + +#ifndef BOOST_RANDOM_DETAIL_SEED_HPP +#define BOOST_RANDOM_DETAIL_SEED_HPP + +#include <boost/config.hpp> + +// Sun seems to have trouble with the use of SFINAE for the +// templated constructor. So does Borland. +#if !defined(BOOST_NO_SFINAE) && !defined(__SUNPRO_CC) && !defined(__BORLANDC__) + +#include <boost/utility/enable_if.hpp> +#include <boost/type_traits/is_arithmetic.hpp> +#include <boost/mpl/bool.hpp> + +namespace boost { +namespace random { +namespace detail { + +template<class T> +struct disable_seed : boost::disable_if<boost::is_arithmetic<T> > {}; + +template<class Engine, class T> +struct disable_constructor : disable_seed<T> {}; + +template<class Engine> +struct disable_constructor<Engine, Engine> {}; + +#define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \ + template<class Generator> \ + explicit Self(Generator& gen, typename ::boost::random::detail::disable_constructor<Self, Generator>::type* = 0) + +#define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \ + template<class Generator> \ + void seed(Generator& gen, typename ::boost::random::detail::disable_seed<Generator>::type* = 0) + +#define BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(Self, SeedSeq, seq) \ + template<class SeedSeq> \ + explicit Self(SeedSeq& seq, typename ::boost::random::detail::disable_constructor<Self, SeedSeq>::type* = 0) + +#define BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(Self, SeedSeq, seq) \ + template<class SeedSeq> \ + void seed(SeedSeq& seq, typename ::boost::random::detail::disable_seed<SeedSeq>::type* = 0) + +#define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \ + explicit Self(const T& x) + +#define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \ + void seed(const T& x) +} +} +} + +#else + +#include <boost/type_traits/is_arithmetic.hpp> +#include <boost/mpl/bool.hpp> + +#define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \ + Self(Self& other) { *this = other; } \ + Self(const Self& other) { *this = other; } \ + template<class Generator> \ + explicit Self(Generator& gen) { \ + boost_random_constructor_impl(gen, ::boost::is_arithmetic<Generator>());\ + } \ + template<class Generator> \ + void boost_random_constructor_impl(Generator& gen, ::boost::mpl::false_) + +#define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \ + template<class Generator> \ + void seed(Generator& gen) { \ + boost_random_seed_impl(gen, ::boost::is_arithmetic<Generator>());\ + }\ + template<class Generator>\ + void boost_random_seed_impl(Generator& gen, ::boost::mpl::false_) + +#define BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(Self, SeedSeq, seq) \ + Self(Self& other) { *this = other; } \ + Self(const Self& other) { *this = other; } \ + template<class SeedSeq> \ + explicit Self(SeedSeq& seq) { \ + boost_random_constructor_impl(seq, ::boost::is_arithmetic<SeedSeq>());\ + } \ + template<class SeedSeq> \ + void boost_random_constructor_impl(SeedSeq& seq, ::boost::mpl::false_) + +#define BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(Self, SeedSeq, seq) \ + template<class SeedSeq> \ + void seed(SeedSeq& seq) { \ + boost_random_seed_impl(seq, ::boost::is_arithmetic<SeedSeq>()); \ + } \ + template<class SeedSeq> \ + void boost_random_seed_impl(SeedSeq& seq, ::boost::mpl::false_) + +#define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \ + explicit Self(const T& x) { boost_random_constructor_impl(x, ::boost::mpl::true_()); }\ + void boost_random_constructor_impl(const T& x, ::boost::mpl::true_) + +#define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \ + void seed(const T& x) { boost_random_seed_impl(x, ::boost::mpl::true_()); }\ + void boost_random_seed_impl(const T& x, ::boost::mpl::true_) + +#endif + +#endif |