mirror of
https://github.com/boostorg/detail.git
synced 2025-12-20 05:52:41 +01:00
Compare commits
19 Commits
svn-branch
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef44fa2176 | ||
|
|
3911d7a669 | ||
|
|
23850d984a | ||
|
|
da8fe765fd | ||
|
|
d425f1e5bf | ||
|
|
3178938f98 | ||
|
|
de4c1b2e9d | ||
|
|
770e33343a | ||
|
|
a63bc49cfb | ||
|
|
472ca5d636 | ||
|
|
1588a4a05f | ||
|
|
aaf3c4ac98 | ||
|
|
816cad7bd8 | ||
|
|
d2ce3c5791 | ||
|
|
120abc637c | ||
|
|
34684d4df2 | ||
|
|
20ab8a4e7d | ||
|
|
c6024a4ac4 | ||
|
|
da0f568852 |
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# This file was automatically generated from the original CMakeLists.txt file
|
||||||
|
# Add a variable to hold the headers for the library
|
||||||
|
set (lib_headers
|
||||||
|
detail
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add a library target to the build system
|
||||||
|
boost_library_project(
|
||||||
|
detail
|
||||||
|
# SRCDIRS
|
||||||
|
# TESTDIRS
|
||||||
|
HEADERS ${lib_headers}
|
||||||
|
# DOCDIRS
|
||||||
|
# DESCRIPTION "Helps Boost library developers adapt to compiler idiosyncrasies; not intended for library users."
|
||||||
|
MODULARIZED
|
||||||
|
# AUTHORS "John Maddock <john -at- johnmaddock.co.uk>"
|
||||||
|
# MAINTAINERS
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
/* Copyright 2003-2009 Joaquin M Lopez Munoz.
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@@ -178,12 +178,31 @@ void construct(void* p,const Type& t)
|
|||||||
new (p) Type(t);
|
new (p) Type(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
|
||||||
|
/* MSVC++ issues spurious warnings about unreferencend formal parameters
|
||||||
|
* in destroy<Type> when Type is a class with trivial dtor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable:4100)
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename Type>
|
template<typename Type>
|
||||||
void destroy(const Type* p)
|
void destroy(const Type* p)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
|
||||||
|
const_cast<Type*>(p)->~Type();
|
||||||
|
#else
|
||||||
p->~Type();
|
p->~Type();
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
} /* namespace boost::detail::allocator */
|
} /* namespace boost::detail::allocator */
|
||||||
|
|
||||||
} /* namespace boost::detail */
|
} /* namespace boost::detail */
|
||||||
|
|||||||
99
include/boost/detail/container_fwd.hpp
Normal file
99
include/boost/detail/container_fwd.hpp
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
|
||||||
|
// Copyright 2005-2008 Daniel James.
|
||||||
|
// 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_DETAIL_CONTAINER_FWD_HPP)
|
||||||
|
#define BOOST_DETAIL_CONTAINER_FWD_HPP
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||||
|
# pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||||
|
#define BOOST_HASH_CHAR_TRAITS string_char_traits
|
||||||
|
#else
|
||||||
|
#define BOOST_HASH_CHAR_TRAITS char_traits
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \
|
||||||
|
|| BOOST_WORKAROUND(__BORLANDC__, > 0x551) \
|
||||||
|
|| BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \
|
||||||
|
|| (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
||||||
|
|
||||||
|
#include <deque>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <bitset>
|
||||||
|
#include <string>
|
||||||
|
#include <complex>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && \
|
||||||
|
defined(__STL_CONFIG_H)
|
||||||
|
|
||||||
|
#define BOOST_CONTAINER_FWD_BAD_BITSET
|
||||||
|
|
||||||
|
#if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
|
||||||
|
#define BOOST_CONTAINER_FWD_BAD_DEQUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
|
||||||
|
#include <deque>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_CONTAINER_FWD_BAD_BITSET)
|
||||||
|
#include <bitset>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_MSVC)
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable:4099) // struct/class mismatch in fwd declarations
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <class T> class allocator;
|
||||||
|
template <class charT, class traits, class Allocator> class basic_string;
|
||||||
|
template <class charT> struct BOOST_HASH_CHAR_TRAITS;
|
||||||
|
template <class T> class complex;
|
||||||
|
}
|
||||||
|
|
||||||
|
// gcc 3.4 and greater
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
|
||||||
|
template <class T, class Allocator> class deque;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <class T, class Allocator> class list;
|
||||||
|
template <class T, class Allocator> class vector;
|
||||||
|
template <class Key, class T, class Compare, class Allocator> class map;
|
||||||
|
template <class Key, class T, class Compare, class Allocator>
|
||||||
|
class multimap;
|
||||||
|
template <class Key, class Compare, class Allocator> class set;
|
||||||
|
template <class Key, class Compare, class Allocator> class multiset;
|
||||||
|
|
||||||
|
#if !defined(BOOST_CONTAINER_FWD_BAD_BITSET)
|
||||||
|
template <size_t N> class bitset;
|
||||||
|
#endif
|
||||||
|
template <class T1, class T2> struct pair;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(BOOST_MSVC)
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
|| defined(_M_ALPHA) || defined(__amd64) \
|
|| defined(_M_ALPHA) || defined(__amd64) \
|
||||||
|| defined(__amd64__) || defined(_M_AMD64) \
|
|| defined(__amd64__) || defined(_M_AMD64) \
|
||||||
|| defined(__x86_64) || defined(__x86_64__) \
|
|| defined(__x86_64) || defined(__x86_64__) \
|
||||||
|| defined(_M_X64)
|
|| defined(_M_X64) || defined(__bfin__)
|
||||||
|
|
||||||
# define BOOST_LITTLE_ENDIAN
|
# define BOOST_LITTLE_ENDIAN
|
||||||
# define BOOST_BYTE_ORDER 1234
|
# define BOOST_BYTE_ORDER 1234
|
||||||
|
|||||||
0
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
0
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
0
include/boost/detail/is_function_ref_tester.hpp
Executable file → Normal file
0
include/boost/detail/is_function_ref_tester.hpp
Executable file → Normal file
0
include/boost/detail/is_xxx.hpp
Executable file → Normal file
0
include/boost/detail/is_xxx.hpp
Executable file → Normal file
@@ -10,14 +10,15 @@
|
|||||||
//
|
//
|
||||||
// boost/detail/lightweight_test.hpp - lightweight test library
|
// boost/detail/lightweight_test.hpp - lightweight test library
|
||||||
//
|
//
|
||||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
// Copyright (c) 2002, 2009 Peter Dimov
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
//
|
//
|
||||||
// BOOST_TEST(expression)
|
// BOOST_TEST(expression)
|
||||||
// BOOST_ERROR(message)
|
// BOOST_ERROR(message)
|
||||||
|
// BOOST_TEST_EQ(expr1, expr2)
|
||||||
//
|
//
|
||||||
// int boost::report_errors()
|
// int boost::report_errors()
|
||||||
//
|
//
|
||||||
@@ -49,6 +50,20 @@ inline void error_impl(char const * msg, char const * file, int line, char const
|
|||||||
++test_errors();
|
++test_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class T, class U> inline void test_eq_impl( char const * expr1, char const * expr2, char const * file, int line, char const * function, T const & t, U const & u )
|
||||||
|
{
|
||||||
|
if( t == u )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cerr << file << "(" << line << "): test '" << expr1 << " == " << expr2
|
||||||
|
<< "' failed in function '" << function << "': "
|
||||||
|
<< "'" << t << "' != '" << u << "'" << std::endl;
|
||||||
|
++test_errors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
inline int report_errors()
|
inline int report_errors()
|
||||||
@@ -71,5 +86,6 @@ inline int report_errors()
|
|||||||
|
|
||||||
#define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
|
#define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
|
||||||
#define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)
|
#define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)
|
||||||
|
#define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||||
|
|
||||||
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
||||||
|
|||||||
@@ -13,186 +13,11 @@
|
|||||||
// Copyright (c) 2003 David Abrahams
|
// Copyright (c) 2003 David Abrahams
|
||||||
// Copyright (c) 2003 Peter Dimov
|
// Copyright (c) 2003 Peter Dimov
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/smart_ptr/detail/quick_allocator.hpp>
|
||||||
|
|
||||||
#include <boost/detail/lightweight_mutex.hpp>
|
|
||||||
#include <boost/type_traits/type_with_alignment.hpp>
|
|
||||||
#include <boost/type_traits/alignment_of.hpp>
|
|
||||||
|
|
||||||
#include <new> // ::operator new, ::operator delete
|
|
||||||
#include <cstddef> // std::size_t
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_> union freeblock
|
|
||||||
{
|
|
||||||
typedef typename boost::type_with_alignment<align_>::type aligner_type;
|
|
||||||
aligner_type aligner;
|
|
||||||
char bytes[size];
|
|
||||||
freeblock * next;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_> struct allocator_impl
|
|
||||||
{
|
|
||||||
typedef freeblock<size, align_> block;
|
|
||||||
|
|
||||||
// It may seem odd to use such small pages.
|
|
||||||
//
|
|
||||||
// However, on a typical Windows implementation that uses
|
|
||||||
// the OS allocator, "normal size" pages interact with the
|
|
||||||
// "ordinary" operator new, slowing it down dramatically.
|
|
||||||
//
|
|
||||||
// 512 byte pages are handled by the small object allocator,
|
|
||||||
// and don't interfere with ::new.
|
|
||||||
//
|
|
||||||
// The other alternative is to use much bigger pages (1M.)
|
|
||||||
//
|
|
||||||
// It is surprisingly easy to hit pathological behavior by
|
|
||||||
// varying the page size. g++ 2.96 on Red Hat Linux 7.2,
|
|
||||||
// for example, passionately dislikes 496. 512 seems OK.
|
|
||||||
|
|
||||||
#if defined(BOOST_QA_PAGE_SIZE)
|
|
||||||
|
|
||||||
enum { items_per_page = BOOST_QA_PAGE_SIZE / size };
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
enum { items_per_page = 512 / size }; // 1048560 / size
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
|
|
||||||
static lightweight_mutex & mutex()
|
|
||||||
{
|
|
||||||
static lightweight_mutex m;
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
|
|
||||||
static lightweight_mutex * mutex_init;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static block * free;
|
|
||||||
static block * page;
|
|
||||||
static unsigned last;
|
|
||||||
|
|
||||||
static inline void * alloc()
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
lightweight_mutex::scoped_lock lock( mutex() );
|
|
||||||
#endif
|
|
||||||
if(block * x = free)
|
|
||||||
{
|
|
||||||
free = x->next;
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(last == items_per_page)
|
|
||||||
{
|
|
||||||
// "Listen to me carefully: there is no memory leak"
|
|
||||||
// -- Scott Meyers, Eff C++ 2nd Ed Item 10
|
|
||||||
page = ::new block[items_per_page];
|
|
||||||
last = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return &page[last++];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void * alloc(std::size_t n)
|
|
||||||
{
|
|
||||||
if(n != size) // class-specific new called for a derived object
|
|
||||||
{
|
|
||||||
return ::operator new(n);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
lightweight_mutex::scoped_lock lock( mutex() );
|
|
||||||
#endif
|
|
||||||
if(block * x = free)
|
|
||||||
{
|
|
||||||
free = x->next;
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(last == items_per_page)
|
|
||||||
{
|
|
||||||
page = ::new block[items_per_page];
|
|
||||||
last = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return &page[last++];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void dealloc(void * pv)
|
|
||||||
{
|
|
||||||
if(pv != 0) // 18.4.1.1/13
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
lightweight_mutex::scoped_lock lock( mutex() );
|
|
||||||
#endif
|
|
||||||
block * pb = static_cast<block *>(pv);
|
|
||||||
pb->next = free;
|
|
||||||
free = pb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void dealloc(void * pv, std::size_t n)
|
|
||||||
{
|
|
||||||
if(n != size) // class-specific delete called for a derived object
|
|
||||||
{
|
|
||||||
::operator delete(pv);
|
|
||||||
}
|
|
||||||
else if(pv != 0) // 18.4.1.1/13
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
lightweight_mutex::scoped_lock lock( mutex() );
|
|
||||||
#endif
|
|
||||||
block * pb = static_cast<block *>(pv);
|
|
||||||
pb->next = free;
|
|
||||||
free = pb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
|
||||||
lightweight_mutex * allocator_impl<size, align_>::mutex_init = &allocator_impl<size, align_>::mutex();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
|
||||||
freeblock<size, align_> * allocator_impl<size, align_>::free = 0;
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
|
||||||
freeblock<size, align_> * allocator_impl<size, align_>::page = 0;
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
|
||||||
unsigned allocator_impl<size, align_>::last = allocator_impl<size, align_>::items_per_page;
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct quick_allocator: public allocator_impl< sizeof(T), boost::alignment_of<T>::value >
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
|
#endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
|
||||||
|
|||||||
56
include/boost/detail/scoped_enum_emulation.hpp
Normal file
56
include/boost/detail/scoped_enum_emulation.hpp
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
// scoped_enum_emulation.hpp ---------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright Beman Dawes, 2009
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
// Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x
|
||||||
|
// scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS
|
||||||
|
// macro is used to detect feature support.
|
||||||
|
//
|
||||||
|
// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
|
||||||
|
// description of the scoped enum feature. Note that the committee changed the name
|
||||||
|
// from strongly typed enum to scoped enum.
|
||||||
|
//
|
||||||
|
// Caution: only the syntax is emulated; the semantics are not emulated and
|
||||||
|
// the syntax emulation doesn't include being able to specify the underlying
|
||||||
|
// representation type.
|
||||||
|
//
|
||||||
|
// The emulation is via struct rather than namespace to allow use within classes.
|
||||||
|
// Thanks to Andrey Semashev for pointing that out.
|
||||||
|
//
|
||||||
|
// Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,
|
||||||
|
// Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vincente
|
||||||
|
// Botet, and Daniel James.
|
||||||
|
//
|
||||||
|
// Sample usage:
|
||||||
|
//
|
||||||
|
// BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END
|
||||||
|
// ...
|
||||||
|
// BOOST_SCOPED_ENUM(algae) sample( algae::red );
|
||||||
|
// void foo( BOOST_SCOPED_ENUM(algae) color );
|
||||||
|
// ...
|
||||||
|
// sample = algae::green;
|
||||||
|
// foo( algae::cyan );
|
||||||
|
|
||||||
|
#ifndef BOOST_SCOPED_ENUM_EMULATION_HPP
|
||||||
|
#define BOOST_SCOPED_ENUM_EMULATION_HPP
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_NO_SCOPED_ENUMS
|
||||||
|
|
||||||
|
# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_t
|
||||||
|
# define BOOST_SCOPED_ENUM_END };
|
||||||
|
# define BOOST_SCOPED_ENUM(name) name::enum_t
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
# define BOOST_SCOPED_ENUM_START(name) enum class name
|
||||||
|
# define BOOST_SCOPED_ENUM_END
|
||||||
|
# define BOOST_SCOPED_ENUM(name) name
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // BOOST_SCOPED_ENUM_EMULATION_HPP
|
||||||
@@ -86,8 +86,10 @@
|
|||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||||
using ::codecvt;
|
namespace std {
|
||||||
using ::mbstate_t;
|
using ::mbstate_t;
|
||||||
|
using ::size_t;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
|
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
|
||||||
|
|||||||
0
include/boost/indirect_reference.hpp
Executable file → Normal file
0
include/boost/indirect_reference.hpp
Executable file → Normal file
1
module.cmake
Normal file
1
module.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
boost_module(detail DEPENDS integer)
|
||||||
Reference in New Issue
Block a user