diff --git a/.travis.yml b/.travis.yml index f4959f90e..90e1375b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - ./scripts/copyright_check.sh # g++4.8.1 - - if [ "$CXX" == "g++" ]; then + - if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && export CXX; fi @@ -24,14 +24,14 @@ before_install: - sudo apt-get -qq update install: - # CMake 3.0 + # CMake 3.1 - sudo apt-get -qq install libc6-i386 - && wget http://www.cmake.org/files/v3.0/cmake-3.0.2-Linux-i386.tar.gz - && tar -xzf cmake-3.0.2-Linux-i386.tar.gz - && sudo cp -fR cmake-3.0.2-Linux-i386/* /usr + && wget http://www.cmake.org/files/v3.1/cmake-3.1.0-Linux-i386.tar.gz + && tar -xzf cmake-3.1.0-Linux-i386.tar.gz + && sudo cp -fR cmake-3.1.0-Linux-i386/* /usr # g++4.8.1 - - if [ "$CXX" = "g++" ]; then + - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq gcc-4.8 g++-4.8 && export CXX="g++-4.8" && sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc @@ -59,7 +59,7 @@ script: - sudo cpack || (cat _CPack_Packages/Linux/TGZ/InstallOutput.log; exit 1) # Build examples from installed Autowiring - - cd examples + - cd examples && cmake . -Dautowiring_ARCHITECTURE=x64 && make && cd .. diff --git a/CMakeLists.txt b/CMakeLists.txt index 608d42b07..bb2facf69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8") message(FATAL_ERROR "GCC version 4.8 minimum is required to build Autowiring") endif() -elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") +elseif (MSVC) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "18.0") message(FATAL_ERROR "MSVC 2013 minimum is required to build Autowiring") endif() @@ -73,7 +73,7 @@ if(NOT WIN32) endif() # Clang needs special additional flags to build with C++11 -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # Apple needs us to tell it that we're using libc++, or it will try to use libstdc++ instead if(autowiring_USE_LIBCXX) message(STATUS "AppleClang C++11") @@ -84,10 +84,10 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") endif() -elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") message(STATUS "Clang C++11") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lstdc++") -elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") message(STATUS "GCC C++11") endif() @@ -117,7 +117,7 @@ if(AUTOWIRING_IS_EMBEDDED) set(AUTOWIRING_BUILD_TESTS_DEFAULT OFF) else() set(AUTOWIRING_BUILD_TESTS_DEFAULT ON) - + # All of our binaries go to one place: The binaries output directory. We only want to tinker # with this if we're building by ourselves, otherwise we just do whatever the enclosing project # wants us to do. @@ -213,12 +213,21 @@ if(NOT AUTOWIRING_IS_EMBEDDED) # Install public header files install( - DIRECTORY ${PROJECT_SOURCE_DIR}/autowiring/ - DESTINATION include/autowiring + DIRECTORY ${PROJECT_SOURCE_DIR}/autowiring + DESTINATION include COMPONENT autowiring FILES_MATCHING PATTERN "*.h" ) + # Install autoboost headers + if(NOT autowiring_USE_LIBCXX) + install( + DIRECTORY ${PROJECT_SOURCE_DIR}/contrib/autoboost/autoboost + DESTINATION include + COMPONENT autowiring + ) + endif() + # Targets file is needed in order to describe how to link Autowiring to the rest of the system install(EXPORT AutowiringTargets FILE AutowiringTargets.cmake COMPONENT autowiring NAMESPACE Autowiring:: DESTINATION cmake CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES}) diff --git a/autowiring-configVersion.cmake.in b/autowiring-configVersion.cmake.in index b71e4bc88..64bca57a4 100644 --- a/autowiring-configVersion.cmake.in +++ b/autowiring-configVersion.cmake.in @@ -1,4 +1,7 @@ set(PACKAGE_VERSION "@autowiring_VERSION@") +set(PACKAGE_VERSION_MAJOR "@autowiring_VERSION_MAJOR@") +set(PACKAGE_VERSION_MINOR "@autowiring_VERSION_MINOR@") +set(PACKAGE_VERSION_PATCH "@autowiring_VERSION_PATCH@") if(autowiring_DEBUG) message(STATUS "Debug mode on") @@ -69,7 +72,7 @@ endforeach() # Determine whether the user's request (either implied or explicit) for libstdc++ can # be met by this verison of Autowiring -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # If this value isn't defined, then we assume the user's request is "on" if(NOT DEFINED autowiring_USE_LIBCXX) SET(autowiring_USE_LIBCXX ON) @@ -92,12 +95,24 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") endif() endif() -# Check whether the requested PACKAGE_FIND_VERSION is compatible -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + if(autowiring_DEBUG) + message(STATUS "Our version is less than the requested one, trivially incompatible") + endif() + set(PACKAGE_VERSION_COMPATIBLE FALSE) +elseif(NOT PACKAGE_FIND_VERSION_MINOR EQUAL PACKAGE_VERSION_MINOR) + if(autowiring_DEBUG) + message(STATUS "Minor version mismatch, requested minor is ${PACKAGE_FIND_VERSION_MINOR}, this version is ${PACKAGE_VERSION_MINOR}") + endif() + set(PACKAGE_VERSION_COMPATIBLE FALSE) +elseif(NOT PACKAGE_FIND_VERSION_MAJOR EQUAL PACKAGE_VERSION_MAJOR) + if(autowiring_DEBUG) + message(STATUS "Major version mismatch, failure.") + endif() set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) - if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + if (PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_EXACT TRUE) endif() diff --git a/autowiring/AutoConfigManager.h b/autowiring/AutoConfigManager.h index 7b0b93e9e..0498c3a6d 100644 --- a/autowiring/AutoConfigManager.h +++ b/autowiring/AutoConfigManager.h @@ -2,11 +2,12 @@ #pragma once #include "autowiring_error.h" #include "ConfigRegistry.h" +#include "ContextMember.h" #include -#include #include #include STL_UNORDERED_MAP #include STL_UNORDERED_SET +#include MUTEX_HEADER #include MEMORY_HEADER struct AnySharedPointer; @@ -43,6 +44,10 @@ class AutoConfigManager: // map of callbacks registered for a key std::unordered_map> m_callbacks; + // Exception throwers: + void ThrowKeyNotFoundException(const std::string& key) const; + void ThrowTypeMismatchException(const std::string& key, const std::type_info& ti) const; + public: /// /// Check if this key has been set @@ -73,18 +78,11 @@ class AutoConfigManager: template void Set(const std::string& key, const T& value) { - if (!s_registry.count(key)) { - std::stringstream ss; - ss << "No configuration found for key '" << key << "'"; - throw autowiring_error(ss.str()); - } + if (!s_registry.count(key)) + ThrowKeyNotFoundException(key); - if (!s_registry.find(key)->second->verifyType(typeid(T))) { - std::stringstream ss; - ss << "Attempting to set config '" << key << "' with incorrect type '" - << autowiring::demangle(typeid(T)) << "'"; - throw autowiring_error(ss.str()); - } + if (!s_registry.find(key)->second->verifyType(typeid(T))) + ThrowTypeMismatchException(key, typeid(T)); // Set value in this AutoConfigManager SetRecursive(key, AnySharedPointer(std::make_shared(value))); diff --git a/autowiring/AutoFilterDescriptor.h b/autowiring/AutoFilterDescriptor.h index 1ee3e8090..de46ed3ed 100644 --- a/autowiring/AutoFilterDescriptor.h +++ b/autowiring/AutoFilterDescriptor.h @@ -8,9 +8,6 @@ #include "has_autofilter.h" #include "is_shared_ptr.h" #include MEMORY_HEADER -#include FUNCTIONAL_HEADER -#include STL_UNORDERED_SET -#include STL_UNORDERED_MAP class AutoPacket; class Deferred; diff --git a/autowiring/AutoPacket.h b/autowiring/AutoPacket.h index 3ee4e218b..bfa02f9ab 100644 --- a/autowiring/AutoPacket.h +++ b/autowiring/AutoPacket.h @@ -6,20 +6,16 @@ #include "AutoCheckout.h" #include "DecorationDisposition.h" #include "demangle.h" -#include "hash_tuple.h" #include "is_any.h" #include "is_shared_ptr.h" -#include "MicroAutoFilter.h" -#include "ObjectPool.h" #include "TeardownNotifier.h" #include -#include #include #include CHRONO_HEADER #include MEMORY_HEADER #include TYPE_INDEX_HEADER #include STL_UNORDERED_MAP -#include EXCEPTION_PTR_HEADER +#include MUTEX_HEADER class AutoPacket; class AutoPacketInternal; @@ -176,6 +172,11 @@ class AutoPacket: /// std::list GetDispositions(const std::type_info& ti) const; + /// + /// Throws a formatted runtime error corresponding to the case where an absent decoration was demanded + /// + static void ThrowNotDecoratedException(const std::type_info& ti); + public: /// /// True if this packet posesses a decoration of the specified type @@ -198,12 +199,8 @@ class AutoPacket: static_assert(!std::is_same::value, "Oops!"); const T* retVal; - if(!Get(retVal)) { - std::stringstream ss; - ss << "Attempted to obtain a type " << autowiring::demangle(retVal) - << " which was not decorated on this packet"; - throw std::runtime_error(ss.str()); - } + if (!Get(retVal)) + ThrowNotDecoratedException(typeid(auto_id)); return *retVal; } diff --git a/autowiring/AutoPacketFactory.h b/autowiring/AutoPacketFactory.h index a29b7b66f..c5caf0fa5 100644 --- a/autowiring/AutoPacketFactory.h +++ b/autowiring/AutoPacketFactory.h @@ -1,20 +1,16 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include "Autowired.h" #include "AutoPacket.h" #include "AutoFilterDescriptor.h" #include "ContextMember.h" #include "CoreRunnable.h" +#include "TypeRegistry.h" #include -#include #include CHRONO_HEADER -#include TYPE_INDEX_HEADER #include TYPE_TRAITS_HEADER #include STL_UNORDERED_SET -struct AdjacencyEntry; class AutoPacketFactory; -class Deferred; class DispatchQueue; class AutoPacketInternal; @@ -33,9 +29,6 @@ class AutoPacketFactory: ~AutoPacketFactory(void); private: - // Parent packet factory, if one exists: - Autowired m_parent; - // Lock for this type mutable std::mutex m_lock; @@ -60,9 +53,6 @@ class AutoPacketFactory: // Returns the internal outstanding count, for use with AutoPacket std::shared_ptr GetInternalOutstanding(void); - // Recursive invalidation routine, causes AutoPacket object pools to be dumped to the root - void Invalidate(void); - // Utility override, does nothing void AddSubscriber(std::false_type) {} @@ -177,8 +167,7 @@ class AutoPacketFactory: // Extern explicit template instantiation declarations added to prevent // exterior instantation of internally used template instances -extern template class ObjectPool; -extern template class RegType; extern template struct SlotInformationStump; extern template const std::shared_ptr& SharedPointerSlot::as(void) const; extern template std::shared_ptr autowiring::fast_pointer_cast(const std::shared_ptr& Other); +extern template class RegType; diff --git a/autowiring/AutowirableSlot.h b/autowiring/AutowirableSlot.h index 62d60a2f0..25da379e3 100644 --- a/autowiring/AutowirableSlot.h +++ b/autowiring/AutowirableSlot.h @@ -125,8 +125,7 @@ class AutowirableSlot: typedef T value_type; AutowirableSlot(const std::shared_ptr& ctxt) : - DeferrableAutowiring(AnySharedPointerT(), ctxt), - m_fast_pointer_cast(&autowiring::fast_pointer_cast) + DeferrableAutowiring(AnySharedPointerT(), ctxt) { SlotInformationStackLocation::RegisterSlot(this); } @@ -135,8 +134,6 @@ class AutowirableSlot: CancelAutowiring(); } - std::shared_ptr(*const m_fast_pointer_cast)(const std::shared_ptr&); - /// /// Shadowing GetType call, provided here as a virtual function optimization /// @@ -144,9 +141,33 @@ class AutowirableSlot: return typeid(T); } - bool IsAutowired(void) const { return !!get(); } + bool IsAutowired(void) const { + // If the user wishes to know if this type is instantiated, we will require that a full definition + // of this type MUST be available. The reason for this is that, if the user wishes to know if a + // type is autowired, they are required at a minimum to know what that type's inheritance relations + // are to other types in the system. + (void) autowiring::fast_pointer_cast_initializer::sc_init; + return !!get(); + } + /// + /// Obtains a pointer to the underlying type, if autowired + /// T* get(void) const { + // For now, we require that the full type be available to use this method + (void) autowiring::fast_pointer_cast_initializer::sc_init; + return get_unsafe(); + } + + /// + /// Obtains a pointer to the underlying type, if autowired + /// + /// + /// Users are STRONGLY discouraged from making use of this routine. This function does not cause + /// any runtime type information about T to wind up in any of Autowiring's type registries, and + /// this may prevent the type from ever being detected as autowirable as a result. + /// + T* get_unsafe(void) const { return static_cast*>( static_cast( @@ -155,15 +176,23 @@ class AutowirableSlot: )->slot()->get().get(); } - T* operator->(void) const { - return get(); - } - explicit operator bool(void) const { return IsAutowired(); } + T* operator->(void) const { + // Initialize any blind fast casts to the actually desired type. This is one of a few points + // where we can guarantee that the type will be completely defined, because the user is about + // to make use of this type. + (void) autowiring::fast_pointer_cast_initializer::sc_init; + return get(); + } + T& operator*(void) const { + // We have to initialize here, in the operator context, because we don't actually know if the + // user will be making use of this type. + (void) autowiring::fast_pointer_cast_initializer::sc_init; + return *get(); } diff --git a/autowiring/Autowired.h b/autowiring/Autowired.h index f5c8f0887..9666ac099 100644 --- a/autowiring/Autowired.h +++ b/autowiring/Autowired.h @@ -250,8 +250,17 @@ class AutoRequired: }; /// -/// Similar to Autowired, but doesn't defer creation if types doesn't already exist +/// Provides restricted, non-blocking, and typically faster services than Autowired /// +/// +/// AutowiredFast allows queries to be conducted against contexts that may be in teardown, +/// and also generally operates with fewer memory allocations and better performance than +/// Autowired. As a drawback, notifications on AutowiredFast cannot be attached, and the +/// field will not be updated in the case of post-hoc satisfaction--the value is effectively +/// a constant after initialization. AutowiredFast also requires that the autowired type +/// be completely defined before construction. By comparison, Autowired fields do not ever +/// need to be defined. +/// template class AutowiredFast: public std::shared_ptr @@ -261,11 +270,15 @@ class AutowiredFast: // !!!!! Read comment in AutoRequired if you get a compiler error here !!!!! AutowiredFast(const std::shared_ptr& ctxt = CoreContext::CurrentContext()) { + (void) autowiring::fast_pointer_cast_initializer::sc_init; + if (ctxt) ctxt->FindByTypeRecursive(*this); } AutowiredFast(const CoreContext* pCtxt) { + (void) autowiring::fast_pointer_cast_initializer::sc_init; + pCtxt->FindByTypeRecursive(*this); } @@ -277,7 +290,7 @@ class AutowiredFast: return std::shared_ptr::get(); } - bool IsAutowired(void) const {return std::shared_ptr::get() != nullptr;} + bool IsAutowired(void) const { return std::shared_ptr::get() != nullptr; } }; /// @@ -372,9 +385,8 @@ template bool HasListeners(void) const { //TODO: Refactor this so it isn't messy //check: does it have any direct listeners, or are any appropriate marshalling objects wired into the immediate context? - auto ctxt = CoreContext::CurrentContext(); - bool checkval = ctxt->CheckEventOutputStream(); - return (checkval || (!m_junctionBox.expired() && m_junctionBox.lock()->HasListeners()) ); + auto junctionBox = m_junctionBox.lock(); + return junctionBox && junctionBox->HasListeners(); } template diff --git a/autowiring/BasicThread.h b/autowiring/BasicThread.h index 2a2eb6cfb..d371bbbd1 100644 --- a/autowiring/BasicThread.h +++ b/autowiring/BasicThread.h @@ -2,9 +2,10 @@ #pragma once #include "ContextMember.h" #include "CoreRunnable.h" +#include CHRONO_HEADER +#include FUNCTIONAL_HEADER #include MEMORY_HEADER #include MUTEX_HEADER -#include CHRONO_HEADER struct BasicThreadStateBlock; class BasicThread; diff --git a/autowiring/Bolt.h b/autowiring/Bolt.h index 9f9f14493..b6545b3d0 100644 --- a/autowiring/Bolt.h +++ b/autowiring/Bolt.h @@ -12,7 +12,6 @@ /// To create a class that will have a new instance inserted into each instance of a context /// with a given sigil, use Boltable. /// - template class Bolt: public BoltBase diff --git a/autowiring/BoltBase.h b/autowiring/BoltBase.h index 3da64cff0..4fa916175 100644 --- a/autowiring/BoltBase.h +++ b/autowiring/BoltBase.h @@ -1,6 +1,6 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include TYPE_INDEX_HEADER +#include class CoreContext; diff --git a/autowiring/C++11/boost_array.h b/autowiring/C++11/boost_array.h index fef78db9f..2b64adafa 100644 --- a/autowiring/C++11/boost_array.h +++ b/autowiring/C++11/boost_array.h @@ -1,8 +1,8 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include +#include namespace std { - using boost::array; + using autoboost::array; } diff --git a/autowiring/C++11/boost_atomic.h b/autowiring/C++11/boost_atomic.h index 3a6430a79..aaceeef1b 100644 --- a/autowiring/C++11/boost_atomic.h +++ b/autowiring/C++11/boost_atomic.h @@ -1,16 +1,16 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include +#include namespace std { - using boost::atomic; - using boost::atomic_flag; - using boost::memory_order_relaxed; - using boost::memory_order_consume; - using boost::memory_order_acquire; - using boost::memory_order_release; - using boost::memory_order_acq_rel; - using boost::memory_order_seq_cst; + using autoboost::atomic; + using autoboost::atomic_flag; + using autoboost::memory_order_relaxed; + using autoboost::memory_order_consume; + using autoboost::memory_order_acquire; + using autoboost::memory_order_release; + using autoboost::memory_order_acq_rel; + using autoboost::memory_order_seq_cst; #if !defined(ATOMIC_FLAG_INIT) #define ATOMIC_FLAG_INIT #endif diff --git a/autowiring/C++11/boost_chrono.h b/autowiring/C++11/boost_chrono.h index 778392abd..a797a6bd2 100644 --- a/autowiring/C++11/boost_chrono.h +++ b/autowiring/C++11/boost_chrono.h @@ -1,10 +1,10 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include +#include namespace std { namespace chrono { - using namespace boost::chrono; + using namespace autoboost::chrono; } } diff --git a/autowiring/C++11/boost_exception_ptr.h b/autowiring/C++11/boost_exception_ptr.h index aac4cc0ac..8503440bd 100644 --- a/autowiring/C++11/boost_exception_ptr.h +++ b/autowiring/C++11/boost_exception_ptr.h @@ -1,11 +1,11 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include +#include namespace std { - using boost::exception_ptr; - using boost::rethrow_exception; - using boost::current_exception; + using autoboost::exception_ptr; + using autoboost::rethrow_exception; + using autoboost::current_exception; } class throw_exception_util { diff --git a/autowiring/C++11/boost_functional.h b/autowiring/C++11/boost_functional.h index e734429af..43f268413 100644 --- a/autowiring/C++11/boost_functional.h +++ b/autowiring/C++11/boost_functional.h @@ -1,21 +1,21 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace std { - using boost::function; - using boost::ref; - using boost::detail::is_sorted; - using boost::bind; - using boost::result_of; + using autoboost::function; + using autoboost::ref; + using autoboost::detail::is_sorted; + using autoboost::bind; + using autoboost::result_of; namespace placeholders { - boost::lambda::placeholder1_type _1; - boost::lambda::placeholder2_type _2; - boost::lambda::placeholder3_type _3; + autoboost::lambda::placeholder1_type _1; + autoboost::lambda::placeholder2_type _2; + autoboost::lambda::placeholder3_type _3; } } diff --git a/autowiring/C++11/boost_future.h b/autowiring/C++11/boost_future.h index e235a759c..7c399081f 100644 --- a/autowiring/C++11/boost_future.h +++ b/autowiring/C++11/boost_future.h @@ -1,18 +1,14 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#if defined(BOOST_THREAD_FUTURE_HPP) && !defined(BOOST_THREAD_PROVIDES_FUTURE) - #error Define BOOST_THREAD_PROVIDES_FUTURE before including boost/thread -#endif - -#define BOOST_THREAD_PROVIDES_FUTURE -#include +#define AUTOBOOST_THREAD_PROVIDES_FUTURE +#include namespace std { - using AUTOWIRING_BOOST_NAME::future; - using AUTOWIRING_BOOST_NAME::future_status; - using AUTOWIRING_BOOST_NAME::promise; - using AUTOWIRING_BOOST_NAME::future_error; - using AUTOWIRING_BOOST_NAME::async; - using AUTOWIRING_BOOST_NAME::launch; + using autoboost::future; + using autoboost::future_status; + using autoboost::promise; + using autoboost::future_error; + using autoboost::async; + using autoboost::launch; } diff --git a/autowiring/C++11/boost_mutex.h b/autowiring/C++11/boost_mutex.h index dcbb7a6db..e8596c63e 100644 --- a/autowiring/C++11/boost_mutex.h +++ b/autowiring/C++11/boost_mutex.h @@ -1,21 +1,21 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace std { - using boost::mutex; - using boost::recursive_mutex; - using boost::lock_guard; - using boost::unique_lock; - using boost::condition_variable; - using boost::condition_variable_any; - using boost::cv_status; - using boost::once_flag; - using boost::call_once; + using autoboost::mutex; + using autoboost::recursive_mutex; + using autoboost::lock_guard; + using autoboost::unique_lock; + using autoboost::condition_variable; + using autoboost::condition_variable_any; + using autoboost::cv_status; + using autoboost::once_flag; + using autoboost::call_once; } diff --git a/autowiring/C++11/boost_rvalue.h b/autowiring/C++11/boost_rvalue.h index 553b34bc9..0fc026cf6 100644 --- a/autowiring/C++11/boost_rvalue.h +++ b/autowiring/C++11/boost_rvalue.h @@ -1,9 +1,9 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include +#include namespace std { - using boost::forward; - using boost::move; + using autoboost::forward; + using autoboost::move; } diff --git a/autowiring/C++11/boost_shared_ptr.h b/autowiring/C++11/boost_shared_ptr.h index a9500f63e..226b52cfd 100644 --- a/autowiring/C++11/boost_shared_ptr.h +++ b/autowiring/C++11/boost_shared_ptr.h @@ -1,26 +1,26 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -// We need to use the boost version of shared_ptr everywhere +// We need to use the autoboost version of shared_ptr everywhere // if it isn't provided by the framework #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #pragma GCC diagnostic pop -#include +#include namespace std { - using boost::shared_ptr; - using boost::weak_ptr; - using boost::enable_shared_from_this; - using boost::owner_less; + using autoboost::shared_ptr; + using autoboost::weak_ptr; + using autoboost::enable_shared_from_this; + using autoboost::owner_less; - using boost::const_pointer_cast; - using boost::static_pointer_cast; - using boost::dynamic_pointer_cast; - using boost::make_shared; + using autoboost::const_pointer_cast; + using autoboost::static_pointer_cast; + using autoboost::dynamic_pointer_cast; + using autoboost::make_shared; } diff --git a/autowiring/C++11/boost_system_error.h b/autowiring/C++11/boost_system_error.h index 412b42cbe..52421fbcb 100644 --- a/autowiring/C++11/boost_system_error.h +++ b/autowiring/C++11/boost_system_error.h @@ -1,13 +1,17 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include -#include +#include +#include namespace std { - using errc = boost::system::errc::errc_t; - using boost::system::error_category; - using boost::system::generic_category; - using boost::system::make_error_code; - using boost::system::system_error; + using autoboost::system::error_category; + using autoboost::system::generic_category; + using autoboost::system::system_error; + + using autoboost::system::is_error_code_enum; + + namespace errc { + using autoboost::system::errc::make_error_code; + } } diff --git a/autowiring/C++11/boost_thread.h b/autowiring/C++11/boost_thread.h index 92749bf9e..4f716caae 100644 --- a/autowiring/C++11/boost_thread.h +++ b/autowiring/C++11/boost_thread.h @@ -1,9 +1,9 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include +#include namespace std { - using boost::thread; - namespace this_thread = boost::this_thread; + using autoboost::thread; + namespace this_thread = autoboost::this_thread; } diff --git a/autowiring/C++11/boost_tuple.h b/autowiring/C++11/boost_tuple.h index 1a8319ecc..96cec9ccf 100644 --- a/autowiring/C++11/boost_tuple.h +++ b/autowiring/C++11/boost_tuple.h @@ -1,8 +1,8 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include -#include +#include +#include namespace std { template @@ -26,7 +26,7 @@ namespace std { return m_tuple < other.m_tuple; } - boost::tuple m_tuple; + autoboost::tuple m_tuple; }; template @@ -35,8 +35,8 @@ namespace std { } template - auto get(const ::std::tuple& tup) -> decltype(boost::get(tup.m_tuple)) { - return boost::get(tup.m_tuple); + auto get(const ::std::tuple& tup) -> decltype(autoboost::get(tup.m_tuple)) { + return autoboost::get(tup.m_tuple); } template diff --git a/autowiring/C++11/boost_type_traits.h b/autowiring/C++11/boost_type_traits.h index 7b1836b99..261f33248 100644 --- a/autowiring/C++11/boost_type_traits.h +++ b/autowiring/C++11/boost_type_traits.h @@ -1,45 +1,45 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace std { - using boost::conditional; - using boost::decay; - using boost::false_type; - using boost::has_trivial_constructor; - using boost::integral_constant; - using boost::is_abstract; - using boost::is_array; - using boost::is_class; - using boost::is_base_of; - using boost::is_const; - using boost::is_floating_point; - using boost::is_integral; - using boost::is_polymorphic; - using boost::is_same; - using boost::is_scalar; - using boost::remove_extent; - using boost::remove_reference; - using boost::true_type; - using boost::is_void; - using boost::is_convertible; + using autoboost::conditional; + using autoboost::decay; + using autoboost::false_type; + using autoboost::has_trivial_constructor; + using autoboost::integral_constant; + using autoboost::is_abstract; + using autoboost::is_array; + using autoboost::is_class; + using autoboost::is_base_of; + using autoboost::is_const; + using autoboost::is_floating_point; + using autoboost::is_integral; + using autoboost::is_polymorphic; + using autoboost::is_same; + using autoboost::is_scalar; + using autoboost::remove_extent; + using autoboost::remove_reference; + using autoboost::true_type; + using autoboost::is_void; + using autoboost::is_convertible; template struct enable_if {}; diff --git a/autowiring/C++11/boost_utility.h b/autowiring/C++11/boost_utility.h index c6862f5b5..f857de889 100644 --- a/autowiring/C++11/boost_utility.h +++ b/autowiring/C++11/boost_utility.h @@ -1,8 +1,8 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include +#include namespace std { - using boost::declval; + using autoboost::declval; } diff --git a/autowiring/C++11/cpp11.h b/autowiring/C++11/cpp11.h index 0c7e4ea4d..575cc33b8 100644 --- a/autowiring/C++11/cpp11.h +++ b/autowiring/C++11/cpp11.h @@ -15,13 +15,9 @@ #define STL11_ALLOWED 1 #endif -// If Autowiring is currently being built, we want to use the "autoboost" namespace in order to -// avoid requiring a dependency on Boost. -#ifdef AUTOWIRING_IS_BEING_BUILT - #define AUTOWIRING_BOOST_NAME autoboost -#else - #define AUTOWIRING_BOOST_NAME boost -#endif +// Deprecated macros, provided here until we can be sure that they aren't used downstream +#define throw_rethrowable throw +#define EXCEPTION_PTR_HEADER #define IS_CLANG defined(__clang_major__) #define CLANG_CHECK(maj, min) (__clang_major__ == maj && __clang_minor__ >= min || __clang_major__ > maj) @@ -94,16 +90,6 @@ #define AUTOWIRE_cxx_override_control 1 #endif -/********************* - * exception_ptr availability - *********************/ -#if (defined(__APPLE__) && !defined(_LIBCPP_VERSION)) - #define EXCEPTION_PTR_HEADER -#else - #define EXCEPTION_PTR_HEADER - #define throw_rethrowable throw -#endif - /********************* * system error availability *********************/ diff --git a/autowiring/C++11/memory_nostl11.h b/autowiring/C++11/memory_nostl11.h index 7cc352f51..395a69084 100644 --- a/autowiring/C++11/memory_nostl11.h +++ b/autowiring/C++11/memory_nostl11.h @@ -4,13 +4,14 @@ #include "boost_shared_ptr.h" #include "unique_ptr.h" #include "make_unique.h" - #include STL_UNORDERED_SET + template -struct std::hash> -: public std::hash +struct std::hash>: + public std::hash { - std::size_t - operator()(const std::shared_ptr& __p) const - { return std::hash::operator()(__p.get()); } + std::size_t operator()(const std::shared_ptr& __p) const + { + return std::hash::operator()(__p.get()); + } }; diff --git a/autowiring/C++11/unique_ptr.h b/autowiring/C++11/unique_ptr.h index 9193a58e9..9f9afdb4b 100644 --- a/autowiring/C++11/unique_ptr.h +++ b/autowiring/C++11/unique_ptr.h @@ -1,7 +1,7 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include +#include namespace std { @@ -30,7 +30,7 @@ class unique_ptr { { } - unique_ptr(pointer _Ptr, typename boost::remove_reference::type&& _Deleter) : + unique_ptr(pointer _Ptr, typename autoboost::remove_reference::type&& _Deleter) : stored_ptr(_Ptr), stored_deleter(_Deleter) {} diff --git a/autowiring/CallExtractor.h b/autowiring/CallExtractor.h index 28e867b4f..316af94b6 100644 --- a/autowiring/CallExtractor.h +++ b/autowiring/CallExtractor.h @@ -3,6 +3,7 @@ #include "auto_arg.h" #include "AutoPacket.h" #include "Decompose.h" +#include class Deferred; diff --git a/autowiring/ConfigRegistry.h b/autowiring/ConfigRegistry.h index 4d5799748..35eb173ab 100644 --- a/autowiring/ConfigRegistry.h +++ b/autowiring/ConfigRegistry.h @@ -1,13 +1,12 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once +#include "AnySharedPointer.h" +#include "autowiring_error.h" +#include "has_validate.h" #include MEMORY_HEADER #include FUNCTIONAL_HEADER #include #include -#include "AnySharedPointer.h" -#include "autowiring_error.h" -#include "demangle.h" -#include "has_validate.h" // Check if 'T' has a valid stream conversion operator template @@ -67,6 +66,10 @@ struct ConfigRegistryEntry { template struct ConfigTypeExtractor {}; +namespace autowiring { + void ThrowFailedTypeParseException(const std::string& str, const std::type_info& ti); +} + template struct ConfigRegistryEntryT: public ConfigRegistryEntry @@ -88,6 +91,7 @@ struct ConfigRegistryEntryT: return parseInternal(str); } +public: // Only use if there is a stream operator template typename std::enable_if::value, AnySharedPointer>::type @@ -96,12 +100,8 @@ struct ConfigRegistryEntryT: T val; ss >> std::boolalpha >> val; - if (ss.fail()) { - std::stringstream msg; - msg << "Failed to parse '" << str << "' as type '" - << autowiring::demangle(typeid(T)) << "'"; - throw autowiring_error(msg.str()); - } + if (ss.fail()) + autowiring::ThrowFailedTypeParseException(str, typeid(T)); return AnySharedPointer(std::make_shared(val)); } @@ -109,8 +109,7 @@ struct ConfigRegistryEntryT: template typename std::enable_if::value, AnySharedPointer>::type parseInternal(const std::string&) const { - throw autowiring_error("This type doesn't support stream conversions.\ - Define one if you want this to be parsable"); + throw autowiring_error("This type doesn't support stream conversions. Define one if you want this to be parsable"); }; std::function validator(void) const override { diff --git a/autowiring/ContextMap.h b/autowiring/ContextMap.h index 866be422f..14ec2dce4 100644 --- a/autowiring/ContextMap.h +++ b/autowiring/ContextMap.h @@ -84,7 +84,7 @@ class ContextMap std::lock_guard lk(m_lk); auto& rhs = m_contexts[key]; if(!rhs.expired()) - throw_rethrowable autowiring_error("Specified key is already associated with another context"); + throw autowiring_error("Specified key is already associated with another context"); rhs = context; diff --git a/autowiring/CoreContext.h b/autowiring/CoreContext.h index 2c5ab10d2..b8f2d70d4 100644 --- a/autowiring/CoreContext.h +++ b/autowiring/CoreContext.h @@ -6,14 +6,10 @@ #include "AutowiringEvents.h" #include "autowiring_error.h" #include "Bolt.h" -#include "CoreContextStateBlock.h" #include "CoreRunnable.h" #include "ContextMember.h" #include "CreationRules.h" #include "CurrentContextPusher.h" -#include "EventOutputStream.h" -#include "EventInputStream.h" -#include "EventRegistry.h" #include "ExceptionFilter.h" #include "fast_pointer_cast.h" #include "has_autoinit.h" @@ -28,17 +24,15 @@ #include #include MEMORY_HEADER -#include FUNCTIONAL_HEADER #include TYPE_INDEX_HEADER #include STL_UNORDERED_MAP -#include STL_UNORDERED_SET +struct CoreContextStateBlock; class AutoInjectable; -class DeferrableAutowiring; class BasicThread; class BoltBase; class CoreContext; -class EventOutputStreamBase; +class DeferrableAutowiring; class GlobalCoreContext; class JunctionBoxBase; class OutstandingCountTracker; @@ -400,7 +394,7 @@ class CoreContext: template void AddTeardownListener2(Fx&& fx, void (Fx::*)(const CoreContext&)) { TeardownNotifier::AddTeardownListener([fx, this] () mutable { fx(*this); }); } template - void AddTeardownListener2(Fx&& fx, void (Fx::*)(void) const) { TeardownNotifier::AddTeardownListener(fx); } + void AddTeardownListener2(Fx&& fx, void (Fx::*)(void) const) { TeardownNotifier::AddTeardownListener(std::forward(fx)); } template void AddTeardownListener2(Fx&& fx, void (Fx::*)(const CoreContext&) const) { TeardownNotifier::AddTeardownListener([fx, this] () mutable { fx(*this); }); } @@ -518,8 +512,10 @@ class CoreContext: // Creator proxy, knows how to create the type we intend to inject typedef autowiring::CreationRules CreationRules; - // Add this type to the TypeRegistry + // Add this type to the TypeRegistry, also ensure that we initialize support for blind + // fast pointer cast to Object. (void) RegType::r; + (void) autowiring::fast_pointer_cast_initializer::sc_init; // First see if the base object type has already been injected. This is also necessary to // ensure that a memo slot is created for the type by itself, in cases where the injected @@ -553,8 +549,9 @@ class CoreContext: FindByType(retVal); } - // Factory registration if sensible to do so, but only after the underlying type has been - // added, so that the proper type can succeed + // Factory registration if sensible to do so, but only after the underlying type has been added + // This ensures that any creation operations that happen as a consequence of factory registration + // can correctly back-reference the factory proper via autowiring RegisterFactory(*retVal, autowiring::member_new_type()); return std::static_pointer_cast(retVal); } @@ -566,22 +563,20 @@ class CoreContext: static void InjectCurrent(void) { CurrentContext()->Inject(); } + + /// + /// True if the specified type can be autowired in this context + /// + template + bool Has(void) const { + std::shared_ptr ptr; + FindByType(ptr); + return ptr != nullptr; + } template std::shared_ptr DEPRECATED(Construct(Args&&... args), "'Construct' is deprecated, use 'Inject' instead"); - /// - /// This method checks whether eventoutputstream listeners for the given type still exist. - /// For a given type in a hash, returns a vector of weak ptrs. - /// Goes through the weak ptrs, locks them, erases dead ones. - /// If any live ones found return true. Otherwise false. - /// NOTE: this func does lazy cleanup on weakptrs ptng to suff that has fallen out of scope. - /// - template - bool CheckEventOutputStream(void){ - return m_junctionBoxManager->CheckEventOutputStream(typeid(T)); - } - /// /// Sends AutowiringEvents to build current state /// @@ -965,24 +960,6 @@ class CoreContext: /// Utility debug method for writing a snapshot of this context to the specified output stream /// void Dump(std::ostream& os) const; - - /// - /// Utility routine to print information about the current exception - /// - static void DebugPrintCurrentExceptionInformation(); - - /// - /// Creates a new event stream based on the provided event type - /// - template - std::shared_ptr> CreateEventOutputStream(void) { - return m_junctionBoxManager->CreateEventOutputStream(); - } - - template - std::shared_ptr> CreateEventInputStream(void) { - return std::make_shared>(); - } }; /// @@ -1067,6 +1044,12 @@ class CoreContext::AutoFactoryFn, Fn> : template T* autowiring::crh::New(CoreContext& ctxt, Args&&... args) { + // We need to ensure that we can perform a find-by-type cast correctly, so + // the dynamic caster entry is added to the registry + (void) autowiring::fast_pointer_cast_initializer>::sc_init; + (void) autowiring::fast_pointer_cast_initializer, Object>::sc_init; + + // Now we can go looking for this type: AnySharedPointerT> af; ctxt.FindByType(af); if(!af) diff --git a/autowiring/CoreRunnable.h b/autowiring/CoreRunnable.h index 2ca0f5761..3cc35a520 100644 --- a/autowiring/CoreRunnable.h +++ b/autowiring/CoreRunnable.h @@ -2,6 +2,7 @@ #pragma once #include MEMORY_HEADER #include MUTEX_HEADER +#include CHRONO_HEADER class Object; diff --git a/autowiring/CreationRules.h b/autowiring/CreationRules.h index 21e564d7f..8c7e3c871 100644 --- a/autowiring/CreationRules.h +++ b/autowiring/CreationRules.h @@ -1,13 +1,11 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include "autowiring_error.h" -#include "ContextMember.h" #include "has_simple_constructor.h" #include "has_static_new.h" #include "SlotInformation.h" -#include TYPE_TRAITS_HEADER #include RVALUE_HEADER -#include + +class CoreContext; template struct is_injectable diff --git a/autowiring/Decompose.h b/autowiring/Decompose.h index a75540ba5..0986491c8 100644 --- a/autowiring/Decompose.h +++ b/autowiring/Decompose.h @@ -1,6 +1,5 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include TYPE_TRAITS_HEADER #include template diff --git a/autowiring/Deferred.h b/autowiring/Deferred.h index b2f9e5df4..76edd4858 100644 --- a/autowiring/Deferred.h +++ b/autowiring/Deferred.h @@ -1,6 +1,5 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include class CoreThread; @@ -19,18 +18,3 @@ class Deferred { Deferred(CoreThread* pThread) {} }; - -/// -/// Utility type which asserts when construction is attempted -/// -/// -/// Any consumer who attempts to invoke a deferred -/// -class FatalDeferredInvocation: - public Deferred -{ -public: - FatalDeferredInvocation(void) { - assert(false); - } -}; diff --git a/autowiring/DispatchThunk.h b/autowiring/DispatchThunk.h index 7718962ac..1f0956fb3 100644 --- a/autowiring/DispatchThunk.h +++ b/autowiring/DispatchThunk.h @@ -1,7 +1,7 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once +#include #include CHRONO_HEADER -#include UTILITY_HEADER /// /// A simple virtual class used to hold a trivial thunk diff --git a/autowiring/EventInputStream.h b/autowiring/EventInputStream.h deleted file mode 100644 index bc283b2cd..000000000 --- a/autowiring/EventInputStream.h +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. -#pragma once -#include "Decompose.h" -#include "Deserialize.h" -#include "index_tuple.h" -#include -#include -#include -#include -#include MEMORY_HEADER -#include TYPE_TRAITS_HEADER - -#ifndef EnableIdentity -#define EnableIdentity(x) SpecialAssign (#x) -#endif - -template -class AutoFired; - -/// -/// Wrap up memfns as shared_ptrs to ExpressionBase-derived classes. Call func = call wrapped event firing. -/// -struct ExpressionBase{ - virtual void DeserializeAndForward(std::deque &) = 0; -}; - -template -struct Expression; - -template -struct Expression: public ExpressionBase -{ - typedef R(W::*memType)(ToBindArgs...); - memType m_memfunc; - Expression(memType m){ m_memfunc = m; } - - /// - /// This function deserializes exactly as many arguments from the - /// argument dequeue as the length of the type pack ToBindArgs by using - /// parameter pack expansion. - /// - void DeserializeAndForward(std::deque & d){ - DeserializeAndForward(d, typename make_index_tuple::type()); - } - - template - void DeserializeAndForward(std::deque & d, index_tuple){ - auto it = d.begin(); - AutoFired sender; - sender(m_memfunc)(autowiring::deser::deserialize(it[I])...); - } -}; - -/// -/// Allows the deserialization of events from an output stream, in order to replay them in-process -/// -template -class EventInputStream { -public: - EventInputStream(){} - - /// - /// Returns true if memfn is enabled, otherwise false. - /// - bool IsEnabled(std::string str) { - return !(m_EventMap.find(str) == m_EventMap.end()); - } - - /// - /// Enables a new event for deserialization via its identity - /// - template - void SpecialAssign(std::string str) { - // We cannot serialize an identity we don't recognize - static_assert(std::is_same::type, T>::value, "Cannot add a member function unrelated to the output type for this class"); - if (!IsEnabled(str)) - { - std::shared_ptr ptr = std::make_shared >(eventIden); - m_EventMap[str] = ptr; - } - } - - /// - /// Interprets and fires a SINGLE EVENT from the passed input buffer - /// - /// - /// The number of bytes processed from the input buffer - /// - size_t FireSingle(const void* pData, size_t dataSize) const { - //First wrap all the bytes in a string. - auto chptr = (const char *)pData; - std::string MyString(chptr); - - std::size_t location = MyString.find("\xDE"); - std::string topevent = MyString.substr(0, location); - - std::deque d; - std::istringstream buf(topevent); - - std::string s; - while(std::getline(buf, s, '\xD8')) - d.push_back(s); - - std::string query = d[0]; - d.pop_front(); // Now a list of arguments - - auto find1 = m_EventMap.find(query); - if (find1 != m_EventMap.end()) - { - auto evt = find1 -> second; - evt->DeserializeAndForward(d); - } - return location + 1; - } - -private: - std::map > m_EventMap; -}; \ No newline at end of file diff --git a/autowiring/EventOutputStream.h b/autowiring/EventOutputStream.h deleted file mode 100644 index 8fbe1d9de..000000000 --- a/autowiring/EventOutputStream.h +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. -#pragma once -#include "Decompose.h" -#include "Deserialize.h" -#include -#include -#include -#include - -#include MEMORY_HEADER -#include TYPE_TRAITS_HEADER - -#ifndef EnableIdentity -#define EnableIdentity(x) SpecialAssign (#x) -#endif - -class EventOutputStreamBase { -private: - std::stringstream m_OutputStream; -public: - - EventOutputStreamBase(void); - virtual ~EventOutputStreamBase(void); - - /// - /// True if this stream has no events in it - /// - bool IsEmpty(void) const; - - /// - /// The number of bytes currently stored in the output stream - /// - size_t GetSize(void) const; - - /// - /// A pointer to the first byte of data stored in this output stream - /// - const void* GetData(void) const; - - /// - /// Resets the output stream, preparing it for new writes. Does not release or reallocate memory. - /// - void Reset(void); - - /// - /// Converts member functions to their string representation for serialization. - /// - template - std::string AddAndQueryMemFn(MemFn memfn, std::string str = "Query") - { - std::map local; - static std::map my_map = local; - if(str == "Query") - { - for(const auto& entry : my_map) { - if((entry.second) == memfn) return entry.first; - } - return ""; - } - my_map[str] = memfn; - return ""; - } - - template - //SFINAE STUB OUT: replace with check_if overloads << - typename std::enable_if< std::is_same const *>::value, void >::type - SerializeMethod(Arg & arg){ - m_OutputStream << "\xD8" << *arg; - } - - template - //stub out such that if ARGUMENT defines a static method called AutoSerialize which returns an std::string, - typename std::enable_if::value, void >::type - SerializeMethod(Arg & arg){ - m_OutputStream << "\xD8" << arg.AutoSerialize(); - } - - template - //SFINAE STUB OUT: replace with check_if overloads << - typename std::enable_if< - !std::is_same const *>::value && - !std::is_base_of::value, - void>::type - SerializeMethod(Arg1 & arg1){ - assert(false); - //static_assert(false, "Fundamental belief about serialized argument types violated"); - } - - - /// - /// Comment. - /// - template - void EmitHeader(MemFn eventIden){ - m_OutputStream << AddAndQueryMemFn(eventIden); - } - - /// - /// Comment. - /// - void EmitFooter(void){ - m_OutputStream << "\xDE"; - } - - /// - /// Recursive serialize message: base case - /// - template - void Serialize2(Targs&... args){ - } - - /// - /// Recursive serialize message: N-args case - /// - template - void Serialize2(Head &value, Targs&... args){ - //Emit an arg - SerializeMethod(value); - //m_OutputStream << "\xD8" << *value; - Serialize2(args...); - } - - template - void SerializeInit(Memfn memfn, Targs&... args){ - EmitHeader(memfn); - Serialize2( args...); - EmitFooter(); - } - - template - void SerializeInit(Memfn memfn, Head &value, Targs&... args){ - EmitHeader(memfn); - Serialize2(value, args...); - EmitFooter(); - } - - - // See here: http://stackoverflow.com/questions/257288/is-it-possible-to-write-a-c-template-to-check-for-a-functions-existence - - /// - /// Returns true if memfn is enabled, otherwise false. - /// - template - bool IsEnabled(MemFn eventIden, bool amIRegistered = false) { - static int registration = 0; //first time func is checked - if (amIRegistered && registration < 1){ - registration++; - } - return (!!registration); - } - -}; - -/// -/// An output stream, which represents marshalled output from an event type in a context -/// -template -class EventOutputStream: - public EventOutputStreamBase -{ -private: - typedef void (T::*fnPtr)(std::string); - std::map m_oneArgsMap; -public: - EventOutputStream(){} - ~EventOutputStream(){} - void New(){} - - /// - /// Enables a new event for serialization via its identity - /// - template - void SpecialAssign(std::string str) { - // We cannot serialize an identity we don't recognize - static_assert(std::is_same::type, T>::value, "Cannot add a member function unrelated to the output type for this class"); - if (!IsEnabled(eventIden)) - { - IsEnabled(eventIden, true); - AddAndQueryMemFn(eventIden, str); - } - } -}; \ No newline at end of file diff --git a/autowiring/ExceptionFilter.h b/autowiring/ExceptionFilter.h index de3af8cd1..983445d4c 100644 --- a/autowiring/ExceptionFilter.h +++ b/autowiring/ExceptionFilter.h @@ -1,6 +1,5 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include FUNCTIONAL_HEADER class JunctionBoxBase; class Object; diff --git a/autowiring/InvokeRelay.h b/autowiring/InvokeRelay.h index 535095c19..8c1a900d4 100644 --- a/autowiring/InvokeRelay.h +++ b/autowiring/InvokeRelay.h @@ -123,9 +123,6 @@ class InvokeRelay { // Context not yet started return true; - // Give the serializer a chance to handle these arguments: - erp->SerializeInit(fnPtr, args...); - auto fw = [this](T& obj, Args... args) { (obj.*fnPtr)(args...); }; diff --git a/autowiring/JunctionBox.h b/autowiring/JunctionBox.h index e3078f5bd..dee369898 100644 --- a/autowiring/JunctionBox.h +++ b/autowiring/JunctionBox.h @@ -2,18 +2,13 @@ #pragma once #include "DispatchQueue.h" #include "DispatchThunk.h" -#include "EventOutputStream.h" -#include "EventInputStream.h" #include "fast_pointer_cast.h" #include "InvokeRelay.h" #include "JunctionBoxBase.h" #include "JunctionBoxEntry.h" #include "TypeUnifier.h" #include -#include STL_TUPLE_HEADER -#include RVALUE_HEADER #include MEMORY_HEADER -#include STL_UNORDERED_SET #include TYPE_TRAITS_HEADER class CoreContext; @@ -49,30 +44,6 @@ class JunctionBox: volatile int m_numberOfDeletions; public: - /// - /// Recursive serialize message: Initial Processing- n arg case - /// - template - void SerializeInit(Memfn memfn, Targs&... args) { - //First distribute the arguments to any listening serializers in current context - if (m_PotentialMarshals){ - auto m_vector = *m_PotentialMarshals; - auto it = m_vector.begin(); - - while (it != m_vector.end()){ - auto testptr = (*it).lock(); - if (testptr) { - //if given eventid is enabled for given eventoutputstream, serialize! - if (testptr->IsEnabled(memfn)) - testptr->SerializeInit(memfn, args...); - ++it; - } - else - it = m_vector.erase(it); //opportunistically kill dead references. - } - } - } - /// /// Convenience method allowing consumers to quickly determine whether any listeners exist /// @@ -135,18 +106,21 @@ class JunctionBox: std::unique_lock lk(m_lock); int deleteCount = m_numberOfDeletions; - // Set of contexts that need to be torn down in the event of an exception: - std::vector> teardown; + // Collection of contexts that need to be torn down in the event of an exception. Using a list, + // here, instead of a vector because this list is expected to almost always be empty, and we can + // avoid having to include by using a list instead. + std::list> teardown; - for(auto it = m_st.begin(); it != m_st.end(); ){ + for (auto it = m_st.begin(); it != m_st.end();){ JunctionBoxEntry currentEvent(*it); lk.unlock(); try { fn(*currentEvent.m_ptr, args...); - } catch(...) { + } + catch (...) { teardown.push_back(ContextDumbToWeak(currentEvent.m_owner)); - + // If T doesn't inherit Object, then we need to cast to a unifying type which does typedef typename SelectTypeUnifier::type TActual; this->FilterFiringException(autowiring::fast_pointer_cast(currentEvent.m_ptr)); @@ -156,12 +130,13 @@ class JunctionBox: // Increment iterator correctly even if it's been invalidated if (deleteCount == m_numberOfDeletions){ ++it; - } else { + } + else { it = m_st.upper_bound(currentEvent); deleteCount = m_numberOfDeletions; } } - if(teardown.empty()) + if (teardown.empty()) // Nobody threw any exceptions, end here return true; diff --git a/autowiring/JunctionBoxBase.h b/autowiring/JunctionBoxBase.h index c61e72a86..0c94bcdb3 100644 --- a/autowiring/JunctionBoxBase.h +++ b/autowiring/JunctionBoxBase.h @@ -1,14 +1,13 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include #include "Object.h" +#include #include MUTEX_HEADER #include MEMORY_HEADER #include STL_UNORDERED_SET class CoreContext; class DispatchQueue; -class EventOutputStreamBase; template struct JunctionBoxEntry; @@ -38,7 +37,7 @@ class JunctionBoxBase { /// /// Invokes SignalTerminate on each context in the specified vector. Does not wait. /// - static void TerminateAll(const std::vector>& teardown); + static void TerminateAll(const std::list>& teardown); /// /// Convenience routine for Fire calls @@ -61,13 +60,6 @@ class JunctionBoxBase { bool IsInitiated(void) const {return m_isInitiated;} void Initiate(void) {m_isInitiated=true;} - // Accessor methods: - std::vector > * m_PotentialMarshals; - - void SetPotentialMarshals(std::vector> * inVec){ - m_PotentialMarshals = inVec; - } - const std::unordered_set GetDispatchQueue(void) const { return m_dispatch; } std::mutex& GetDispatchQueueLock(void) const { return m_lock; } diff --git a/autowiring/JunctionBoxEntry.h b/autowiring/JunctionBoxEntry.h index d5144fe63..fa6886bd5 100644 --- a/autowiring/JunctionBoxEntry.h +++ b/autowiring/JunctionBoxEntry.h @@ -30,7 +30,6 @@ struct JunctionBoxEntry: JunctionBoxEntry& operator=(const JunctionBoxEntry& rhs) { // This shouldn't be used. non-c++11 containers require this... throw std::runtime_error("Can't copy a JunctionBoxEntry"); - return *this; } bool operator==(const JunctionBoxEntry& rhs) const { diff --git a/autowiring/JunctionBoxManager.h b/autowiring/JunctionBoxManager.h index 7647ec854..b119a8327 100644 --- a/autowiring/JunctionBoxManager.h +++ b/autowiring/JunctionBoxManager.h @@ -2,23 +2,12 @@ #pragma once #include "JunctionBoxBase.h" #include "JunctionBoxEntry.h" -#include "uuid.h" -#include -#include -#include -#include #include TYPE_INDEX_HEADER #include MEMORY_HEADER #include STL_UNORDERED_MAP -#include TYPE_TRAITS_HEADER -class EventOutputStreamBase; class CoreContext; class JunctionBoxBase; -class OutputStreamVector; - -template -class EventOutputStream; /// /// General manager class of all junction boxes defined in some context @@ -41,38 +30,7 @@ class JunctionBoxManager { void AddEventReceiver(JunctionBoxEntry receiver); void RemoveEventReceiver(JunctionBoxEntry pRecvr); - /// - /// This method checks whether eventoutputstream listeners for the given type still exist. - /// For a given type in a hash, returns a vector of weak ptrs. - /// Goes through the weak ptrs, locks them, erases dead ones. - /// If any live ones found return true. Otherwise false. - /// NOTE: this func does lazy cleanup on weakptrs ptng to suff that has fallen out of scope. - /// - bool CheckEventOutputStream(const std::type_index& type); - - /// - /// Adds the named eventoutputstream to the collection of known eventoutputstreams - /// - void AddEventOutputStream(const std::type_index& type, std::weak_ptr pRecvr); - - /// - /// Creates a new event stream based on the provided event type - /// - template - std::shared_ptr> CreateEventOutputStream(void) { - static_assert(uuid_of::value, "Cannot create an output stream on type T, the type was not defined with DECLARE_UUID"); - auto retval = std::make_shared>(); - auto upcastptr = static_cast>(retval); - std::weak_ptr weakStreamPtr = upcastptr; - AddEventOutputStream(typeid(T), weakStreamPtr); - return retval; - } - - protected: - // All EventOutputStreams objects known to this JunctionBoxManager: - std::map>> m_eventOutputStreams; - // All junction boxes known by this manager: typedef std::unordered_map> t_junctionBoxes; t_junctionBoxes m_junctionBoxes; diff --git a/autowiring/ObjectTraits.h b/autowiring/ObjectTraits.h index d690a392e..c2a1767d4 100644 --- a/autowiring/ObjectTraits.h +++ b/autowiring/ObjectTraits.h @@ -43,7 +43,13 @@ struct ObjectTraits { return false; }() ) - {} + { + // We can instantiate casts to Object here at the point where object traits are being generated + (void) autowiring::fast_pointer_cast_initializer::sc_init; + (void) autowiring::fast_pointer_cast_initializer::sc_init; + (void) autowiring::fast_pointer_cast_initializer::sc_init; + (void) autowiring::fast_pointer_cast_initializer::sc_init; + } // The type of the passed pointer const std::type_info& type; diff --git a/autowiring/SatCounter.h b/autowiring/SatCounter.h index 250e6db95..8d92c8d96 100644 --- a/autowiring/SatCounter.h +++ b/autowiring/SatCounter.h @@ -3,7 +3,6 @@ #include "AnySharedPointer.h" #include "AutoFilterDescriptor.h" #include "demangle.h" -#include /// /// A single subscription counter entry @@ -19,7 +18,7 @@ struct SatCounter: SatCounter(const AutoFilterDescriptor& source): AutoFilterDescriptor(source), called(false), - remaining(0) + remaining(m_requiredCount) {} SatCounter(const SatCounter& source): @@ -28,40 +27,29 @@ struct SatCounter: remaining(source.remaining) {} - SatCounter& operator = (const SatCounter& source) { - AutoFilterDescriptor::operator = (source); - called = source.called; - remaining = source.remaining; - return *this; - } - // The number of times the AutoFilter is called bool called; // The number of inputs remaining to this counter: size_t remaining; +private: + /// + /// Throws a formatted exception if the underlying filter is called more than once + /// + void ThrowRepeatedCallException(void) const; + +public: /// /// Calls the underlying AutoFilter method with the specified AutoPacketAdapter as input /// void CallAutoFilter(AutoPacket& packet) { - if (called) { - std::stringstream ss; - ss << "Repeated call to " << autowiring::demangle(m_pType); - throw std::runtime_error(ss.str()); - } + if (called) + ThrowRepeatedCallException(); called = true; GetCall()(GetAutoFilter(), packet); } - /// - /// Resets the remaining counter to its initial value - /// - void Reset(void) { - called = false; - remaining = m_requiredCount; - } - /// /// Conditionally decrements AutoFilter argument satisfaction. /// diff --git a/autowiring/SharedPointerSlot.h b/autowiring/SharedPointerSlot.h index e0b71f5e8..08dcb85cc 100644 --- a/autowiring/SharedPointerSlot.h +++ b/autowiring/SharedPointerSlot.h @@ -346,7 +346,7 @@ struct SharedPointerSlotT: bool try_assign(const std::shared_ptr& rhs) override { // Just perform a dynamic cast: - auto casted = autowiring::fast_pointer_cast(rhs); + auto casted = autowiring::fast_pointer_cast_blind::cast(rhs); if (!casted) return false; @@ -355,7 +355,7 @@ struct SharedPointerSlotT: } virtual operator std::shared_ptr(void) const override { - return autowiring::fast_pointer_cast(SharedPointerSlotT::get()); + return autowiring::fast_pointer_cast_blind::cast(SharedPointerSlotT::get()); } using SharedPointerSlotT::operator=; diff --git a/autowiring/TeardownNotifier.h b/autowiring/TeardownNotifier.h index fd422a824..4d44bff51 100644 --- a/autowiring/TeardownNotifier.h +++ b/autowiring/TeardownNotifier.h @@ -1,8 +1,6 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include "C++11/cpp11.h" -#include -#include FUNCTIONAL_HEADER +#include RVALUE_HEADER /// /// Maintains a list of lambdas to be invoked when the enclosing object is being destroyed @@ -10,11 +8,37 @@ class TeardownNotifier { public: + TeardownNotifier(void); ~TeardownNotifier(void); protected: + struct EntryBase + { + public: + EntryBase(void): + pFlink(nullptr) + {} + virtual ~EntryBase(void) {} + virtual void operator()(void) = 0; + + EntryBase* pFlink; + }; + + template + struct Entry: + EntryBase + { + Entry(Fx&& fx): + fx(std::forward(fx)) + {} + + Fx fx; + + void operator()(void) override { fx(); } + }; + // Teardown listeners, invoked in sequence when the context is tearing down - std::list> m_teardownListeners; + EntryBase* m_pFirstTeardownListener; /// /// May be invoked prospectively by a derived instance to prematurely notify teardown listeners @@ -31,6 +55,11 @@ class TeardownNotifier /// void NotifyTeardownListeners(void); + /// + /// Runtime version of AddTeardownListener + /// + void AddTeardownListenerInternal(EntryBase* listener); + public: /// /// Registers the passed listener to be called when teardown is occurring for this object @@ -46,5 +75,8 @@ class TeardownNotifier /// destructor. Unless otherwise stated by the object in question, however, the object should be /// treated as invalid at the time of notification. /// - void AddTeardownListener(const std::function& listener); + template + void AddTeardownListener(Fx&& listener) { + AddTeardownListenerInternal(new Entry(std::forward(listener))); + } }; diff --git a/autowiring/ThreadStatusBlock.h b/autowiring/ThreadStatusBlock.h deleted file mode 100644 index 558e817bf..000000000 --- a/autowiring/ThreadStatusBlock.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. -#pragma once -#include -#include MEMORY_HEADER - -class CoreContext; - -/// -/// Represents a status block for the current thread -/// -class ThreadStatusBlock -{ -protected: - ThreadStatusBlock(void); - -public: - ~ThreadStatusBlock(void); - - /// - /// The status block for the calling thread - /// - static ThreadStatusBlock* Get(void); - - struct CurrentSpace { - void* pSpace; - size_t nBytes; - - bool Contains(const void* ptr) const { - return pSpace <= ptr && ptr < ((char*) pSpace + nBytes); - } - }; - - // Constructive object stack. The top of the stack denotes the object that is - // currently being constructed. This is useful to obtain information about the - // slots that a ContextMember contains, and whether an Autowired field is a - // candidate for deferred satisfaction. - std::vector m_spaces; - - // The currently active context for this thread: - std::shared_ptr m_context; -}; diff --git a/autowiring/TypeIdentifier.h b/autowiring/TypeIdentifier.h index 403bb6790..53a3a33ac 100644 --- a/autowiring/TypeIdentifier.h +++ b/autowiring/TypeIdentifier.h @@ -1,7 +1,7 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include TYPE_INDEX_HEADER #include "Object.h" +#include // Checks if an Object* listens to a event T; struct TypeIdentifierBase { diff --git a/autowiring/TypeRegistry.h b/autowiring/TypeRegistry.h index 64e6904ac..a7c31fb9b 100644 --- a/autowiring/TypeRegistry.h +++ b/autowiring/TypeRegistry.h @@ -1,8 +1,8 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once +#include "autowiring_error.h" #include "CreationRules.h" #include "TypeIdentifier.h" -#include STL_TUPLE_HEADER #include MEMORY_HEADER namespace autowiring { @@ -99,3 +99,4 @@ class RegType template const TypeRegistryEntryT RegType::r; + diff --git a/autowiring/TypeUnifier.h b/autowiring/TypeUnifier.h index 709cb2d53..0cb86c219 100644 --- a/autowiring/TypeUnifier.h +++ b/autowiring/TypeUnifier.h @@ -1,7 +1,6 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once #include "has_autofilter.h" -#include "has_simple_constructor.h" #include "Object.h" #include RVALUE_HEADER diff --git a/autowiring/at_exit.h b/autowiring/at_exit.h index 9f76de8e4..1248c7409 100644 --- a/autowiring/at_exit.h +++ b/autowiring/at_exit.h @@ -5,7 +5,7 @@ template struct AtExit { AtExit(Fn&& fn) : - fn(std::move(fn)) + fn(std::forward(fn)) {} ~AtExit(void) { @@ -17,5 +17,5 @@ struct AtExit { template AtExit MakeAtExit(Fn&& fn) { - return AtExit(std::forward(fn)); + return AtExit(std::forward(fn)); } diff --git a/autowiring/demangle.h b/autowiring/demangle.h index 2b565b91b..3aeedf355 100644 --- a/autowiring/demangle.h +++ b/autowiring/demangle.h @@ -1,13 +1,7 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include TYPE_INDEX_HEADER #include - -#if __GNUG__ // Mac and linux -#include -#include -#include MEMORY_HEADER -#endif +#include struct AnySharedPointer; diff --git a/autowiring/fast_pointer_cast.h b/autowiring/fast_pointer_cast.h index 57f669da5..0e67f94c6 100644 --- a/autowiring/fast_pointer_cast.h +++ b/autowiring/fast_pointer_cast.h @@ -5,6 +5,12 @@ #include TYPE_TRAITS_HEADER namespace autowiring { + template + struct fast_pointer_cast_blind; + + template + struct fast_pointer_cast_initializer; + /// /// Identical to static_pointer_cast if U inherits T, dynamic_pointer_cast otherwise /// @@ -44,4 +50,61 @@ namespace autowiring { >::type fast_pointer_cast(const std::shared_ptr& ptr) { return ptr; } + + /// + /// Holds a fast pointer cast function pointer + /// + /// + /// This method holds the implementation of the blind fast pointer cast function + /// + template + struct fast_pointer_cast_blind { + /// + /// A delayed instantiation fast pointer cast + /// + /// + /// This method will perform a correct fast pointer cast to the destination type without _any_ knowledge + /// of either T or U being required. It's able to do this as long as there is another location somewhere + /// in the application where a fast_pointer_cast is being used, because the fast_pointer_cast type has a + /// small registry of cast functions. + /// + static std::shared_ptr(*cast)(const std::shared_ptr&); + }; + + /// + /// Trivial case specialization + /// + template + struct fast_pointer_cast_blind { + std::shared_ptr cast(const std::shared_ptr& rhs) { + return rhs; + } + }; + + /// + /// Null implementation of the fast pointer cast function + /// + template + std::shared_ptr null_cast(const std::shared_ptr&) { + return nullptr; + } + + // Default cast routine is going to be a do-nothing function + template + std::shared_ptr(*fast_pointer_cast_blind::cast)(const std::shared_ptr&) = &null_cast; + + /// + /// Initializer for the fast pointer cast holder + /// + template + struct fast_pointer_cast_initializer { + fast_pointer_cast_initializer(void) { + // Update the cast routine: + fast_pointer_cast_blind::cast = &fast_pointer_cast; + } + static const fast_pointer_cast_initializer sc_init; + }; + + template + const fast_pointer_cast_initializer fast_pointer_cast_initializer::sc_init; } \ No newline at end of file diff --git a/autowiring/var_logic.h b/autowiring/var_logic.h index 9ce682cc4..45922b751 100644 --- a/autowiring/var_logic.h +++ b/autowiring/var_logic.h @@ -1,6 +1,5 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include TYPE_TRAITS_HEADER /* Variadic generalizations of boolean operations. diff --git a/contrib/autoboost/autoboost/accumulators/accumulators.hpp b/contrib/autoboost/autoboost/accumulators/accumulators.hpp new file mode 100644 index 000000000..33e784c2c --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/accumulators.hpp @@ -0,0 +1,27 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file accumulators.hpp +/// Includes all of the Accumulators Framework +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_ACCUMULATORS_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_ACCUMULATORS_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/accumulators_fwd.hpp b/contrib/autoboost/autoboost/accumulators/accumulators_fwd.hpp new file mode 100644 index 000000000..9a1363fc6 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/accumulators_fwd.hpp @@ -0,0 +1,230 @@ +/////////////////////////////////////////////////////////////////////////////// +// accumulators_fwd.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005 + +#include +#include // for mpl::na +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AUTOBOOST_ACCUMULATORS_MAX_FEATURES + /// The maximum number of accumulators that may be put in an accumulator_set. + /// Defaults to AUTOBOOST_MPL_LIMIT_VECTOR_SIZE (which defaults to 20). +# define AUTOBOOST_ACCUMULATORS_MAX_FEATURES AUTOBOOST_MPL_LIMIT_VECTOR_SIZE +#endif + +#if AUTOBOOST_ACCUMULATORS_MAX_FEATURES > AUTOBOOST_MPL_LIMIT_VECTOR_SIZE +# error AUTOBOOST_ACCUMULATORS_MAX_FEATURES cannot be larger than AUTOBOOST_MPL_LIMIT_VECTOR_SIZE +#endif + +#ifndef AUTOBOOST_ACCUMULATORS_MAX_ARGS + /// The maximum number of arguments that may be specified to an accumulator_set's + /// accumulation function. Defaults to 15. +# define AUTOBOOST_ACCUMULATORS_MAX_ARGS 15 +#endif + +#if AUTOBOOST_WORKAROUND(__GNUC__, == 3) \ + || AUTOBOOST_WORKAROUND(__EDG_VERSION__, AUTOBOOST_TESTED_AT(306)) +# define AUTOBOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS +#endif + +#ifdef AUTOBOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS +# include +# include +# define AUTOBOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)\ + , typename autoboost::disable_if >::type * = 0 +#else +# define AUTOBOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T) +#endif + +#define AUTOBOOST_ACCUMULATORS_GCC_VERSION \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) + +namespace autoboost { namespace accumulators +{ + +/////////////////////////////////////////////////////////////////////////////// +// Named parameters tags +// +namespace tag +{ + struct sample; + struct weight; + struct accumulator; + struct weights; +} + +/////////////////////////////////////////////////////////////////////////////// +// User-level features +// +namespace tag +{ + template + struct value; + + template + struct value_tag; + + template + struct reference; + + template + struct reference_tag; + + template + struct external; + + template + struct droppable; +} + +template +struct droppable_accumulator_base; + +template +struct droppable_accumulator; + +template +struct with_cached_result; + +template +struct accumulator_set; + +template +struct extractor; + +template +struct feature_of; + +template +struct as_feature; + +template +struct as_weighted_feature; + +template +struct depends_on; + +template +struct features; + +template +typename mpl::apply::type const & +find_accumulator(AccumulatorSet const &acc); + +template +typename mpl::apply::type::result_type +extract_result(AccumulatorSet const &acc); + +template +typename mpl::apply::type::result_type +extract_result(AccumulatorSet const &acc, A1 const &a1); + +// ... other overloads generated by Boost.Preprocessor: + +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_EXTRACT_RESULT_FWD(z, n, _) \ + template< \ + typename Feature \ + , typename AccumulatorSet \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \ + > \ + typename mpl::apply::type::result_type \ + extract_result( \ + AccumulatorSet const &acc \ + AUTOBOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) \ + ); + +/// INTERNAL ONLY +/// +AUTOBOOST_PP_REPEAT_FROM_TO( + 2 + , AUTOBOOST_PP_INC(AUTOBOOST_ACCUMULATORS_MAX_ARGS) + , AUTOBOOST_ACCUMULATORS_EXTRACT_RESULT_FWD + , _ +) + +#ifdef AUTOBOOST_ACCUMULATORS_DOXYGEN_INVOKED +template +typename mpl::apply::type::result_type +extract_result(AccumulatorSet const &acc, A1 const &a1, A2 const &a2 ...); +#endif + +namespace impl +{ + using namespace numeric::operators; + + template + struct external_impl; +} + +namespace detail +{ + template + struct feature_tag; + + template + struct to_accumulator; + + struct accumulator_set_base; + + template + struct is_accumulator_set; + + inline void ignore_variable(void const *) {} + +#define AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(X) \ + namespace detail \ + { \ + struct AUTOBOOST_PP_CAT(ignore_, X) \ + { \ + void ignore() \ + { \ + autoboost::accumulators::detail::ignore_variable(&X); \ + } \ + }; \ + } \ + /**/ +} + +}} // namespace autoboost::accumulators + +// For defining autoboost::parameter keywords that can be inherited from to +// get a nested, class-scoped keyword with the requested alias +#define AUTOBOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias) \ + namespace tag_namespace \ + { \ + template \ + struct name ## _ \ + { \ + static char const* keyword_name() \ + { \ + return #name; \ + } \ + static ::autoboost::parameter::keyword > &alias; \ + }; \ + template \ + ::autoboost::parameter::keyword > &name ## _::alias = \ + ::autoboost::parameter::keyword >::get(); \ + typedef name ## _ <> name; \ + } \ + namespace \ + { \ + ::autoboost::parameter::keyword &name = \ + ::autoboost::parameter::keyword::get(); \ + } + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/accumulator_base.hpp b/contrib/autoboost/autoboost/accumulators/framework/accumulator_base.hpp new file mode 100644 index 000000000..72ef33538 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/accumulator_base.hpp @@ -0,0 +1,65 @@ +/////////////////////////////////////////////////////////////////////////////// +// accumulator_base.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_BASE_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_BASE_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace detail +{ + typedef void void_; +} + +/////////////////////////////////////////////////////////////////////////////// +// dont_care +// +struct dont_care +{ + template + dont_care(Args const &) + { + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// accumulator_base +// +struct accumulator_base +{ + // hidden if defined in derived classes + detail::void_ operator ()(dont_care) + { + } + + typedef mpl::false_ is_droppable; + + detail::void_ add_ref(dont_care) + { + } + + detail::void_ drop(dont_care) + { + } + + detail::void_ on_drop(dont_care) + { + } +}; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/accumulator_concept.hpp b/contrib/autoboost/autoboost/accumulators/framework/accumulator_concept.hpp new file mode 100644 index 000000000..eba9dd2ab --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/accumulator_concept.hpp @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////// +// accumulator_concept.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_CONCEPT_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_CONCEPT_HPP_EAN_28_10_2005 + +#include + +namespace autoboost { namespace accumulators +{ + +template +struct accumulator_concept +{ + void constraints() + { + // TODO: define the stat concept + } + + Stat stat; +}; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/accumulator_set.hpp b/contrib/autoboost/autoboost/accumulators/framework/accumulator_set.hpp new file mode 100644 index 000000000..5b24b1e51 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/accumulator_set.hpp @@ -0,0 +1,401 @@ +/////////////////////////////////////////////////////////////////////////////// +// accumulator_set.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_SET_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_SET_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace detail +{ + /////////////////////////////////////////////////////////////////////////////// + // accumulator_visitor + // wrap a autoboost::parameter argument pack in a Fusion extractor object + template + struct accumulator_visitor + { + explicit accumulator_visitor(Args const &a) + : args(a) + { + } + + template + void operator ()(Accumulator &accumulator) const + { + accumulator(this->args); + } + + private: + accumulator_visitor &operator =(accumulator_visitor const &); + Args const &args; + }; + + template + inline accumulator_visitor const make_accumulator_visitor(Args const &args) + { + return accumulator_visitor(args); + } + + typedef + parameter::parameters< + parameter::required + , parameter::optional + // ... and others which are not specified here... + > + accumulator_params; + + /////////////////////////////////////////////////////////////////////////////// + // accumulator_set_base + struct accumulator_set_base + { + }; + + /////////////////////////////////////////////////////////////////////////////// + // is_accumulator_set + template + struct is_accumulator_set + : is_base_and_derived + { + }; + +} // namespace detail + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4355) // warning C4355: 'this' : used in base member initializer list +#endif + +/////////////////////////////////////////////////////////////////////////////// +/// \brief A set of accumulators. +/// +/// accumulator_set resolves the dependencies between features and ensures that +/// the accumulators in the set are updated in the proper order. +/// +/// acccumulator_set provides a general mechanism to visit the accumulators +/// in the set in order, with or without a filter. You can also fetch a reference +/// to an accumulator that corresponds to a feature. +/// +template +struct accumulator_set + : detail::accumulator_set_base +{ + typedef Sample sample_type; ///< The type of the samples that will be accumulated + typedef Features features_type; ///< An MPL sequence of the features that should be accumulated. + typedef Weight weight_type; ///< The type of the weight parameter. Must be a scalar. Defaults to void. + + /// INTERNAL ONLY + /// + typedef + typename detail::make_accumulator_tuple< + Features + , Sample + , Weight + >::type + accumulators_mpl_vector; + + // generate a fusion::list of accumulators + /// INTERNAL ONLY + /// + typedef + typename detail::meta::make_acc_list< + accumulators_mpl_vector + >::type + accumulators_type; + + /// INTERNAL ONLY + /// + //AUTOBOOST_MPL_ASSERT((mpl::is_sequence)); + + /////////////////////////////////////////////////////////////////////////////// + /// default-construct all contained accumulators + accumulator_set() + : accumulators( + detail::make_acc_list( + accumulators_mpl_vector() + , detail::accumulator_params()(*this) + ) + ) + { + // Add-ref the Features that the user has specified + this->template visit_if >( + detail::make_add_ref_visitor(detail::accumulator_params()(*this)) + ); + } + + /// \overload + /// + /// \param a1 Optional named parameter to be passed to all the accumulators + template + explicit accumulator_set(A1 const &a1) + : accumulators( + detail::make_acc_list( + accumulators_mpl_vector() + , detail::accumulator_params()(*this, a1) + ) + ) + { + // Add-ref the Features that the user has specified + this->template visit_if >( + detail::make_add_ref_visitor(detail::accumulator_params()(*this)) + ); + } + + // ... other overloads generated by Boost.Preprocessor: + + /// INTERNAL ONLY + /// +#define AUTOBOOST_ACCUMULATORS_ACCUMULATOR_SET_CTOR(z, n, _) \ + template \ + accumulator_set(AUTOBOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, A, const &a)) \ + : accumulators( \ + detail::make_acc_list( \ + accumulators_mpl_vector() \ + , detail::accumulator_params()( \ + *this AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a) \ + ) \ + ) \ + ) \ + { \ + /* Add-ref the Features that the user has specified */ \ + this->template visit_if >( \ + detail::make_add_ref_visitor(detail::accumulator_params()(*this)) \ + ); \ + } + + /// INTERNAL ONLY + /// + AUTOBOOST_PP_REPEAT_FROM_TO( + 2 + , AUTOBOOST_PP_INC(AUTOBOOST_ACCUMULATORS_MAX_ARGS) + , AUTOBOOST_ACCUMULATORS_ACCUMULATOR_SET_CTOR + , _ + ) + + #ifdef AUTOBOOST_ACCUMULATORS_DOXYGEN_INVOKED + /// \overload + /// + template + accumulator_set(A1 const &a1, A2 const &a2, ...); + #endif + + // ... other overloads generated by Boost.Preprocessor below ... + + /////////////////////////////////////////////////////////////////////////////// + /// Visitation + /// \param func UnaryFunction which is invoked with each accumulator in turn. + template + void visit(UnaryFunction const &func) + { + fusion::for_each(this->accumulators, func); + } + + /////////////////////////////////////////////////////////////////////////////// + /// Conditional visitation + /// \param func UnaryFunction which is invoked with each accumulator in turn, + /// provided the accumulator satisfies the MPL predicate FilterPred. + template + void visit_if(UnaryFunction const &func) + { + fusion::filter_view filtered_accs(this->accumulators); + fusion::for_each(filtered_accs, func); + } + + /////////////////////////////////////////////////////////////////////////////// + /// The return type of the operator() overloads is void. + typedef void result_type; + + /////////////////////////////////////////////////////////////////////////////// + /// Accumulation + /// \param a1 Optional named parameter to be passed to all the accumulators + void operator ()() + { + this->visit( + detail::make_accumulator_visitor( + detail::accumulator_params()(*this) + ) + ); + } + + template + void operator ()(A1 const &a1) + { + this->visit( + detail::make_accumulator_visitor( + detail::accumulator_params()(*this, a1) + ) + ); + } + + // ... other overloads generated by Boost.Preprocessor: + + /// INTERNAL ONLY + /// +#define AUTOBOOST_ACCUMULATORS_ACCUMULATOR_SET_FUN_OP(z, n, _) \ + template \ + void operator ()(AUTOBOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, A, const &a)) \ + { \ + this->visit( \ + detail::make_accumulator_visitor( \ + detail::accumulator_params()( \ + *this AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a) \ + ) \ + ) \ + ); \ + } + + /// INTERNAL ONLY + /// + AUTOBOOST_PP_REPEAT_FROM_TO( + 2 + , AUTOBOOST_PP_INC(AUTOBOOST_ACCUMULATORS_MAX_ARGS) + , AUTOBOOST_ACCUMULATORS_ACCUMULATOR_SET_FUN_OP + , _ + ) + + #ifdef AUTOBOOST_ACCUMULATORS_DOXYGEN_INVOKED + /// \overload + /// + template + void operator ()(A1 const &a1, A2 const &a2, ...); + #endif + + /////////////////////////////////////////////////////////////////////////////// + /// Extraction + template + struct apply + : fusion::result_of::value_of< + typename fusion::result_of::find_if< + accumulators_type + , detail::matches_feature + >::type + > + { + }; + + /////////////////////////////////////////////////////////////////////////////// + /// Extraction + template + typename apply::type &extract() + { + return *fusion::find_if >(this->accumulators); + } + + /// \overload + template + typename apply::type const &extract() const + { + return *fusion::find_if >(this->accumulators); + } + + /////////////////////////////////////////////////////////////////////////////// + /// Drop + template + void drop() + { + // You can only drop the features that you have specified explicitly + typedef typename apply::type the_accumulator; + AUTOBOOST_MPL_ASSERT((detail::contains_feature_of)); + + typedef + typename feature_of::type>::type + the_feature; + + (*fusion::find_if >(this->accumulators)) + .drop(detail::accumulator_params()(*this)); + + // Also drop accumulators that this feature depends on + typedef typename the_feature::dependencies dependencies; + this->template visit_if >( + detail::make_drop_visitor(detail::accumulator_params()(*this)) + ); + } + +private: + + accumulators_type accumulators; +}; + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// find_accumulator +// find an accumulator in an accumulator_set corresponding to a feature +template +typename mpl::apply::type & +find_accumulator(AccumulatorSet &acc AUTOBOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(AccumulatorSet)) +{ + return acc.template extract(); +} + +/// \overload +template +typename mpl::apply::type const & +find_accumulator(AccumulatorSet const &acc) +{ + return acc.template extract(); +} + +/////////////////////////////////////////////////////////////////////////////// +// extract_result +// extract a result from an accumulator set +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_EXTRACT_RESULT_FUN(z, n, _) \ + template< \ + typename Feature \ + , typename AccumulatorSet \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \ + > \ + typename mpl::apply::type::result_type \ + extract_result( \ + AccumulatorSet const &acc \ + AUTOBOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) \ + ) \ + { \ + return find_accumulator(acc).result( \ + detail::accumulator_params()( \ + acc \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a) \ + ) \ + ); \ + } + +AUTOBOOST_PP_REPEAT( + AUTOBOOST_PP_INC(AUTOBOOST_ACCUMULATORS_MAX_ARGS) + , AUTOBOOST_ACCUMULATORS_EXTRACT_RESULT_FUN + , _ +) + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/accumulators/droppable_accumulator.hpp b/contrib/autoboost/autoboost/accumulators/framework/accumulators/droppable_accumulator.hpp new file mode 100644 index 000000000..8a199ac06 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/accumulators/droppable_accumulator.hpp @@ -0,0 +1,328 @@ +/////////////////////////////////////////////////////////////////////////////// +// droppable_accumulator.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_DROPPABLE_ACCUMULATOR_HPP_EAN_13_12_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_DROPPABLE_ACCUMULATOR_HPP_EAN_13_12_2005 + +#include +#include +#include +#include +#include // for feature_of +#include // for accumulator + +namespace autoboost { namespace accumulators +{ + + template + struct droppable_accumulator; + + namespace detail + { + /////////////////////////////////////////////////////////////////////////////// + // add_ref_visitor + // a fusion function object for add_ref'ing accumulators + template + struct add_ref_visitor + { + explicit add_ref_visitor(Args const &args) + : args_(args) + { + } + + template + void operator ()(Accumulator &acc) const + { + typedef typename Accumulator::feature_tag::dependencies dependencies; + + acc.add_ref(this->args_); + + // Also add_ref accumulators that this feature depends on + this->args_[accumulator].template + visit_if >( + *this + ); + } + + private: + add_ref_visitor &operator =(add_ref_visitor const &); + Args const &args_; + }; + + template + add_ref_visitor make_add_ref_visitor(Args const &args) + { + return add_ref_visitor(args); + } + + /////////////////////////////////////////////////////////////////////////////// + // drop_visitor + // a fusion function object for dropping accumulators + template + struct drop_visitor + { + explicit drop_visitor(Args const &args) + : args_(args) + { + } + + template + void operator ()(Accumulator &acc) const + { + if(typename Accumulator::is_droppable()) + { + typedef typename Accumulator::feature_tag::dependencies dependencies; + + acc.drop(this->args_); + // Also drop accumulators that this feature depends on + this->args_[accumulator].template + visit_if >( + *this + ); + } + } + + private: + drop_visitor &operator =(drop_visitor const &); + Args const &args_; + }; + + template + drop_visitor make_drop_visitor(Args const &args) + { + return drop_visitor(args); + } + } + + ////////////////////////////////////////////////////////////////////////// + // droppable_accumulator_base + template + struct droppable_accumulator_base + : Accumulator + { + typedef droppable_accumulator_base base; + typedef mpl::true_ is_droppable; + typedef typename Accumulator::result_type result_type; + + template + droppable_accumulator_base(Args const &args) + : Accumulator(args) + , ref_count_(0) + { + } + + droppable_accumulator_base(droppable_accumulator_base const &that) + : Accumulator(*static_cast(&that)) + , ref_count_(that.ref_count_) + { + } + + template + void operator ()(Args const &args) + { + if(!this->is_dropped()) + { + this->Accumulator::operator ()(args); + } + } + + template + void add_ref(Args const &) + { + ++this->ref_count_; + } + + template + void drop(Args const &args) + { + AUTOBOOST_ASSERT(0 < this->ref_count_); + if(1 == this->ref_count_) + { + static_cast *>(this)->on_drop(args); + } + --this->ref_count_; + } + + bool is_dropped() const + { + return 0 == this->ref_count_; + } + + private: + int ref_count_; + }; + + ////////////////////////////////////////////////////////////////////////// + // droppable_accumulator + // this can be specialized for any type that needs special handling + template + struct droppable_accumulator + : droppable_accumulator_base + { + template + droppable_accumulator(Args const &args) + : droppable_accumulator::base(args) + { + } + + droppable_accumulator(droppable_accumulator const &that) + : droppable_accumulator::base(*static_cast(&that)) + { + } + }; + + ////////////////////////////////////////////////////////////////////////// + // with_cached_result + template + struct with_cached_result + : Accumulator + { + typedef typename Accumulator::result_type result_type; + + template + with_cached_result(Args const &args) + : Accumulator(args) + , cache() + { + } + + with_cached_result(with_cached_result const &that) + : Accumulator(*static_cast(&that)) + , cache() + { + if(that.has_result()) + { + this->set(that.get()); + } + } + + ~with_cached_result() + { + // Since this is a base class of droppable_accumulator_base, + // this destructor is called before any of droppable_accumulator_base's + // members get cleaned up, including is_dropped, so the following + // call to has_result() is valid. + if(this->has_result()) + { + this->get().~result_type(); + } + } + + template + void on_drop(Args const &args) + { + // cache the result at the point this calculation was dropped + AUTOBOOST_ASSERT(!this->has_result()); + this->set(this->Accumulator::result(args)); + } + + template + result_type result(Args const &args) const + { + return this->has_result() ? this->get() : this->Accumulator::result(args); + } + + private: + with_cached_result &operator =(with_cached_result const &); + + void set(result_type const &r) + { + ::new(this->cache.address()) result_type(r); + } + + result_type const &get() const + { + return *static_cast(this->cache.address()); + } + + bool has_result() const + { + typedef with_cached_result this_type; + typedef droppable_accumulator_base derived_type; + return static_cast(this)->is_dropped(); + } + + aligned_storage cache; + }; + + namespace tag + { + template + struct as_droppable + { + typedef droppable type; + }; + + template + struct as_droppable > + { + typedef droppable type; + }; + + ////////////////////////////////////////////////////////////////////////// + // droppable + template + struct droppable + : as_feature::type + { + typedef typename as_feature::type feature_type; + typedef typename feature_type::dependencies tmp_dependencies_; + + typedef + typename mpl::transform< + typename feature_type::dependencies + , as_droppable + >::type + dependencies; + + struct impl + { + template + struct apply + { + typedef + droppable_accumulator< + typename mpl::apply2::type + > + type; + }; + }; + }; + } + + // make droppable work + template + struct as_feature > + { + typedef tag::droppable::type> type; + }; + + // make droppable work with non-void weights (should become + // droppable + template + struct as_weighted_feature > + { + typedef tag::droppable::type> type; + }; + + // for the purposes of feature-based dependency resolution, + // droppable provides the same feature as Foo + template + struct feature_of > + : feature_of + { + }; + + // Note: Usually, the extractor is pulled into the accumulators namespace with + // a using directive, not the tag. But the droppable<> feature doesn't have an + // extractor, so we can put the droppable tag in the accumulators namespace + // without fear of a name conflict. + using tag::droppable; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/accumulators/external_accumulator.hpp b/contrib/autoboost/autoboost/accumulators/framework/accumulators/external_accumulator.hpp new file mode 100644 index 000000000..519665709 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/accumulators/external_accumulator.hpp @@ -0,0 +1,108 @@ +/////////////////////////////////////////////////////////////////////////////// +// external_accumulator.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_EXTERNAL_ACCUMULATOR_HPP_EAN_01_12_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_EXTERNAL_ACCUMULATOR_HPP_EAN_01_12_2005 + +#include +#include +#include +#include // for feature_tag +#include +#include + +namespace autoboost { namespace accumulators { namespace impl +{ + + ////////////////////////////////////////////////////////////////////////// + // external_impl + /// INTERNAL ONLY + /// + template + struct external_impl + : accumulator_base + { + typedef typename Accumulator::result_type result_type; + typedef typename detail::feature_tag::type feature_tag; + + external_impl(dont_care) {} + + template + result_type result(Args const &args) const + { + return this->extract_(args, args[parameter::keyword::get() | 0]); + } + + private: + + template + static result_type extract_(Args const &args, int) + { + // No named parameter passed to the extractor. Maybe the external + // feature is held by reference<>. + extractor extract; + return extract(accumulators::reference_tag(args)); + } + + template + static result_type extract_(Args const &, AccumulatorSet const &acc) + { + // OK, a named parameter for this external feature was passed to the + // extractor, so use that. + extractor extract; + return extract(acc); + } + }; + +} // namespace impl + +namespace tag +{ + ////////////////////////////////////////////////////////////////////////// + // external + template + struct external + : depends_on > + { + typedef + accumulators::impl::external_impl< + detail::to_accumulator + , Tag + > + impl; + }; + + template + struct external + : depends_on<> + { + typedef + accumulators::impl::external_impl< + detail::to_accumulator + , Tag + > + impl; + }; +} + +// for the purposes of feature-based dependency resolution, +// external_accumulator provides the same feature as Feature +template +struct feature_of > + : feature_of +{ +}; + +// Note: Usually, the extractor is pulled into the accumulators namespace with +// a using directive, not the tag. But the external<> feature doesn't have an +// extractor, so we can put the external tag in the accumulators namespace +// without fear of a name conflict. +using tag::external; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/accumulators/reference_accumulator.hpp b/contrib/autoboost/autoboost/accumulators/framework/accumulators/reference_accumulator.hpp new file mode 100644 index 000000000..4fb7366c0 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/accumulators/reference_accumulator.hpp @@ -0,0 +1,89 @@ +/////////////////////////////////////////////////////////////////////////////// +// reference_accumulator.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_REFERENCE_ACCUMULATOR_HPP_EAN_03_23_2006 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_REFERENCE_ACCUMULATOR_HPP_EAN_03_23_2006 + +#include +#include +#include +#include // for feature_tag +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace impl +{ + ////////////////////////////////////////////////////////////////////////// + // reference_accumulator_impl + // + template + struct reference_accumulator_impl + : accumulator_base + { + typedef Referent &result_type; + + template + reference_accumulator_impl(Args const &args) + : ref(args[parameter::keyword::get()]) + { + } + + result_type result(dont_care) const + { + return this->ref; + } + + private: + reference_wrapper ref; + }; +} // namespace impl + +namespace tag +{ + ////////////////////////////////////////////////////////////////////////// + // reference_tag + template + struct reference_tag + { + }; + + ////////////////////////////////////////////////////////////////////////// + // reference + template + struct reference + : depends_on<> + { + /// INTERNAL ONLY + /// + typedef mpl::always > impl; + }; +} + +namespace extract +{ + AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, reference, (typename)(typename)) + AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, reference_tag, (typename)) +} + +using extract::reference; +using extract::reference_tag; + +// Map all reference features to reference_tag so +// that references can be extracted using reference_tag +// without specifying the referent type. +template +struct feature_of > + : feature_of > +{ +}; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/accumulators/value_accumulator.hpp b/contrib/autoboost/autoboost/accumulators/framework/accumulators/value_accumulator.hpp new file mode 100644 index 000000000..6c570f612 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/accumulators/value_accumulator.hpp @@ -0,0 +1,89 @@ +/////////////////////////////////////////////////////////////////////////////// +// value_accumulator.hpp +// +// Copyright 2005 Eric Niebler, Daniel Egloff. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_VALUE_ACCUMULATOR_HPP_EAN_03_23_2006 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_VALUE_ACCUMULATOR_HPP_EAN_03_23_2006 + +#include +#include +#include // for feature_tag +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace impl +{ + + ////////////////////////////////////////////////////////////////////////// + // value_accumulator_impl + template + struct value_accumulator_impl + : accumulator_base + { + typedef ValueType result_type; + + template + value_accumulator_impl(Args const &args) + : val(args[parameter::keyword::get()]) + { + } + + result_type result(dont_care) const + { + return this->val; + } + + private: + ValueType val; + }; + +} // namespace impl + +namespace tag +{ + ////////////////////////////////////////////////////////////////////////// + // value_tag + template + struct value_tag + { + }; + + ////////////////////////////////////////////////////////////////////////// + // value + template + struct value + : depends_on<> + { + /// INTERNAL ONLY + /// + typedef mpl::always > impl; + }; +} + +namespace extract +{ + AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, value, (typename)(typename)) + AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, value_tag, (typename)) +} + +using extract::value; +using extract::value_tag; + +// Map all value features to value_tag so +// that values can be extracted using value_tag +// without specifying the value type. +template +struct feature_of > + : feature_of > +{ +}; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/depends_on.hpp b/contrib/autoboost/autoboost/accumulators/framework/depends_on.hpp new file mode 100644 index 000000000..fb1cfc3d7 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/depends_on.hpp @@ -0,0 +1,448 @@ +/////////////////////////////////////////////////////////////////////////////// +// depends_on.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_DEPENDS_ON_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_DEPENDS_ON_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + /////////////////////////////////////////////////////////////////////////// + // as_feature + template + struct as_feature + { + typedef Feature type; + }; + + /////////////////////////////////////////////////////////////////////////// + // weighted_feature + template + struct as_weighted_feature + { + typedef Feature type; + }; + + /////////////////////////////////////////////////////////////////////////// + // feature_of + template + struct feature_of + { + typedef Feature type; + }; + + namespace detail + { + /////////////////////////////////////////////////////////////////////////// + // feature_tag + template + struct feature_tag + { + typedef typename Accumulator::feature_tag type; + }; + + template + struct undroppable + { + typedef Feature type; + }; + + template + struct undroppable > + { + typedef Feature type; + }; + + // For the purpose of determining whether one feature depends on another, + // disregard whether the feature is droppable or not. + template + struct is_dependent_on + : is_base_and_derived< + typename feature_of::type>::type + , typename undroppable::type + > + {}; + + template + struct dependencies_of + { + typedef typename Feature::dependencies type; + }; + + // Should use mpl::insert_range, but doesn't seem to work with mpl sets + template + struct set_insert_range + : mpl::fold< + Range + , Set + , mpl::insert + > + {}; + + template + struct collect_abstract_features + : mpl::fold< + Features + , mpl::set0<> + , set_insert_range< + mpl::insert > + , collect_abstract_features > + > + > + {}; + + template + struct depends_on_base + : mpl::inherit_linearly< + typename mpl::sort< + typename mpl::copy< + typename collect_abstract_features::type + , mpl::back_inserter > + >::type + , is_dependent_on + >::type + // Don't inherit multiply from a feature + , mpl::if_< + is_dependent_on + , mpl::_1 + , mpl::inherit + > + >::type + { + }; + } + + /////////////////////////////////////////////////////////////////////////// + /// depends_on + template + struct depends_on + : detail::depends_on_base< + typename mpl::transform< + mpl::vector + , as_feature + >::type + > + { + typedef mpl::false_ is_weight_accumulator; + typedef + typename mpl::transform< + mpl::vector + , as_feature + >::type + dependencies; + }; + + namespace detail + { + template + struct matches_feature + { + template + struct apply + : is_same< + typename feature_of::type>::type + , typename feature_of::type>::type>::type + > + {}; + }; + + template + struct contains_feature_of + { + typedef + mpl::transform_view > > + features_list; + + typedef + typename feature_of::type>::type + the_feature; + + typedef + typename mpl::contains::type + type; + }; + + // This is to work around a bug in early versions of Fusion which caused + // a compile error if contains_feature_of is used as a + // predicate to fusion::find_if + template + struct contains_feature_of_ + { + template + struct apply + : contains_feature_of + {}; + }; + + template< + typename First + , typename Last + , bool is_empty = fusion::result_of::equal_to::value + > + struct build_acc_list; + + template + struct build_acc_list + { + typedef fusion::nil type; + + template + static fusion::nil + call(Args const &, First const&, Last const&) + { + return fusion::nil(); + } + }; + + template + struct build_acc_list + { + typedef + build_acc_list::type, Last> + next_build_acc_list; + + typedef fusion::cons< + typename fusion::result_of::value_of::type + , typename next_build_acc_list::type> + type; + + template + static type + call(Args const &args, First const& f, Last const& l) + { + return type(args, next_build_acc_list::call(args, fusion::next(f), l)); + } + }; + + namespace meta + { + template + struct make_acc_list + : build_acc_list< + typename fusion::result_of::begin::type + , typename fusion::result_of::end::type + > + {}; + } + + template + typename meta::make_acc_list::type + make_acc_list(Sequence const &seq, Args const &args) + { + return meta::make_acc_list::call(args, fusion::begin(seq), fusion::end(seq)); + } + + /////////////////////////////////////////////////////////////////////////// + // checked_as_weighted_feature + template + struct checked_as_weighted_feature + { + typedef typename as_feature::type feature_type; + typedef typename as_weighted_feature::type type; + // weighted and non-weighted flavors should provide the same feature. + AUTOBOOST_MPL_ASSERT(( + is_same< + typename feature_of::type + , typename feature_of::type + > + )); + }; + + /////////////////////////////////////////////////////////////////////////// + // as_feature_list + template + struct as_feature_list + : mpl::transform_view > + { + }; + + template + struct as_feature_list + : mpl::transform_view > + { + }; + + /////////////////////////////////////////////////////////////////////////// + // accumulator_wrapper + template + struct accumulator_wrapper + : Accumulator + { + typedef Feature feature_tag; + + accumulator_wrapper(accumulator_wrapper const &that) + : Accumulator(*static_cast(&that)) + { + } + + template + accumulator_wrapper(Args const &args) + : Accumulator(args) + { + } + }; + + /////////////////////////////////////////////////////////////////////////// + // to_accumulator + template + struct to_accumulator + { + typedef + accumulator_wrapper< + typename mpl::apply2::type + , Feature + > + type; + }; + + template + struct to_accumulator > + { + AUTOBOOST_MPL_ASSERT((is_same)); + AUTOBOOST_MPL_ASSERT((is_same)); + + typedef + accumulator_wrapper< + typename mpl::apply2::type + , Feature + > + accumulator_type; + + typedef + typename mpl::if_< + typename Feature::is_weight_accumulator + , accumulator_wrapper, Feature> + , accumulator_type + >::type + type; + }; + + // BUGBUG work around an MPL bug wrt map insertion + template + struct insert_feature + : mpl::eval_if< + mpl::has_key::type> + , mpl::identity + , mpl::insert::type, Feature> > + > + { + }; + + template + struct insert_dependencies + : mpl::fold< + as_feature_list + , FeatureMap + , insert_dependencies< + insert_feature + , mpl::_2 + , Weight + > + > + { + }; + + template + struct insert_sequence + : mpl::fold< // BUGBUG should use insert_range, but doesn't seem to work for maps + as_feature_list + , FeatureMap + , insert_feature + > + { + }; + + template + struct make_accumulator_tuple + { + typedef + typename mpl::fold< + as_feature_list + , mpl::map0<> + , mpl::if_< + mpl::is_sequence + , insert_sequence + , insert_feature + > + >::type + feature_map; + + // for each element in the map, add its dependencies also + typedef + typename mpl::fold< + feature_map + , feature_map + , insert_dependencies, Weight> + >::type + feature_map_with_dependencies; + + // turn the map into a vector so we can sort it + typedef + typename mpl::insert_range< + mpl::vector<> + , mpl::end >::type + , mpl::transform_view > + >::type + feature_vector_with_dependencies; + + // sort the features according to which is derived from which + typedef + typename mpl::sort< + feature_vector_with_dependencies + , is_dependent_on + >::type + sorted_feature_vector; + + // From the vector of features, construct a vector of accumulators + typedef + typename mpl::transform< + sorted_feature_vector + , to_accumulator + >::type + type; + }; + + } // namespace detail + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/external.hpp b/contrib/autoboost/autoboost/accumulators/framework/external.hpp new file mode 100644 index 000000000..ba1fe828f --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/external.hpp @@ -0,0 +1,27 @@ +/////////////////////////////////////////////////////////////////////////////// +// external.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_EXTERNAL_HPP_EAN_01_12_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_EXTERNAL_HPP_EAN_01_12_2005 + +#include +#include + +//namespace autoboost { namespace accumulators +//{ +// +///////////////////////////////////////////////////////////////////////////////// +//// external +//// +//template +//struct external +//{ +//}; +// +//}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/extractor.hpp b/contrib/autoboost/autoboost/accumulators/framework/extractor.hpp new file mode 100644 index 000000000..ac998056f --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/extractor.hpp @@ -0,0 +1,229 @@ +/////////////////////////////////////////////////////////////////////////////// +// extractor.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_EXTRACTOR_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_EXTRACTOR_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace detail +{ + template + struct accumulator_set_result + { + typedef typename as_feature::type feature_type; + typedef typename mpl::apply::type::result_type type; + }; + + template + struct argument_pack_result + : accumulator_set_result< + typename remove_reference< + typename parameter::binding::type + >::type + , Feature + > + { + }; + + template + struct extractor_result + : mpl::eval_if< + detail::is_accumulator_set + , accumulator_set_result + , argument_pack_result + > + { + }; + + template + typename extractor_result::type + do_extract(AccumulatorSet const &acc, mpl::true_) + { + typedef typename as_feature::type feature_type; + return extract_result(acc); + } + + template + typename extractor_result::type + do_extract(Args const &args, mpl::false_) + { + typedef typename as_feature::type feature_type; + return find_accumulator(args[accumulator]).result(args); + } + +} // namespace detail + + +/////////////////////////////////////////////////////////////////////////////// +/// Extracts the result associated with Feature from the specified accumulator_set. +template +struct extractor +{ + typedef extractor this_type; + + /// The result meta-function for determining the return type of the extractor + template + struct result; + + template + struct result + : detail::extractor_result + { + }; + + /// Extract the result associated with Feature from the accumulator set + /// \param acc The accumulator set object from which to extract the result + template + typename detail::extractor_result::type + operator ()(Arg1 const &arg1) const + { + // Arg1 could be an accumulator_set or an argument pack containing + // an accumulator_set. Dispatch accordingly. + return detail::do_extract(arg1, detail::is_accumulator_set()); + } + + /// \overload + /// + /// \param a1 Optional named parameter to be passed to the accumulator's result() function. + template + typename detail::extractor_result::type + operator ()(AccumulatorSet const &acc, A1 const &a1) const + { + AUTOBOOST_MPL_ASSERT((detail::is_accumulator_set)); + typedef typename as_feature::type feature_type; + return extract_result(acc, a1); + } + + // ... other overloads generated by Boost.Preprocessor: + + /// INTERNAL ONLY + /// +#define AUTOBOOST_ACCUMULATORS_EXTRACTOR_FUN_OP(z, n, _) \ + template \ + struct result \ + : detail::extractor_result \ + {}; \ + template< \ + typename AccumulatorSet \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \ + > \ + typename detail::extractor_result::type \ + operator ()( \ + AccumulatorSet const &acc \ + AUTOBOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) \ + ) const \ + { \ + AUTOBOOST_MPL_ASSERT((detail::is_accumulator_set)); \ + typedef typename as_feature::type feature_type; \ + return extract_result(acc AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a));\ + } + + AUTOBOOST_PP_REPEAT_FROM_TO( + 2 + , AUTOBOOST_PP_INC(AUTOBOOST_ACCUMULATORS_MAX_ARGS) + , AUTOBOOST_ACCUMULATORS_EXTRACTOR_FUN_OP + , _ + ) + + #ifdef AUTOBOOST_ACCUMULATORS_DOXYGEN_INVOKED + /// \overload + /// + template + typename detail::extractor_result::type + operator ()(AccumulatorSet const &acc, A1 const &a1, A2 const &a2, ...); + #endif +}; + +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_ARRAY_REM(Array) \ + AUTOBOOST_PP_TUPLE_REM_CTOR(AUTOBOOST_PP_ARRAY_SIZE(Array), AUTOBOOST_PP_ARRAY_DATA(Array)) + +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_SEQ_REM(Seq) \ + AUTOBOOST_ACCUMULATORS_ARRAY_REM(AUTOBOOST_PP_SEQ_TO_ARRAY(Seq)) + +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_ARGS_OP(s, data, elem) \ + T ## s + +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_PARAMS_OP(s, data, elem) \ + elem T ## s + +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq) \ + Tag::Feature< \ + AUTOBOOST_ACCUMULATORS_SEQ_REM( \ + AUTOBOOST_PP_SEQ_TRANSFORM(AUTOBOOST_ACCUMULATORS_ARGS_OP, ~, ParamsSeq) \ + ) \ + > + +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN_IMPL(z, n, Tag, Feature, ParamsSeq) \ + template< \ + AUTOBOOST_ACCUMULATORS_SEQ_REM( \ + AUTOBOOST_PP_SEQ_TRANSFORM(AUTOBOOST_ACCUMULATORS_PARAMS_OP, ~, ParamsSeq) \ + ) \ + , typename Arg1 \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \ + > \ + typename autoboost::accumulators::detail::extractor_result< \ + Arg1 \ + , AUTOBOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq) \ + >::type \ + Feature(Arg1 const &arg1 AUTOBOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) ) \ + { \ + typedef AUTOBOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq) feature_type; \ + return autoboost::accumulators::extractor()( \ + arg1 AUTOBOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a)); \ + } + +/// INTERNAL ONLY +/// +#define AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN(z, n, _) \ + AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN_IMPL( \ + z \ + , n \ + , AUTOBOOST_PP_ARRAY_ELEM(0, _) \ + , AUTOBOOST_PP_ARRAY_ELEM(1, _) \ + , AUTOBOOST_PP_ARRAY_ELEM(2, _) \ + ) + +#define AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR(Tag, Feature, ParamSeq) \ + AUTOBOOST_PP_REPEAT( \ + AUTOBOOST_PP_INC(AUTOBOOST_ACCUMULATORS_MAX_ARGS) \ + , AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN \ + , (3, (Tag, Feature, ParamSeq)) \ + ) + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/features.hpp b/contrib/autoboost/autoboost/accumulators/framework/features.hpp new file mode 100644 index 000000000..28408b0c3 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/features.hpp @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////// +// features.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_STATISTICS_STATS_HPP_EAN_08_12_2005 +#define AUTOBOOST_ACCUMULATORS_STATISTICS_STATS_HPP_EAN_08_12_2005 + +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +/////////////////////////////////////////////////////////////////////////////// +// features +// +template +struct features + : mpl::vector +{ +}; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/parameters/accumulator.hpp b/contrib/autoboost/autoboost/accumulators/framework/parameters/accumulator.hpp new file mode 100644 index 000000000..113352218 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/parameters/accumulator.hpp @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// accumulator.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_ACCUMULATOR_HPP_EAN_31_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_ACCUMULATOR_HPP_EAN_31_10_2005 + +#include +#include + +namespace autoboost { namespace accumulators +{ + +AUTOBOOST_PARAMETER_KEYWORD(tag, accumulator) +AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(accumulator) + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/parameters/sample.hpp b/contrib/autoboost/autoboost/accumulators/framework/parameters/sample.hpp new file mode 100644 index 000000000..a6c318667 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/parameters/sample.hpp @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// sample.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_SAMPLE_HPP_EAN_31_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_SAMPLE_HPP_EAN_31_10_2005 + +#include +#include + +namespace autoboost { namespace accumulators +{ + +AUTOBOOST_PARAMETER_KEYWORD(tag, sample) +AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(sample) + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/parameters/weight.hpp b/contrib/autoboost/autoboost/accumulators/framework/parameters/weight.hpp new file mode 100644 index 000000000..950e869f3 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/parameters/weight.hpp @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// weight.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHT_HPP_EAN_31_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHT_HPP_EAN_31_10_2005 + +#include +#include + +namespace autoboost { namespace accumulators +{ + +// The weight of a single sample +AUTOBOOST_PARAMETER_KEYWORD(tag, weight) +AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(weight) + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/framework/parameters/weights.hpp b/contrib/autoboost/autoboost/accumulators/framework/parameters/weights.hpp new file mode 100644 index 000000000..1cbbf2f72 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/framework/parameters/weights.hpp @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// weights.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHTS_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHTS_HPP_EAN_28_10_2005 + +#include +#include + +namespace autoboost { namespace accumulators +{ + +// The weight accumulator +AUTOBOOST_PARAMETER_KEYWORD(tag, weights) +AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(weights) + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/numeric/detail/function1.hpp b/contrib/autoboost/autoboost/accumulators/numeric/detail/function1.hpp new file mode 100644 index 000000000..57a940817 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/detail/function1.hpp @@ -0,0 +1,75 @@ +// Copyright David Abrahams 2006. 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) +#ifndef AUTOBOOST_DETAIL_FUNCTION1_DWA200655_HPP +# define AUTOBOOST_DETAIL_FUNCTION1_DWA200655_HPP + +# include +# include +# include +# include + +namespace autoboost { namespace detail { + +// A utility for creating unary function objects that play nicely with +// autoboost::result_of and that handle the forwarding problem. +// +// mpl::apply::type is expected to be a stateless function +// object that accepts an argument of type A0&. It is also expected +// to have a nested ::result_type identical to its return type. +template +struct function1 +{ + template + struct result + {}; + + template + struct result + { + // How adding const to arguments handles rvalues. + // + // if A0 is arg0 is represents actual argument + // -------- ------- -------------------------- + // T const & T const const T lvalue + // T & T non-const T lvalue + // T const T const const T rvalue + // T T const non-const T rvalue + typedef typename remove_reference< + typename add_const< A0 >::type + >::type arg0; + + typedef typename mpl::apply1::type impl; + typedef typename impl::result_type type; + }; + + // Handles mutable lvalues + template + typename result::type + operator ()(A0 &a0) const + { + typedef typename result::impl impl; + typedef typename result::type type; + typedef A0 &arg0; + AUTOBOOST_CONCEPT_ASSERT((UnaryFunction)); + //autoboost::function_requires >(); + return impl()(a0); + } + + // Handles const lvalues and all rvalues + template + typename result::type + operator ()(A0 const &a0) const + { + typedef typename result::impl impl; + typedef typename result::type type; + typedef A0 const &arg0; + AUTOBOOST_CONCEPT_ASSERT((UnaryFunction)); + //autoboost::function_requires >(); + return impl()(a0); + } +}; + +}} // namespace autoboost::detail + +#endif // AUTOBOOST_DETAIL_FUNCTION1_DWA200655_HPP diff --git a/contrib/autoboost/autoboost/accumulators/numeric/detail/function2.hpp b/contrib/autoboost/autoboost/accumulators/numeric/detail/function2.hpp new file mode 100644 index 000000000..e6eff00a4 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/detail/function2.hpp @@ -0,0 +1,10 @@ +// Copyright David Abrahams 2006. 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) +#ifndef AUTOBOOST_DETAIL_FUNCTION2_DWA200655_HPP +# define AUTOBOOST_DETAIL_FUNCTION2_DWA200655_HPP + +# define args (2) +# include + +#endif // AUTOBOOST_DETAIL_FUNCTION2_DWA200655_HPP diff --git a/contrib/autoboost/autoboost/accumulators/numeric/detail/function_n.hpp b/contrib/autoboost/autoboost/accumulators/numeric/detail/function_n.hpp new file mode 100644 index 000000000..69f4bbbcb --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/detail/function_n.hpp @@ -0,0 +1,148 @@ +// Copyright David Abrahams 2006. 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) +// +// #include guards intentionally disabled. +// #ifndef AUTOBOOST_DETAIL_FUNCTION_N_DWA2006514_HPP +// # define AUTOBOOST_DETAIL_FUNCTION_N_DWA2006514_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace detail { + +# define AUTOBOOST_DETAIL_default_arg(z, n, _) \ + typedef mpl::void_ AUTOBOOST_PP_CAT(arg, n); + +# define AUTOBOOST_DETAIL_function_arg(z, n, _) \ + typedef typename remove_reference< \ + typename add_const< AUTOBOOST_PP_CAT(A, n) >::type \ + >::type AUTOBOOST_PP_CAT(arg, n); + +#define AUTOBOOST_DETAIL_cat_arg_counts(s, state, n) \ + AUTOBOOST_PP_IF( \ + n \ + , AUTOBOOST_PP_CAT(state, AUTOBOOST_PP_CAT(_, n)) \ + , state \ + ) \ + /**/ + +#define function_name \ + AUTOBOOST_PP_SEQ_FOLD_LEFT( \ + AUTOBOOST_DETAIL_cat_arg_counts \ + , AUTOBOOST_PP_CAT(function, AUTOBOOST_PP_SEQ_HEAD(args)) \ + , AUTOBOOST_PP_SEQ_TAIL(args)(0) \ + ) \ + /**/ + +template +struct function_name +{ + AUTOBOOST_PP_REPEAT( + AUTOBOOST_MPL_LIMIT_METAFUNCTION_ARITY + , AUTOBOOST_DETAIL_default_arg + , ~ + ) + + template + struct result {}; + +#define AUTOBOOST_DETAIL_function_result(r, _, n) \ + template \ + struct result \ + { \ + AUTOBOOST_PP_REPEAT(n, AUTOBOOST_DETAIL_function_arg, ~) \ + typedef \ + typename AUTOBOOST_PP_CAT(mpl::apply, AUTOBOOST_MPL_LIMIT_METAFUNCTION_ARITY)<\ + F \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS( \ + AUTOBOOST_MPL_LIMIT_METAFUNCTION_ARITY \ + , arg \ + ) \ + >::type \ + impl; \ + typedef typename impl::result_type type; \ + }; \ + /**/ + + AUTOBOOST_PP_SEQ_FOR_EACH(AUTOBOOST_DETAIL_function_result, _, args) + +# define arg_type(r, _, i, is_const) \ + AUTOBOOST_PP_COMMA_IF(i) AUTOBOOST_PP_CAT(A, i) AUTOBOOST_PP_CAT(const_if, is_const) & + +# define result_(r, n, constness) \ + typename result< \ + function_name( \ + AUTOBOOST_PP_SEQ_FOR_EACH_I_R(r, arg_type, ~, constness) \ + ) \ + > \ + /**/ + +# define param(r, _, i, is_const) AUTOBOOST_PP_COMMA_IF(i) \ + AUTOBOOST_PP_CAT(A, i) AUTOBOOST_PP_CAT(const_if, is_const) & AUTOBOOST_PP_CAT(x, i) + +# define param_list(r, n, constness) \ + AUTOBOOST_PP_SEQ_FOR_EACH_I_R(r, param, ~, constness) + +# define call_operator(r, constness) \ + template \ + result_(r, AUTOBOOST_PP_SEQ_SIZE(constness), constness)::type \ + operator ()( param_list(r, AUTOBOOST_PP_SEQ_SIZE(constness), constness) ) const \ + { \ + typedef result_(r, AUTOBOOST_PP_SEQ_SIZE(constness), constness)::impl impl; \ + return impl()(AUTOBOOST_PP_ENUM_PARAMS(AUTOBOOST_PP_SEQ_SIZE(constness), x)); \ + } \ + /**/ + +# define const_if0 +# define const_if1 const + +# define bits(z, n, _) ((0)(1)) + +# define gen_operator(r, _, n) \ + AUTOBOOST_PP_SEQ_FOR_EACH_PRODUCT_R( \ + r \ + , call_operator \ + , AUTOBOOST_PP_REPEAT(n, bits, ~) \ + ) \ + /**/ + + AUTOBOOST_PP_SEQ_FOR_EACH( + gen_operator + , ~ + , args + ) + +# undef bits +# undef const_if1 +# undef const_if0 +# undef call_operator +# undef param_list +# undef param +# undef result_ +# undef default_ +# undef arg_type +# undef gen_operator +# undef function_name + +# undef args +}; + +}} // namespace autoboost::detail + +//#endif // AUTOBOOST_DETAIL_FUNCTION_N_DWA2006514_HPP diff --git a/contrib/autoboost/autoboost/accumulators/numeric/detail/pod_singleton.hpp b/contrib/autoboost/autoboost/accumulators/numeric/detail/pod_singleton.hpp new file mode 100644 index 000000000..b23ffba80 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/detail/pod_singleton.hpp @@ -0,0 +1,20 @@ +// Copyright David Abrahams 2006. 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) +#ifndef AUTOBOOST_DETAIL_POD_SINGLETON_DWA200655_HPP +# define AUTOBOOST_DETAIL_POD_SINGLETON_DWA200655_HPP + +namespace autoboost { namespace detail { + +template +struct pod_singleton +{ + static T instance; +}; + +template +T pod_singleton::instance; + +}} // namespace autoboost::detail + +#endif // AUTOBOOST_DETAIL_POD_SINGLETON_DWA200655_HPP diff --git a/contrib/autoboost/autoboost/accumulators/numeric/functional.hpp b/contrib/autoboost/autoboost/accumulators/numeric/functional.hpp new file mode 100644 index 000000000..0ccffae5c --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/functional.hpp @@ -0,0 +1,521 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file functional.hpp +/// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_NUMERIC_FUNCTIONAL_HPP_EAN_08_12_2005 +#define AUTOBOOST_NUMERIC_FUNCTIONAL_HPP_EAN_08_12_2005 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef AUTOBOOST_NUMERIC_FUNCTIONAL_STD_VECTOR_SUPPORT +# include +#endif + +#ifdef AUTOBOOST_NUMERIC_FUNCTIONAL_STD_VALARRAY_SUPPORT +# include +#endif + +#ifdef AUTOBOOST_NUMERIC_FUNCTIONAL_STD_COMPLEX_SUPPORT +# include +#endif + +/// INTERNAL ONLY +/// +#define AUTOBOOST_NUMERIC_FUNCTIONAL_HPP_INCLUDED + +#ifdef AUTOBOOST_NUMERIC_FUNCTIONAL_DOXYGEN_INVOKED +// Hack to make Doxygen show the inheritance relationships +/// INTERNAL ONLY +/// +namespace std +{ + /// INTERNAL ONLY + /// + template struct unary_function {}; + /// INTERNAL ONLY + /// + template struct binary_function {}; +} +#endif + +namespace autoboost { namespace numeric +{ + namespace functional + { + /// INTERNAL ONLY + /// + template + struct are_integral + : mpl::and_, is_integral > + {}; + + template + struct left_ref + { + typedef Left &type; + }; + + namespace detail + { + template + T &lvalue_of(); + } + } + + // TODO: handle complex weight, valarray, MTL vectors + + /// INTERNAL ONLY + /// +#define AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(Name, Op) \ + namespace functional \ + { \ + template \ + struct result_of_ ## Name \ + { \ + AUTOBOOST_TYPEOF_NESTED_TYPEDEF_TPL( \ + nested \ + , Op autoboost::numeric::functional::detail::lvalue_of() \ + ) \ + typedef typename nested::type type; \ + }; \ + template \ + struct Name ## _base \ + : std::unary_function< \ + typename remove_const::type \ + , typename result_of_ ## Name::type \ + > \ + { \ + typename result_of_ ## Name::type operator ()(Arg &arg) const \ + { \ + return Op arg; \ + } \ + }; \ + template \ + struct Name \ + : Name ## _base \ + {}; \ + } \ + namespace op \ + { \ + struct Name \ + : autoboost::detail::function1 > > \ + {}; \ + } \ + namespace \ + { \ + op::Name const &Name = autoboost::detail::pod_singleton::instance; \ + } \ + /**/ + + /// INTERNAL ONLY + /// +#define AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(Name, Op, RetType) \ + namespace functional \ + { \ + template \ + struct result_of_ ## Name \ + { \ + RetType(Left, Op, Right) \ + }; \ + template \ + struct Name ## _base \ + : std::binary_function< \ + typename remove_const::type \ + , typename remove_const::type \ + , typename result_of_ ## Name::type \ + > \ + { \ + typename result_of_ ## Name::type \ + operator ()(Left &left, Right &right) const \ + { \ + return left Op right; \ + } \ + }; \ + template \ + struct Name \ + : Name ## _base \ + {}; \ + } \ + namespace op \ + { \ + struct Name \ + : autoboost::detail::function2< \ + functional::Name<_1, _2, functional::tag<_1>, functional::tag<_2> > \ + > \ + {}; \ + } \ + namespace \ + { \ + op::Name const &Name = autoboost::detail::pod_singleton::instance; \ + } \ + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(Name) \ + /**/ + + /// INTERNAL ONLY + /// +#define AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED(Left, Op, Right) \ + AUTOBOOST_TYPEOF_NESTED_TYPEDEF_TPL( \ + nested \ + , autoboost::numeric::functional::detail::lvalue_of() Op \ + autoboost::numeric::functional::detail::lvalue_of() \ + ) \ + typedef typename nested::type type; \ + /**/ + + /// INTERNAL ONLY + /// +#define AUTOBOOST_NUMERIC_FUNCTIONAL_LEFT(Left, Op, Right) \ + typedef Left &type; \ + /**/ + + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(plus, +, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(minus, -, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(multiplies, *, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(divides, /, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(modulus, %, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(greater, >, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(greater_equal, >=, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(less, <, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(less_equal, <=, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(equal_to, ==, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(not_equal_to, !=, AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED) + + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(assign, =, AUTOBOOST_NUMERIC_FUNCTIONAL_LEFT) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(plus_assign, +=, AUTOBOOST_NUMERIC_FUNCTIONAL_LEFT) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(minus_assign, -=, AUTOBOOST_NUMERIC_FUNCTIONAL_LEFT) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(multiplies_assign, *=, AUTOBOOST_NUMERIC_FUNCTIONAL_LEFT) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(divides_assign, /=, AUTOBOOST_NUMERIC_FUNCTIONAL_LEFT) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP(modulus_assign, %=, AUTOBOOST_NUMERIC_FUNCTIONAL_LEFT) + + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(unary_plus, +) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(unary_minus, -) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(complement, ~) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP(logical_not, !) + +#undef AUTOBOOST_NUMERIC_FUNCTIONAL_LEFT +#undef AUTOBOOST_NUMERIC_FUNCTIONAL_DEDUCED +#undef AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_UNARY_OP +#undef AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_BINARY_OP + + namespace functional + { + template + struct min_assign_base + : std::binary_function + { + void operator ()(Left &left, Right &right) const + { + if(numeric::less(right, left)) + { + left = right; + } + } + }; + + template + struct max_assign_base + : std::binary_function + { + void operator ()(Left &left, Right &right) const + { + if(numeric::greater(right, left)) + { + left = right; + } + } + }; + + template + struct fdiv_base + : functional::divides + {}; + + // partial specialization that promotes the arguments to double for + // integral division. + template + struct fdiv_base >::type> + : functional::divides + {}; + + template + struct promote_base + : std::unary_function + { + To operator ()(From &from) const + { + return from; + } + }; + + template + struct promote_base + : std::unary_function + { + ToFrom &operator ()(ToFrom &tofrom) + { + return tofrom; + } + }; + + template + struct as_min_base + : std::unary_function::type> + { + AUTOBOOST_STATIC_ASSERT(std::numeric_limits::type>::is_specialized); + + typename remove_const::type operator ()(Arg &) const + { + return (std::numeric_limits::type>::min)(); + } + }; + + template + struct as_min_base >::type> + : std::unary_function::type> + { + AUTOBOOST_STATIC_ASSERT(std::numeric_limits::type>::is_specialized); + + typename remove_const::type operator ()(Arg &) const + { + return -(std::numeric_limits::type>::max)(); + } + }; + + template + struct as_max_base + : std::unary_function::type> + { + AUTOBOOST_STATIC_ASSERT(std::numeric_limits::type>::is_specialized); + + typename remove_const::type operator ()(Arg &) const + { + return (std::numeric_limits::type>::max)(); + } + }; + + template + struct as_zero_base + : std::unary_function::type> + { + typename remove_const::type operator ()(Arg &) const + { + return numeric::zero::type>::value; + } + }; + + template + struct as_one_base + : std::unary_function::type> + { + typename remove_const::type operator ()(Arg &) const + { + return numeric::one::type>::value; + } + }; + + template + struct promote + : promote_base + {}; + + template + struct min_assign + : min_assign_base + {}; + + template + struct max_assign + : max_assign_base + {}; + + template + struct fdiv + : fdiv_base + {}; + + /// INTERNAL ONLY + /// For back-compat only. Use fdiv. + template + struct average + : fdiv + {}; + + template + struct as_min + : as_min_base + {}; + + template + struct as_max + : as_max_base + {}; + + template + struct as_zero + : as_zero_base + {}; + + template + struct as_one + : as_one_base + {}; + } + + namespace op + { + template + struct promote + : autoboost::detail::function1::type, functional::tag<_> > > + {}; + + struct min_assign + : autoboost::detail::function2, functional::tag<_2> > > + {}; + + struct max_assign + : autoboost::detail::function2, functional::tag<_2> > > + {}; + + struct fdiv + : autoboost::detail::function2, functional::tag<_2> > > + {}; + + /// INTERNAL ONLY + struct average + : autoboost::detail::function2, functional::tag<_2> > > + {}; + + struct as_min + : autoboost::detail::function1 > > + {}; + + struct as_max + : autoboost::detail::function1 > > + {}; + + struct as_zero + : autoboost::detail::function1 > > + {}; + + struct as_one + : autoboost::detail::function1 > > + {}; + } + + namespace + { + op::min_assign const &min_assign = autoboost::detail::pod_singleton::instance; + op::max_assign const &max_assign = autoboost::detail::pod_singleton::instance; + op::fdiv const &fdiv = autoboost::detail::pod_singleton::instance; + op::fdiv const &average = autoboost::detail::pod_singleton::instance; ///< INTERNAL ONLY + op::as_min const &as_min = autoboost::detail::pod_singleton::instance; + op::as_max const &as_max = autoboost::detail::pod_singleton::instance; + op::as_zero const &as_zero = autoboost::detail::pod_singleton::instance; + op::as_one const &as_one = autoboost::detail::pod_singleton::instance; + + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(min_assign) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(max_assign) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(fdiv) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(average) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(as_min) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(as_max) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(as_zero) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(as_one) + } + + /////////////////////////////////////////////////////////////////////////////// + // promote + template + typename lazy_disable_if, mpl::if_, To &, To> >::type + promote(From &from) + { + return functional::promote()(from); + } + + template + typename mpl::if_, To const &, To const>::type + promote(From const &from) + { + return functional::promote()(from); + } + + template + struct default_ + { + typedef default_ type; + typedef T value_type; + static T const value; + + operator T const & () const + { + return default_::value; + } + }; + + template + T const default_::value = T(); + + template + struct one + { + typedef one type; + typedef T value_type; + static T const value; + + operator T const & () const + { + return one::value; + } + }; + + template + T const one::value = T(1); + + template + struct zero + { + typedef zero type; + typedef T value_type; + static T const value; + + operator T const & () const + { + return zero::value; + } + }; + + template + T const zero::value = T(); + + template + struct one_or_default + : mpl::if_, default_, one >::type + {}; + + template + struct zero_or_default + : mpl::if_, default_, zero >::type + {}; + +}} // namespace autoboost::numeric + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/numeric/functional/complex.hpp b/contrib/autoboost/autoboost/accumulators/numeric/functional/complex.hpp new file mode 100644 index 000000000..a854dc00a --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/functional/complex.hpp @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file complex.hpp +/// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_NUMERIC_FUNCTIONAL_COMPLEX_HPP_EAN_01_17_2006 +#define AUTOBOOST_NUMERIC_FUNCTIONAL_COMPLEX_HPP_EAN_01_17_2006 + +#ifdef AUTOBOOST_NUMERIC_FUNCTIONAL_HPP_INCLUDED +# error Include this file before boost/accumulators/numeric/functional.hpp +#endif + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace numeric { namespace operators +{ + // So that the stats compile when Sample type is std::complex + template + typename + disable_if< + mpl::or_, is_same, U> > + , std::complex + >::type + operator *(std::complex ri, U const &u) + { + // BUGBUG promote result to typeof(T()*u) ? + return ri *= static_cast(u); + } + + template + typename + disable_if< + mpl::or_, is_same, U> > + , std::complex + >::type + operator /(std::complex ri, U const &u) + { + // BUGBUG promote result to typeof(T()*u) ? + return ri /= static_cast(u); + } + +}}} // namespace autoboost::numeric::operators + +namespace autoboost { namespace numeric +{ + namespace detail + { + template + struct one_complex + { + static std::complex const value; + }; + + template + std::complex const one_complex::value + = std::complex(numeric::one::value, numeric::one::value); + } + + /// INTERNAL ONLY + /// + template + struct one > + : detail::one_complex + { + typedef one type; + typedef std::complex value_type; + operator value_type const & () const + { + return detail::one_complex::value; + } + }; + +}} // namespace autoboost::numeric + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/numeric/functional/valarray.hpp b/contrib/autoboost/autoboost/accumulators/numeric/functional/valarray.hpp new file mode 100644 index 000000000..334afc69f --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/functional/valarray.hpp @@ -0,0 +1,360 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file valarray.hpp +/// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_NUMERIC_FUNCTIONAL_VALARRAY_HPP_EAN_12_12_2005 +#define AUTOBOOST_NUMERIC_FUNCTIONAL_VALARRAY_HPP_EAN_12_12_2005 + +#ifdef AUTOBOOST_NUMERIC_FUNCTIONAL_HPP_INCLUDED +# error Include this file before boost/accumulators/numeric/functional.hpp +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace numeric +{ + namespace operators + { + namespace acc_detail + { + template + struct make_valarray + { + typedef std::valarray type; + }; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle valarray / Right where Right is a scalar and Right != Left. + template + typename lazy_enable_if< + mpl::and_, mpl::not_ > > + , acc_detail::make_valarray > + >::type + operator /(std::valarray const &left, Right const &right) + { + typedef typename functional::divides::result_type value_type; + std::valarray result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::divides(left[i], right); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle valarray * Right where Right is a scalar and Right != Left. + template + typename lazy_enable_if< + mpl::and_, mpl::not_ > > + , acc_detail::make_valarray > + >::type + operator *(std::valarray const &left, Right const &right) + { + typedef typename functional::multiplies::result_type value_type; + std::valarray result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::multiplies(left[i], right); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle valarray + valarray where Right != Left. + template + typename lazy_disable_if< + is_same + , acc_detail::make_valarray > + >::type + operator +(std::valarray const &left, std::valarray const &right) + { + typedef typename functional::plus::result_type value_type; + std::valarray result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::plus(left[i], right[i]); + } + return result; + } + } + + namespace functional + { + struct std_valarray_tag; + + template + struct tag > + { + typedef std_valarray_tag type; + }; + + #ifdef __GLIBCXX__ + template + struct tag > + { + typedef std_valarray_tag type; + }; + #endif + + /// INTERNAL ONLY + /// + // This is necessary because the GCC stdlib uses expression templates, and + // typeof(som-valarray-expression) is not an instance of std::valarray + #define AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(Name, Op) \ + template \ + struct Name \ + : std::binary_function< \ + Left \ + , Right \ + , std::valarray< \ + typename Name< \ + typename Left::value_type \ + , typename Right::value_type \ + >::result_type \ + > \ + > \ + { \ + typedef typename Left::value_type left_value_type; \ + typedef typename Right::value_type right_value_type; \ + typedef \ + std::valarray< \ + typename Name::result_type \ + > \ + result_type; \ + result_type \ + operator ()(Left &left, Right &right) const \ + { \ + return numeric::promote >(left) \ + Op numeric::promote >(right); \ + } \ + }; \ + template \ + struct Name \ + : std::binary_function< \ + Left \ + , Right \ + , std::valarray< \ + typename Name::result_type \ + > \ + > \ + { \ + typedef typename Left::value_type left_value_type; \ + typedef \ + std::valarray< \ + typename Name::result_type \ + > \ + result_type; \ + result_type \ + operator ()(Left &left, Right &right) const \ + { \ + return numeric::promote >(left) Op right;\ + } \ + }; \ + template \ + struct Name \ + : std::binary_function< \ + Left \ + , Right \ + , std::valarray< \ + typename Name::result_type \ + > \ + > \ + { \ + typedef typename Right::value_type right_value_type; \ + typedef \ + std::valarray< \ + typename Name::result_type \ + > \ + result_type; \ + result_type \ + operator ()(Left &left, Right &right) const \ + { \ + return left Op numeric::promote >(right);\ + } \ + }; + + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(plus, +) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(minus, -) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(multiplies, *) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(divides, /) + AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP(modulus, %) + + #undef AUTOBOOST_NUMERIC_FUNCTIONAL_DEFINE_VALARRAY_BIN_OP + + /////////////////////////////////////////////////////////////////////////////// + // element-wise min of std::valarray + template + struct min_assign + : std::binary_function + { + void operator ()(Left &left, Right &right) const + { + AUTOBOOST_ASSERT(left.size() == right.size()); + for(std::size_t i = 0, size = left.size(); i != size; ++i) + { + if(numeric::less(right[i], left[i])) + { + left[i] = right[i]; + } + } + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // element-wise max of std::valarray + template + struct max_assign + : std::binary_function + { + void operator ()(Left &left, Right &right) const + { + AUTOBOOST_ASSERT(left.size() == right.size()); + for(std::size_t i = 0, size = left.size(); i != size; ++i) + { + if(numeric::greater(right[i], left[i])) + { + left[i] = right[i]; + } + } + } + }; + + // partial specialization of numeric::fdiv<> for std::valarray. + template + struct fdiv + : mpl::if_< + are_integral + , divides + , divides + >::type + {}; + + // promote + template + struct promote + : std::unary_function + { + To operator ()(From &arr) const + { + typename remove_const::type res(arr.size()); + for(std::size_t i = 0, size = arr.size(); i != size; ++i) + { + res[i] = numeric::promote(arr[i]); + } + return res; + } + }; + + template + struct promote + : std::unary_function + { + ToFrom &operator ()(ToFrom &tofrom) const + { + return tofrom; + } + }; + + // for "promoting" a std::valarray to a bool, useful for + // comparing 2 valarrays for equality: + // if(numeric::promote(a == b)) + template + struct promote + : std::unary_function + { + bool operator ()(From &arr) const + { + AUTOBOOST_MPL_ASSERT((is_same)); + for(std::size_t i = 0, size = arr.size(); i != size; ++i) + { + if(!arr[i]) + { + return false; + } + } + return true; + } + }; + + template + struct promote + : promote + {}; + + /////////////////////////////////////////////////////////////////////////////// + // functional::as_min + template + struct as_min + : std::unary_function::type> + { + typename remove_const::type operator ()(T &arr) const + { + return 0 == arr.size() + ? T() + : T(numeric::as_min(arr[0]), arr.size()); + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // functional::as_max + template + struct as_max + : std::unary_function::type> + { + typename remove_const::type operator ()(T &arr) const + { + return 0 == arr.size() + ? T() + : T(numeric::as_max(arr[0]), arr.size()); + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // functional::as_zero + template + struct as_zero + : std::unary_function::type> + { + typename remove_const::type operator ()(T &arr) const + { + return 0 == arr.size() + ? T() + : T(numeric::as_zero(arr[0]), arr.size()); + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // functional::as_one + template + struct as_one + : std::unary_function::type> + { + typename remove_const::type operator ()(T &arr) const + { + return 0 == arr.size() + ? T() + : T(numeric::as_one(arr[0]), arr.size()); + } + }; + + } // namespace functional + +}} // namespace autoboost::numeric + +#endif + diff --git a/contrib/autoboost/autoboost/accumulators/numeric/functional/vector.hpp b/contrib/autoboost/autoboost/accumulators/numeric/functional/vector.hpp new file mode 100644 index 000000000..bfccab799 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/functional/vector.hpp @@ -0,0 +1,329 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file vector.hpp +/// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_NUMERIC_FUNCTIONAL_VECTOR_HPP_EAN_12_12_2005 +#define AUTOBOOST_NUMERIC_FUNCTIONAL_VECTOR_HPP_EAN_12_12_2005 + +#ifdef AUTOBOOST_NUMERIC_FUNCTIONAL_HPP_INCLUDED +# error Include this file before boost/accumulators/numeric/functional.hpp +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace numeric +{ + namespace operators + { + namespace acc_detail + { + template + struct make_vector + { + typedef std::vector type; + }; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle vector / Right where Right is a scalar. + template + typename lazy_enable_if< + is_scalar + , acc_detail::make_vector > + >::type + operator /(std::vector const &left, Right const &right) + { + typedef typename functional::divides::result_type value_type; + std::vector result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::divides(left[i], right); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle vector / vector. + template + std::vector::result_type> + operator /(std::vector const &left, std::vector const &right) + { + typedef typename functional::divides::result_type value_type; + std::vector result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::divides(left[i], right[i]); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle vector * Right where Right is a scalar. + template + typename lazy_enable_if< + is_scalar + , acc_detail::make_vector > + >::type + operator *(std::vector const &left, Right const &right) + { + typedef typename functional::multiplies::result_type value_type; + std::vector result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::multiplies(left[i], right); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle Left * vector where Left is a scalar. + template + typename lazy_enable_if< + is_scalar + , acc_detail::make_vector > + >::type + operator *(Left const &left, std::vector const &right) + { + typedef typename functional::multiplies::result_type value_type; + std::vector result(right.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::multiplies(left, right[i]); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle vector * vector + template + std::vector::result_type> + operator *(std::vector const &left, std::vector const &right) + { + typedef typename functional::multiplies::result_type value_type; + std::vector result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::multiplies(left[i], right[i]); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle vector + vector + template + std::vector::result_type> + operator +(std::vector const &left, std::vector const &right) + { + typedef typename functional::plus::result_type value_type; + std::vector result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::plus(left[i], right[i]); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle vector - vector + template + std::vector::result_type> + operator -(std::vector const &left, std::vector const &right) + { + typedef typename functional::minus::result_type value_type; + std::vector result(left.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::minus(left[i], right[i]); + } + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle vector += vector + template + std::vector & + operator +=(std::vector &left, std::vector const &right) + { + AUTOBOOST_ASSERT(left.size() == right.size()); + for(std::size_t i = 0, size = left.size(); i != size; ++i) + { + numeric::plus_assign(left[i], right[i]); + } + return left; + } + + /////////////////////////////////////////////////////////////////////////////// + // Handle -vector + template + std::vector::result_type> + operator -(std::vector const &arg) + { + typedef typename functional::unary_minus::result_type value_type; + std::vector result(arg.size()); + for(std::size_t i = 0, size = result.size(); i != size; ++i) + { + result[i] = numeric::unary_minus(arg[i]); + } + return result; + } + } + + namespace functional + { + struct std_vector_tag; + + template + struct tag > + { + typedef std_vector_tag type; + }; + + /////////////////////////////////////////////////////////////////////////////// + // element-wise min of std::vector + template + struct min_assign + : std::binary_function + { + void operator ()(Left &left, Right &right) const + { + AUTOBOOST_ASSERT(left.size() == right.size()); + for(std::size_t i = 0, size = left.size(); i != size; ++i) + { + if(numeric::less(right[i], left[i])) + { + left[i] = right[i]; + } + } + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // element-wise max of std::vector + template + struct max_assign + : std::binary_function + { + void operator ()(Left &left, Right &right) const + { + AUTOBOOST_ASSERT(left.size() == right.size()); + for(std::size_t i = 0, size = left.size(); i != size; ++i) + { + if(numeric::greater(right[i], left[i])) + { + left[i] = right[i]; + } + } + } + }; + + // partial specialization for std::vector. + template + struct fdiv + : mpl::if_< + are_integral + , divides + , divides + >::type + {}; + + // promote + template + struct promote + : std::unary_function + { + To operator ()(From &arr) const + { + typename remove_const::type res(arr.size()); + for(std::size_t i = 0, size = arr.size(); i != size; ++i) + { + res[i] = numeric::promote(arr[i]); + } + return res; + } + }; + + template + struct promote + : std::unary_function + { + ToFrom &operator ()(ToFrom &tofrom) const + { + return tofrom; + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // functional::as_min + template + struct as_min + : std::unary_function::type> + { + typename remove_const::type operator ()(T &arr) const + { + return 0 == arr.size() + ? T() + : T(arr.size(), numeric::as_min(arr[0])); + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // functional::as_max + template + struct as_max + : std::unary_function::type> + { + typename remove_const::type operator ()(T &arr) const + { + return 0 == arr.size() + ? T() + : T(arr.size(), numeric::as_max(arr[0])); + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // functional::as_zero + template + struct as_zero + : std::unary_function::type> + { + typename remove_const::type operator ()(T &arr) const + { + return 0 == arr.size() + ? T() + : T(arr.size(), numeric::as_zero(arr[0])); + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // functional::as_one + template + struct as_one + : std::unary_function::type> + { + typename remove_const::type operator ()(T &arr) const + { + return 0 == arr.size() + ? T() + : T(arr.size(), numeric::as_one(arr[0])); + } + }; + + } // namespace functional + +}} // namespace autoboost::numeric + +#endif + diff --git a/contrib/autoboost/autoboost/accumulators/numeric/functional_fwd.hpp b/contrib/autoboost/autoboost/accumulators/numeric/functional_fwd.hpp new file mode 100644 index 000000000..920fac8cb --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/numeric/functional_fwd.hpp @@ -0,0 +1,221 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file functional_fwd.hpp +/// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_NUMERIC_FUNCTIONAL_FWD_HPP_EAN_08_12_2005 +#define AUTOBOOST_NUMERIC_FUNCTIONAL_FWD_HPP_EAN_08_12_2005 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace numeric +{ + // For using directives -- this namespace may be re-opened elsewhere + namespace operators + {} + + namespace op + { + using mpl::_; + using mpl::_1; + using mpl::_2; + } + + namespace functional + { + using namespace operators; + + template + struct tag + { + typedef void type; + }; + + template + struct tag + : tag + {}; + + template + struct tag + : tag + {}; + + template + struct tag + : tag + {}; + + template + struct static_; + + template + struct are_integral; + } + + /// INTERNAL ONLY + /// +#define AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(Name, Op) \ + namespace functional \ + { \ + template \ + struct Name ## _base; \ + template::type> \ + struct Name; \ + } \ + namespace op \ + { \ + struct Name; \ + } \ + namespace \ + { \ + extern op::Name const &Name; \ + } + + /// INTERNAL ONLY + /// +#define AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(Name) \ + namespace functional \ + { \ + template \ + struct result_of_ ## Name; \ + template \ + struct Name ## _base; \ + template< \ + typename Left \ + , typename Right \ + , typename LeftTag = typename tag::type \ + , typename RightTag = typename tag::type \ + > \ + struct Name; \ + } \ + namespace op \ + { \ + struct Name; \ + } \ + namespace \ + { \ + extern op::Name const &Name; \ + } + + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(plus) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(minus) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(multiplies) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(divides) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(modulus) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(greater) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(greater_equal) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(less) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(less_equal) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(equal_to) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(not_equal_to) + + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(assign) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(plus_assign) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(minus_assign) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(multiplies_assign) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(divides_assign) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP(modulus_assign) + + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(unary_plus, +) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(unary_minus, -) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(complement, ~) + AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP(logical_not, !) + +#undef AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_UNARY_OP +#undef AUTOBOOST_NUMERIC_FUNCTIONAL_DECLARE_BINARY_OP + + + namespace functional + { + template + struct promote_base; + template + struct min_assign_base; + template + struct max_assign_base; + template + struct fdiv_base; + template + struct as_min_base; + template + struct as_max_base; + template + struct as_zero_base; + template + struct as_one_base; + + template::type, typename FromTag = typename tag::type> + struct promote; + template::type, typename RightTag = typename tag::type> + struct min_assign; + template::type, typename RightTag = typename tag::type> + struct max_assign; + template::type, typename RightTag = typename tag::type> + struct fdiv; + template::type> + struct as_min; + template::type> + struct as_max; + template::type> + struct as_zero; + template::type> + struct as_one; + } + + namespace op + { + template + struct promote; + struct min_assign; + struct max_assign; + struct fdiv; + struct as_min; + struct as_max; + struct as_zero; + struct as_one; + } + + namespace + { + extern op::min_assign const &min_assign; + extern op::max_assign const &max_assign; + extern op::fdiv const &fdiv; + extern op::as_min const &as_min; + extern op::as_max const &as_max; + extern op::as_zero const &as_zero; + extern op::as_one const &as_one; + } + + template + typename lazy_disable_if, mpl::if_, To &, To> >::type + promote(From &from); + + template + typename mpl::if_, To const &, To const>::type + promote(From const &from); + + template + struct default_; + + template + struct one; + + template + struct zero; + + template + struct one_or_default; + + template + struct zero_or_default; + +}} // namespace autoboost::numeric + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/statistics/count.hpp b/contrib/autoboost/autoboost/accumulators/statistics/count.hpp new file mode 100644 index 000000000..6966c8eec --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/statistics/count.hpp @@ -0,0 +1,80 @@ +/////////////////////////////////////////////////////////////////////////////// +// count.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_STATISTICS_COUNT_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_STATISTICS_COUNT_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace impl +{ + + /////////////////////////////////////////////////////////////////////////////// + // count_impl + struct count_impl + : accumulator_base + { + // for autoboost::result_of + typedef std::size_t result_type; + + count_impl(dont_care) + : cnt(0) + { + } + + void operator ()(dont_care) + { + ++this->cnt; + } + + result_type result(dont_care) const + { + return this->cnt; + } + + private: + std::size_t cnt; + }; + +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// tag::count +// +namespace tag +{ + struct count + : depends_on<> + { + /// INTERNAL ONLY + /// + typedef mpl::always impl; + }; +} + +/////////////////////////////////////////////////////////////////////////////// +// extract::count +// +namespace extract +{ + extractor const count = {}; + + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(count) +} + +using extract::count; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/statistics/max.hpp b/contrib/autoboost/autoboost/accumulators/statistics/max.hpp new file mode 100644 index 000000000..311370b17 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/statistics/max.hpp @@ -0,0 +1,85 @@ +/////////////////////////////////////////////////////////////////////////////// +// max.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_STATISTICS_MAX_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_STATISTICS_MAX_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace impl +{ + /////////////////////////////////////////////////////////////////////////////// + // max_impl + template + struct max_impl + : accumulator_base + { + // for autoboost::result_of + typedef Sample result_type; + + template + max_impl(Args const &args) + : max_(numeric::as_min(args[sample | Sample()])) + { + } + + template + void operator ()(Args const &args) + { + numeric::max_assign(this->max_, args[sample]); + } + + result_type result(dont_care) const + { + return this->max_; + } + + private: + Sample max_; + }; + +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// tag::max +// +namespace tag +{ + struct max + : depends_on<> + { + /// INTERNAL ONLY + /// + typedef accumulators::impl::max_impl impl; + }; +} + +/////////////////////////////////////////////////////////////////////////////// +// extract::max +// +namespace extract +{ + extractor const max = {}; + + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(max) +} + +using extract::max; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/statistics/mean.hpp b/contrib/autoboost/autoboost/accumulators/statistics/mean.hpp new file mode 100644 index 000000000..a989e943f --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/statistics/mean.hpp @@ -0,0 +1,298 @@ +/////////////////////////////////////////////////////////////////////////////// +// mean.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_STATISTICS_MEAN_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_STATISTICS_MEAN_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace impl +{ + /////////////////////////////////////////////////////////////////////////////// + // mean_impl + // lazy, by default + template + struct mean_impl + : accumulator_base + { + // for autoboost::result_of + typedef typename numeric::functional::fdiv::result_type result_type; + + mean_impl(dont_care) {} + + template + result_type result(Args const &args) const + { + extractor sum; + return numeric::fdiv(sum(args), count(args)); + } + }; + + template + struct immediate_mean_impl + : accumulator_base + { + // for autoboost::result_of + typedef typename numeric::functional::fdiv::result_type result_type; + + template + immediate_mean_impl(Args const &args) + : mean(numeric::fdiv(args[sample | Sample()], numeric::one::value)) + { + } + + template + void operator ()(Args const &args) + { + std::size_t cnt = count(args); + this->mean = numeric::fdiv( + (this->mean * (cnt - 1)) + args[parameter::keyword::get()] + , cnt + ); + } + + result_type result(dont_care) const + { + return this->mean; + } + + private: + result_type mean; + }; + +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// tag::mean +// tag::immediate_mean +// tag::mean_of_weights +// tag::immediate_mean_of_weights +// tag::mean_of_variates +// tag::immediate_mean_of_variates +// +namespace tag +{ + struct mean + : depends_on + { + /// INTERNAL ONLY + /// + typedef accumulators::impl::mean_impl impl; + }; + struct immediate_mean + : depends_on + { + /// INTERNAL ONLY + /// + typedef accumulators::impl::immediate_mean_impl impl; + }; + struct mean_of_weights + : depends_on + { + typedef mpl::true_ is_weight_accumulator; + /// INTERNAL ONLY + /// + typedef accumulators::impl::mean_impl impl; + }; + struct immediate_mean_of_weights + : depends_on + { + typedef mpl::true_ is_weight_accumulator; + /// INTERNAL ONLY + /// + typedef accumulators::impl::immediate_mean_impl impl; + }; + template + struct mean_of_variates + : depends_on > + { + /// INTERNAL ONLY + /// + typedef mpl::always > > impl; + }; + template + struct immediate_mean_of_variates + : depends_on + { + /// INTERNAL ONLY + /// + typedef mpl::always > impl; + }; +} + +/////////////////////////////////////////////////////////////////////////////// +// extract::mean +// extract::mean_of_weights +// extract::mean_of_variates +// +namespace extract +{ + extractor const mean = {}; + extractor const mean_of_weights = {}; + AUTOBOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, mean_of_variates, (typename)(typename)) + + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(mean) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(mean_of_weights) +} + +using extract::mean; +using extract::mean_of_weights; +using extract::mean_of_variates; + +// mean(lazy) -> mean +template<> +struct as_feature +{ + typedef tag::mean type; +}; + +// mean(immediate) -> immediate_mean +template<> +struct as_feature +{ + typedef tag::immediate_mean type; +}; + +// mean_of_weights(lazy) -> mean_of_weights +template<> +struct as_feature +{ + typedef tag::mean_of_weights type; +}; + +// mean_of_weights(immediate) -> immediate_mean_of_weights +template<> +struct as_feature +{ + typedef tag::immediate_mean_of_weights type; +}; + +// mean_of_variates(lazy) -> mean_of_variates +template +struct as_feature(lazy)> +{ + typedef tag::mean_of_variates type; +}; + +// mean_of_variates(immediate) -> immediate_mean_of_variates +template +struct as_feature(immediate)> +{ + typedef tag::immediate_mean_of_variates type; +}; + +// for the purposes of feature-based dependency resolution, +// immediate_mean provides the same feature as mean +template<> +struct feature_of + : feature_of +{ +}; + +// for the purposes of feature-based dependency resolution, +// immediate_mean provides the same feature as mean +template<> +struct feature_of + : feature_of +{ +}; + +// for the purposes of feature-based dependency resolution, +// immediate_mean provides the same feature as mean +template +struct feature_of > + : feature_of > +{ +}; + +// So that mean can be automatically substituted with +// weighted_mean when the weight parameter is non-void. +template<> +struct as_weighted_feature +{ + typedef tag::weighted_mean type; +}; + +template<> +struct feature_of + : feature_of +{}; + +// So that immediate_mean can be automatically substituted with +// immediate_weighted_mean when the weight parameter is non-void. +template<> +struct as_weighted_feature +{ + typedef tag::immediate_weighted_mean type; +}; + +template<> +struct feature_of + : feature_of +{}; + +// So that mean_of_weights<> can be automatically substituted with +// weighted_mean_of_variates<> when the weight parameter is non-void. +template +struct as_weighted_feature > +{ + typedef tag::weighted_mean_of_variates type; +}; + +template +struct feature_of > + : feature_of > +{ +}; + +// So that immediate_mean_of_weights<> can be automatically substituted with +// immediate_weighted_mean_of_variates<> when the weight parameter is non-void. +template +struct as_weighted_feature > +{ + typedef tag::immediate_weighted_mean_of_variates type; +}; + +template +struct feature_of > + : feature_of > +{ +}; + +//////////////////////////////////////////////////////////////////////////// +//// droppable_accumulator +//// need to specialize droppable lazy mean to cache the result at the +//// point the accumulator is dropped. +///// INTERNAL ONLY +///// +//template +//struct droppable_accumulator > +// : droppable_accumulator_base< +// with_cached_result > +// > +//{ +// template +// droppable_accumulator(Args const &args) +// : droppable_accumulator::base(args) +// { +// } +//}; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/statistics/min.hpp b/contrib/autoboost/autoboost/accumulators/statistics/min.hpp new file mode 100644 index 000000000..fe191f33b --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/statistics/min.hpp @@ -0,0 +1,85 @@ +/////////////////////////////////////////////////////////////////////////////// +// min.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_STATISTICS_MIN_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_STATISTICS_MIN_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace impl +{ + /////////////////////////////////////////////////////////////////////////////// + // min_impl + template + struct min_impl + : accumulator_base + { + // for autoboost::result_of + typedef Sample result_type; + + template + min_impl(Args const &args) + : min_(numeric::as_max(args[sample | Sample()])) + { + } + + template + void operator ()(Args const &args) + { + numeric::min_assign(this->min_, args[sample]); + } + + result_type result(dont_care) const + { + return this->min_; + } + + private: + Sample min_; + }; + +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// tag::min +// +namespace tag +{ + struct min + : depends_on<> + { + /// INTERNAL ONLY + /// + typedef accumulators::impl::min_impl impl; + }; +} + +/////////////////////////////////////////////////////////////////////////////// +// extract::min +// +namespace extract +{ + extractor const min = {}; + + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(min) +} + +using extract::min; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/statistics/sum.hpp b/contrib/autoboost/autoboost/accumulators/statistics/sum.hpp new file mode 100644 index 000000000..41188b852 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/statistics/sum.hpp @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////////////////////////////// +// sum.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_STATISTICS_SUM_HPP_EAN_28_10_2005 +#define AUTOBOOST_ACCUMULATORS_STATISTICS_SUM_HPP_EAN_28_10_2005 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +namespace impl +{ + /////////////////////////////////////////////////////////////////////////////// + // sum_impl + template + struct sum_impl + : accumulator_base + { + // for autoboost::result_of + typedef Sample result_type; + + template + sum_impl(Args const &args) + : sum(args[parameter::keyword::get() | Sample()]) + { + } + + template + void operator ()(Args const &args) + { + // what about overflow? + this->sum += args[parameter::keyword::get()]; + } + + result_type result(dont_care) const + { + return this->sum; + } + + private: + + Sample sum; + }; + +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// tag::sum +// tag::sum_of_weights +// tag::sum_of_variates +// +namespace tag +{ + struct sum + : depends_on<> + { + /// INTERNAL ONLY + /// + typedef accumulators::impl::sum_impl impl; + }; + + struct sum_of_weights + : depends_on<> + { + typedef mpl::true_ is_weight_accumulator; + /// INTERNAL ONLY + /// + typedef accumulators::impl::sum_impl impl; + }; + + template + struct sum_of_variates + : depends_on<> + { + /// INTERNAL ONLY + /// + typedef mpl::always > impl; + }; + + struct abstract_sum_of_variates + : depends_on<> + { + }; +} + +/////////////////////////////////////////////////////////////////////////////// +// extract::sum +// extract::sum_of_weights +// extract::sum_of_variates +// +namespace extract +{ + extractor const sum = {}; + extractor const sum_of_weights = {}; + extractor const sum_of_variates = {}; + + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(sum) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(sum_of_weights) + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(sum_of_variates) +} + +using extract::sum; +using extract::sum_of_weights; +using extract::sum_of_variates; + +// So that mean can be automatically substituted with +// weighted_mean when the weight parameter is non-void. +template<> +struct as_weighted_feature +{ + typedef tag::weighted_sum type; +}; + +template<> +struct feature_of + : feature_of +{}; + +template +struct feature_of > + : feature_of +{ +}; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/accumulators/statistics_fwd.hpp b/contrib/autoboost/autoboost/accumulators/statistics_fwd.hpp new file mode 100644 index 000000000..14aadc3d4 --- /dev/null +++ b/contrib/autoboost/autoboost/accumulators/statistics_fwd.hpp @@ -0,0 +1,432 @@ +/////////////////////////////////////////////////////////////////////////////// +// statistics_fwd.hpp +// +// Copyright 2005 Eric Niebler. 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) + +#ifndef AUTOBOOST_ACCUMULATORS_STATISTICS_STATISTICS_FWD_HPP_EAN_23_11_2005 +#define AUTOBOOST_ACCUMULATORS_STATISTICS_STATISTICS_FWD_HPP_EAN_23_11_2005 + +#include // for mpl::na +#include +#include +#include +#include +#include + +namespace autoboost { namespace accumulators +{ + +/////////////////////////////////////////////////////////////////////////////// +// base struct and base extractor for quantiles +namespace tag +{ + struct quantile + : depends_on<> + { + typedef mpl::print impl; + }; +} +namespace extract +{ + extractor const quantile = {}; + + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(quantile) +} +using extract::quantile; + +/////////////////////////////////////////////////////////////////////////////// +// base struct and base extractor for *coherent* tail means +namespace tag +{ + struct tail_mean + : depends_on<> + { + typedef mpl::print impl; + }; +} +namespace extract +{ + extractor const tail_mean = {}; + + AUTOBOOST_ACCUMULATORS_IGNORE_GLOBAL(tail_mean) +} +using extract::tail_mean; + +namespace tag +{ + /////////////////////////////////////////////////////////////////////////////// + // Variates tags + struct weights; + struct covariate1; + struct covariate2; + + /////////////////////////////////////////////////////////////////////////////// + // Statistic tags + struct count; + template + struct covariance; + struct density; + template + struct error_of; + struct extended_p_square; + struct extended_p_square_quantile; + struct extended_p_square_quantile_quadratic; + struct kurtosis; + struct max; + struct mean; + struct immediate_mean; + struct mean_of_weights; + struct immediate_mean_of_weights; + template + struct mean_of_variates; + template + struct immediate_mean_of_variates; + struct median; + struct with_density_median; + struct with_p_square_cumulative_distribution_median; + struct min; + template + struct moment; + template + struct peaks_over_threshold; + template + struct peaks_over_threshold_prob; + template + struct pot_tail_mean; + template + struct pot_tail_mean_prob; + template + struct pot_quantile; + template + struct pot_quantile_prob; + struct p_square_cumulative_distribution; + struct p_square_quantile; + struct p_square_quantile_for_median; + struct skewness; + struct sum; + struct sum_of_weights; + template + struct sum_of_variates; + struct sum_kahan; + struct sum_of_weights_kahan; + template + struct sum_of_variates_kahan; + template + struct tail; + template + struct coherent_tail_mean; + template + struct non_coherent_tail_mean; + template + struct tail_quantile; + template + struct tail_variate; + template + struct tail_weights; + template + struct right_tail_variate; + template + struct left_tail_variate; + template + struct tail_variate_means; + template + struct absolute_tail_variate_means; + template + struct relative_tail_variate_means; + struct lazy_variance; + struct variance; + template + struct weighted_covariance; + struct weighted_density; + struct weighted_kurtosis; + struct weighted_mean; + struct immediate_weighted_mean; + template + struct weighted_mean_of_variates; + template + struct immediate_weighted_mean_of_variates; + struct weighted_median; + struct with_density_weighted_median; + struct with_p_square_cumulative_distribution_weighted_median; + struct weighted_extended_p_square; + struct weighted_extended_p_square_quantile; + struct weighted_extended_p_square_quantile_quadratic; + template + struct weighted_moment; + template + struct weighted_peaks_over_threshold; + template + struct weighted_peaks_over_threshold_prob; + template + struct weighted_pot_quantile; + template + struct weighted_pot_quantile_prob; + template + struct weighted_pot_tail_mean; + template + struct weighted_pot_tail_mean_prob; + struct weighted_p_square_cumulative_distribution; + struct weighted_p_square_quantile; + struct weighted_p_square_quantile_for_median; + struct weighted_skewness; + template + struct weighted_tail_quantile; + template + struct non_coherent_weighted_tail_mean; + template + struct weighted_tail_quantile; + template + struct weighted_tail_variate_means; + template + struct absolute_weighted_tail_variate_means; + template + struct relative_weighted_tail_variate_means; + struct lazy_weighted_variance; + struct weighted_variance; + struct weighted_sum; + template + struct weighted_sum_of_variates; + struct rolling_window_plus1; + struct rolling_window; + struct rolling_sum; + struct rolling_count; + struct rolling_mean; +} // namespace tag + +namespace impl +{ + /////////////////////////////////////////////////////////////////////////////// + // Statistics impls + struct count_impl; + + template + struct covariance_impl; + + template + struct density_impl; + + template + struct error_of_impl; + + template + struct error_of_mean_impl; + + template + struct extended_p_square_impl; + + template + struct extended_p_square_quantile_impl; + + template + struct kurtosis_impl; + + template + struct max_impl; + + template + struct median_impl; + + template + struct with_density_median_impl; + + template + struct with_p_square_cumulative_distribution_median_impl; + + template + struct min_impl; + + template + struct mean_impl; + + template + struct immediate_mean_impl; + + template + struct moment_impl; + + template + struct peaks_over_threshold_prob_impl; + + template + struct pot_quantile_impl; + + template + struct pot_tail_mean_impl; + + template + struct p_square_cumulative_distribution_impl; + + template + struct p_square_quantile_impl; + + template + struct skewness_impl; + + template + struct sum_impl; + + template + struct sum_kahan_impl; + + template + struct tail_impl; + + template + struct coherent_tail_mean_impl; + + template + struct non_coherent_tail_mean_impl; + + template + struct tail_quantile_impl; + + template + struct tail_variate_impl; + + template + struct tail_variate_means_impl; + + template + struct lazy_variance_impl; + + template + struct variance_impl; + + template + struct weighted_covariance_impl; + + template + struct weighted_density_impl; + + template + struct weighted_kurtosis_impl; + + template + struct weighted_median_impl; + + template + struct with_density_weighted_median_impl; + + template + struct with_p_square_cumulative_distribution_weighted_median_impl; + + template + struct weighted_mean_impl; + + template + struct immediate_weighted_mean_impl; + + template + struct weighted_peaks_over_threshold_impl; + + template + struct weighted_peaks_over_threshold_prob_impl; + + template + struct with_p_square_cumulative_distribution_weighted_median_impl; + + template + struct weighted_extended_p_square_impl; + + template + struct weighted_moment_impl; + + template + struct weighted_p_square_cumulative_distribution_impl; + + template + struct weighted_p_square_quantile_impl; + + template + struct weighted_skewness_impl; + + template + struct weighted_sum_impl; + + template + struct weighted_sum_kahan_impl; + + template + struct non_coherent_weighted_tail_mean_impl; + + template + struct weighted_tail_quantile_impl; + + template + struct weighted_tail_variate_means_impl; + + template + struct lazy_weighted_variance_impl; + + template + struct weighted_variance_impl; + + template + struct rolling_window_plus1_impl; + + template + struct rolling_window_impl; + + template + struct rolling_sum_impl; + + template + struct rolling_count_impl; + + template + struct rolling_mean_impl; +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// stats +// A more descriptive name for an MPL sequence of statistics. +template +struct stats; + +template +struct with_error; + +// modifiers for the mean and variance stats +struct lazy {}; +struct immediate {}; + +// modifiers for the variance stat +// struct fast {}; +// struct accurate {}; + +// modifiers for order +struct right {}; +struct left {}; +// typedef right default_order_tag_type; + +// modifiers for the tail_variate_means stat +struct absolute {}; +struct relative {}; + +// modifiers for median and weighted_median stats +struct with_density {}; +struct with_p_square_cumulative_distribution {}; +struct with_p_square_quantile {}; + +// modifiers for peaks_over_threshold stat +struct with_threshold_value {}; +struct with_threshold_probability {}; + +// modifiers for extended_p_square_quantile and weighted_extended_p_square_quantile stats +struct weighted {}; +struct unweighted {}; +struct linear {}; +struct quadratic {}; + +// modifiers for p_square_quantile +struct regular {}; +struct for_median {}; + +// modifier for sum_kahan, sum_of_weights_kahan, sum_of_variates_kahan, weighted_sum_kahan +struct kahan {}; + +}} // namespace autoboost::accumulators + +#endif diff --git a/contrib/autoboost/autoboost/algorithm/string/case_conv.hpp b/contrib/autoboost/autoboost/algorithm/string/case_conv.hpp new file mode 100644 index 000000000..823971b64 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/case_conv.hpp @@ -0,0 +1,176 @@ +// Boost string_algo library case_conv.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_CASE_CONV_HPP +#define AUTOBOOST_STRING_CASE_CONV_HPP + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +/*! \file + Defines sequence case-conversion algorithms. + Algorithms convert each element in the input sequence to the + desired case using provided locales. +*/ + +namespace autoboost { + namespace algorithm { + +// to_lower -----------------------------------------------// + + //! Convert to lower case + /*! + Each element of the input sequence is converted to lower + case. The result is a copy of the input converted to lower case. + It is returned as a sequence or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input range + \param Loc A locale used for conversion + \return + An output iterator pointing just after the last inserted character or + a copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + + */ + template + inline OutputIteratorT + to_lower_copy( + OutputIteratorT Output, + const RangeT& Input, + const std::locale& Loc=std::locale()) + { + return ::autoboost::algorithm::detail::transform_range_copy( + Output, + ::autoboost::as_literal(Input), + ::autoboost::algorithm::detail::to_lowerF< + typename range_value::type >(Loc)); + } + + //! Convert to lower case + /*! + \overload + */ + template + inline SequenceT to_lower_copy( + const SequenceT& Input, + const std::locale& Loc=std::locale()) + { + return ::autoboost::algorithm::detail::transform_range_copy( + Input, + ::autoboost::algorithm::detail::to_lowerF< + typename range_value::type >(Loc)); + } + + //! Convert to lower case + /*! + Each element of the input sequence is converted to lower + case. The input sequence is modified in-place. + + \param Input A range + \param Loc a locale used for conversion + */ + template + inline void to_lower( + WritableRangeT& Input, + const std::locale& Loc=std::locale()) + { + ::autoboost::algorithm::detail::transform_range( + ::autoboost::as_literal(Input), + ::autoboost::algorithm::detail::to_lowerF< + typename range_value::type >(Loc)); + } + +// to_upper -----------------------------------------------// + + //! Convert to upper case + /*! + Each element of the input sequence is converted to upper + case. The result is a copy of the input converted to upper case. + It is returned as a sequence or copied to the output iterator + + \param Output An output iterator to which the result will be copied + \param Input An input range + \param Loc A locale used for conversion + \return + An output iterator pointing just after the last inserted character or + a copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template + inline OutputIteratorT + to_upper_copy( + OutputIteratorT Output, + const RangeT& Input, + const std::locale& Loc=std::locale()) + { + return ::autoboost::algorithm::detail::transform_range_copy( + Output, + ::autoboost::as_literal(Input), + ::autoboost::algorithm::detail::to_upperF< + typename range_value::type >(Loc)); + } + + //! Convert to upper case + /*! + \overload + */ + template + inline SequenceT to_upper_copy( + const SequenceT& Input, + const std::locale& Loc=std::locale()) + { + return ::autoboost::algorithm::detail::transform_range_copy( + Input, + ::autoboost::algorithm::detail::to_upperF< + typename range_value::type >(Loc)); + } + + //! Convert to upper case + /*! + Each element of the input sequence is converted to upper + case. The input sequence is modified in-place. + + \param Input An input range + \param Loc a locale used for conversion + */ + template + inline void to_upper( + WritableRangeT& Input, + const std::locale& Loc=std::locale()) + { + ::autoboost::algorithm::detail::transform_range( + ::autoboost::as_literal(Input), + ::autoboost::algorithm::detail::to_upperF< + typename range_value::type >(Loc)); + } + + } // namespace algorithm + + // pull names to the boost namespace + using algorithm::to_lower; + using algorithm::to_lower_copy; + using algorithm::to_upper; + using algorithm::to_upper_copy; + +} // namespace autoboost + +#endif // AUTOBOOST_STRING_CASE_CONV_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/classification.hpp b/contrib/autoboost/autoboost/algorithm/string/classification.hpp new file mode 100644 index 000000000..b97da4df8 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/classification.hpp @@ -0,0 +1,312 @@ +// Boost string_algo library classification.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_CLASSIFICATION_HPP +#define AUTOBOOST_STRING_CLASSIFICATION_HPP + +#include +#include +#include +#include +#include +#include + + +/*! \file + Classification predicates are included in the library to give + some more convenience when using algorithms like \c trim() and \c all(). + They wrap functionality of STL classification functions ( e.g. \c std::isspace() ) + into generic functors. +*/ + +namespace autoboost { + namespace algorithm { + +// classification functor generator -------------------------------------// + + //! is_classified predicate + /*! + Construct the \c is_classified predicate. This predicate holds if the input is + of specified \c std::ctype category. + + \param Type A \c std::ctype category + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_classified(std::ctype_base::mask Type, const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(Type, Loc); + } + + //! is_space predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::space category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_space(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::space, Loc); + } + + //! is_alnum predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::alnum category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_alnum(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::alnum, Loc); + } + + //! is_alpha predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::alpha category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_alpha(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::alpha, Loc); + } + + //! is_cntrl predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::cntrl category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_cntrl(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::cntrl, Loc); + } + + //! is_digit predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::digit category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_digit(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::digit, Loc); + } + + //! is_graph predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::graph category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_graph(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::graph, Loc); + } + + //! is_lower predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::lower category. + + \param Loc A locale used for classification + \return An instance of \c is_classified predicate + */ + inline detail::is_classifiedF + is_lower(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::lower, Loc); + } + + //! is_print predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::print category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_print(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::print, Loc); + } + + //! is_punct predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::punct category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_punct(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::punct, Loc); + } + + //! is_upper predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::upper category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_upper(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::upper, Loc); + } + + //! is_xdigit predicate + /*! + Construct the \c is_classified predicate for the \c ctype_base::xdigit category. + + \param Loc A locale used for classification + \return An instance of the \c is_classified predicate + */ + inline detail::is_classifiedF + is_xdigit(const std::locale& Loc=std::locale()) + { + return detail::is_classifiedF(std::ctype_base::xdigit, Loc); + } + + //! is_any_of predicate + /*! + Construct the \c is_any_of predicate. The predicate holds if the input + is included in the specified set of characters. + + \param Set A set of characters to be recognized + \return An instance of the \c is_any_of predicate + */ + template + inline detail::is_any_ofF< + AUTOBOOST_STRING_TYPENAME range_value::type> + is_any_of( const RangeT& Set ) + { + iterator_range::type> lit_set(autoboost::as_literal(Set)); + return detail::is_any_ofF::type>(lit_set); + } + + //! is_from_range predicate + /*! + Construct the \c is_from_range predicate. The predicate holds if the input + is included in the specified range. (i.e. From <= Ch <= To ) + + \param From The start of the range + \param To The end of the range + \return An instance of the \c is_from_range predicate + */ + template + inline detail::is_from_rangeF is_from_range(CharT From, CharT To) + { + return detail::is_from_rangeF(From,To); + } + + // predicate combinators ---------------------------------------------------// + + //! predicate 'and' composition predicate + /*! + Construct the \c class_and predicate. This predicate can be used + to logically combine two classification predicates. \c class_and holds, + if both predicates return true. + + \param Pred1 The first predicate + \param Pred2 The second predicate + \return An instance of the \c class_and predicate + */ + template + inline detail::pred_andF + operator&&( + const predicate_facade& Pred1, + const predicate_facade& Pred2 ) + { + // Doing the static_cast with the pointer instead of the reference + // is a workaround for some compilers which have problems with + // static_cast's of template references, i.e. CW8. /grafik/ + return detail::pred_andF( + *static_cast(&Pred1), + *static_cast(&Pred2) ); + } + + //! predicate 'or' composition predicate + /*! + Construct the \c class_or predicate. This predicate can be used + to logically combine two classification predicates. \c class_or holds, + if one of the predicates return true. + + \param Pred1 The first predicate + \param Pred2 The second predicate + \return An instance of the \c class_or predicate + */ + template + inline detail::pred_orF + operator||( + const predicate_facade& Pred1, + const predicate_facade& Pred2 ) + { + // Doing the static_cast with the pointer instead of the reference + // is a workaround for some compilers which have problems with + // static_cast's of template references, i.e. CW8. /grafik/ + return detail::pred_orF( + *static_cast(&Pred1), + *static_cast(&Pred2)); + } + + //! predicate negation operator + /*! + Construct the \c class_not predicate. This predicate represents a negation. + \c class_or holds if of the predicates return false. + + \param Pred The predicate to be negated + \return An instance of the \c class_not predicate + */ + template + inline detail::pred_notF + operator!( const predicate_facade& Pred ) + { + // Doing the static_cast with the pointer instead of the reference + // is a workaround for some compilers which have problems with + // static_cast's of template references, i.e. CW8. /grafik/ + return detail::pred_notF(*static_cast(&Pred)); + } + + } // namespace algorithm + + // pull names to the boost namespace + using algorithm::is_classified; + using algorithm::is_space; + using algorithm::is_alnum; + using algorithm::is_alpha; + using algorithm::is_cntrl; + using algorithm::is_digit; + using algorithm::is_graph; + using algorithm::is_lower; + using algorithm::is_upper; + using algorithm::is_print; + using algorithm::is_punct; + using algorithm::is_xdigit; + using algorithm::is_any_of; + using algorithm::is_from_range; + +} // namespace autoboost + +#endif // AUTOBOOST_STRING_PREDICATE_HPP diff --git a/contrib/autoboost/boost/algorithm/string/compare.hpp b/contrib/autoboost/autoboost/algorithm/string/compare.hpp similarity index 97% rename from contrib/autoboost/boost/algorithm/string/compare.hpp rename to contrib/autoboost/autoboost/algorithm/string/compare.hpp index 8384a99db..4c31e2d4d 100644 --- a/contrib/autoboost/boost/algorithm/string/compare.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/compare.hpp @@ -8,10 +8,10 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_COMPARE_HPP -#define BOOST_STRING_COMPARE_HPP +#ifndef AUTOBOOST_STRING_COMPARE_HPP +#define AUTOBOOST_STRING_COMPARE_HPP -#include +#include #include /*! \file @@ -196,4 +196,4 @@ namespace autoboost { } // namespace autoboost -#endif // BOOST_STRING_COMPARE_HPP +#endif // AUTOBOOST_STRING_COMPARE_HPP diff --git a/contrib/autoboost/boost/algorithm/string/concept.hpp b/contrib/autoboost/autoboost/algorithm/string/concept.hpp similarity index 88% rename from contrib/autoboost/boost/algorithm/string/concept.hpp rename to contrib/autoboost/autoboost/algorithm/string/concept.hpp index 39a782446..3f98c2484 100644 --- a/contrib/autoboost/boost/algorithm/string/concept.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/concept.hpp @@ -8,13 +8,13 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_CONCEPT_HPP -#define BOOST_STRING_CONCEPT_HPP +#ifndef AUTOBOOST_STRING_CONCEPT_HPP +#define AUTOBOOST_STRING_CONCEPT_HPP -#include -#include -#include -#include +#include +#include +#include +#include /*! \file Defines concepts used in string_algo library @@ -80,4 +80,4 @@ namespace autoboost { -#endif // BOOST_STRING_CONCEPT_HPP +#endif // AUTOBOOST_STRING_CONCEPT_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/config.hpp b/contrib/autoboost/autoboost/algorithm/string/config.hpp new file mode 100644 index 000000000..234c76217 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/config.hpp @@ -0,0 +1,28 @@ +// Boost string_algo library config.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_CONFIG_HPP +#define AUTOBOOST_STRING_CONFIG_HPP + +#include +#include + +#ifdef AUTOBOOST_STRING_DEDUCED_TYPENAME +# error "macro already defined!" +#endif + +#define AUTOBOOST_STRING_TYPENAME AUTOBOOST_DEDUCED_TYPENAME + +// Metrowerks workaround +#if AUTOBOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x +#pragma parse_func_templ off +#endif + +#endif // AUTOBOOST_STRING_CONFIG_HPP diff --git a/contrib/autoboost/boost/algorithm/string/constants.hpp b/contrib/autoboost/autoboost/algorithm/string/constants.hpp similarity index 88% rename from contrib/autoboost/boost/algorithm/string/constants.hpp rename to contrib/autoboost/autoboost/algorithm/string/constants.hpp index 5e0a4474a..44e265ba1 100644 --- a/contrib/autoboost/boost/algorithm/string/constants.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/constants.hpp @@ -8,8 +8,8 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_CONSTANTS_HPP -#define BOOST_STRING_CONSTANTS_HPP +#ifndef AUTOBOOST_STRING_CONSTANTS_HPP +#define AUTOBOOST_STRING_CONSTANTS_HPP namespace autoboost { namespace algorithm { @@ -32,5 +32,5 @@ namespace autoboost { } // namespace autoboost -#endif // BOOST_STRING_CONSTANTS_HPP +#endif // AUTOBOOST_STRING_CONSTANTS_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/detail/case_conv.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/case_conv.hpp new file mode 100644 index 000000000..77cd9a4f7 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/detail/case_conv.hpp @@ -0,0 +1,123 @@ +// Boost string_algo library string_funct.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_CASE_CONV_DETAIL_HPP +#define AUTOBOOST_STRING_CASE_CONV_DETAIL_HPP + +#include +#include +#include + +#include + +namespace autoboost { + namespace algorithm { + namespace detail { + +// case conversion functors -----------------------------------------------// + +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + // a tolower functor + template + struct to_lowerF : public std::unary_function + { + // Constructor + to_lowerF( const std::locale& Loc ) : m_Loc( &Loc ) {} + + // Operation + CharT operator ()( CharT Ch ) const + { + #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) + return std::tolower( static_cast::type> ( Ch )); + #else + return std::tolower( Ch, *m_Loc ); + #endif + } + private: + const std::locale* m_Loc; + }; + + // a toupper functor + template + struct to_upperF : public std::unary_function + { + // Constructor + to_upperF( const std::locale& Loc ) : m_Loc( &Loc ) {} + + // Operation + CharT operator ()( CharT Ch ) const + { + #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) + return std::toupper( static_cast::type> ( Ch )); + #else + return std::toupper( Ch, *m_Loc ); + #endif + } + private: + const std::locale* m_Loc; + }; + +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + +// algorithm implementation ------------------------------------------------------------------------- + + // Transform a range + template + OutputIteratorT transform_range_copy( + OutputIteratorT Output, + const RangeT& Input, + FunctorT Functor) + { + return std::transform( + ::autoboost::begin(Input), + ::autoboost::end(Input), + Output, + Functor); + } + + // Transform a range (in-place) + template + void transform_range( + const RangeT& Input, + FunctorT Functor) + { + std::transform( + ::autoboost::begin(Input), + ::autoboost::end(Input), + ::autoboost::begin(Input), + Functor); + } + + template + inline SequenceT transform_range_copy( + const RangeT& Input, + FunctorT Functor) + { + return SequenceT( + ::autoboost::make_transform_iterator( + ::autoboost::begin(Input), + Functor), + ::autoboost::make_transform_iterator( + ::autoboost::end(Input), + Functor)); + } + + } // namespace detail + } // namespace algorithm +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_CASE_CONV_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/detail/classification.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/classification.hpp new file mode 100644 index 000000000..ecbd56194 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/detail/classification.hpp @@ -0,0 +1,353 @@ +// Boost string_algo library classification.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_CLASSIFICATION_DETAIL_HPP +#define AUTOBOOST_STRING_CLASSIFICATION_DETAIL_HPP + +#include +#include +#include +#include + +#include +#include + +#include +#include + +namespace autoboost { + namespace algorithm { + namespace detail { + +// classification functors -----------------------------------------------// + + // is_classified functor + struct is_classifiedF : + public predicate_facade + { + // Boost.ResultOf support + typedef bool result_type; + + // Constructor from a locale + is_classifiedF(std::ctype_base::mask Type, std::locale const & Loc = std::locale()) : + m_Type(Type), m_Locale(Loc) {} + // Operation + template + bool operator()( CharT Ch ) const + { + return std::use_facet< std::ctype >(m_Locale).is( m_Type, Ch ); + } + + #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x582) && !defined(_USE_OLD_RW_STL) + template<> + bool operator()( char const Ch ) const + { + return std::use_facet< std::ctype >(m_Locale).is( m_Type, Ch ); + } + #endif + + private: + std::ctype_base::mask m_Type; + std::locale m_Locale; + }; + + + // is_any_of functor + /* + returns true if the value is from the specified set + */ + template + struct is_any_ofF : + public predicate_facade > + { + private: + // set cannot operate on const value-type + typedef typename ::autoboost::remove_const::type set_value_type; + + public: + // Boost.ResultOf support + typedef bool result_type; + + // Constructor + template + is_any_ofF( const RangeT& Range ) : m_Size(0) + { + // Prepare storage + m_Storage.m_dynSet=0; + + std::size_t Size=::autoboost::distance(Range); + m_Size=Size; + set_value_type* Storage=0; + + if(use_fixed_storage(m_Size)) + { + // Use fixed storage + Storage=&m_Storage.m_fixSet[0]; + } + else + { + // Use dynamic storage + m_Storage.m_dynSet=new set_value_type[m_Size]; + Storage=m_Storage.m_dynSet; + } + + // Use fixed storage + ::std::copy(::autoboost::begin(Range), ::autoboost::end(Range), Storage); + ::std::sort(Storage, Storage+m_Size); + } + + // Copy constructor + is_any_ofF(const is_any_ofF& Other) : m_Size(Other.m_Size) + { + // Prepare storage + m_Storage.m_dynSet=0; + const set_value_type* SrcStorage=0; + set_value_type* DestStorage=0; + + if(use_fixed_storage(m_Size)) + { + // Use fixed storage + DestStorage=&m_Storage.m_fixSet[0]; + SrcStorage=&Other.m_Storage.m_fixSet[0]; + } + else + { + // Use dynamic storage + m_Storage.m_dynSet=new set_value_type[m_Size]; + DestStorage=m_Storage.m_dynSet; + SrcStorage=Other.m_Storage.m_dynSet; + } + + // Use fixed storage + ::std::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size); + } + + // Destructor + ~is_any_ofF() + { + if(!use_fixed_storage(m_Size) && m_Storage.m_dynSet!=0) + { + delete [] m_Storage.m_dynSet; + } + } + + // Assignment + is_any_ofF& operator=(const is_any_ofF& Other) + { + // Handle self assignment + if(this==&Other) return *this; + + // Prepare storage + const set_value_type* SrcStorage; + set_value_type* DestStorage; + + if(use_fixed_storage(Other.m_Size)) + { + // Use fixed storage + DestStorage=&m_Storage.m_fixSet[0]; + SrcStorage=&Other.m_Storage.m_fixSet[0]; + + // Delete old storage if was present + if(!use_fixed_storage(m_Size) && m_Storage.m_dynSet!=0) + { + delete [] m_Storage.m_dynSet; + } + + // Set new size + m_Size=Other.m_Size; + } + else + { + // Other uses dynamic storage + SrcStorage=Other.m_Storage.m_dynSet; + + // Check what kind of storage are we using right now + if(use_fixed_storage(m_Size)) + { + // Using fixed storage, allocate new + set_value_type* pTemp=new set_value_type[Other.m_Size]; + DestStorage=pTemp; + m_Storage.m_dynSet=pTemp; + m_Size=Other.m_Size; + } + else + { + // Using dynamic storage, check if can reuse + if(m_Storage.m_dynSet!=0 && m_Size>=Other.m_Size && m_Size + bool operator()( Char2T Ch ) const + { + const set_value_type* Storage= + (use_fixed_storage(m_Size)) + ? &m_Storage.m_fixSet[0] + : m_Storage.m_dynSet; + + return ::std::binary_search(Storage, Storage+m_Size, Ch); + } + private: + // check if the size is eligible for fixed storage + static bool use_fixed_storage(std::size_t size) + { + return size<=sizeof(set_value_type*)*2; + } + + + private: + // storage + // The actual used storage is selected on the type + union + { + set_value_type* m_dynSet; + set_value_type m_fixSet[sizeof(set_value_type*)*2]; + } + m_Storage; + + // storage size + ::std::size_t m_Size; + }; + + // is_from_range functor + /* + returns true if the value is from the specified range. + (i.e. x>=From && x>=To) + */ + template + struct is_from_rangeF : + public predicate_facade< is_from_rangeF > + { + // Boost.ResultOf support + typedef bool result_type; + + // Constructor + is_from_rangeF( CharT From, CharT To ) : m_From(From), m_To(To) {} + + // Operation + template + bool operator()( Char2T Ch ) const + { + return ( m_From <= Ch ) && ( Ch <= m_To ); + } + + private: + CharT m_From; + CharT m_To; + }; + + // class_and composition predicate + template + struct pred_andF : + public predicate_facade< pred_andF > + { + public: + + // Boost.ResultOf support + typedef bool result_type; + + // Constructor + pred_andF( Pred1T Pred1, Pred2T Pred2 ) : + m_Pred1(Pred1), m_Pred2(Pred2) {} + + // Operation + template + bool operator()( CharT Ch ) const + { + return m_Pred1(Ch) && m_Pred2(Ch); + } + + private: + Pred1T m_Pred1; + Pred2T m_Pred2; + }; + + // class_or composition predicate + template + struct pred_orF : + public predicate_facade< pred_orF > + { + public: + // Boost.ResultOf support + typedef bool result_type; + + // Constructor + pred_orF( Pred1T Pred1, Pred2T Pred2 ) : + m_Pred1(Pred1), m_Pred2(Pred2) {} + + // Operation + template + bool operator()( CharT Ch ) const + { + return m_Pred1(Ch) || m_Pred2(Ch); + } + + private: + Pred1T m_Pred1; + Pred2T m_Pred2; + }; + + // class_not composition predicate + template< typename PredT > + struct pred_notF : + public predicate_facade< pred_notF > + { + public: + // Boost.ResultOf support + typedef bool result_type; + + // Constructor + pred_notF( PredT Pred ) : m_Pred(Pred) {} + + // Operation + template + bool operator()( CharT Ch ) const + { + return !m_Pred(Ch); + } + + private: + PredT m_Pred; + }; + + } // namespace detail + } // namespace algorithm +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_CLASSIFICATION_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/detail/find_format.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/find_format.hpp new file mode 100644 index 000000000..e264ecae7 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/detail/find_format.hpp @@ -0,0 +1,204 @@ +// Boost string_algo library find_format.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_FIND_FORMAT_DETAIL_HPP +#define AUTOBOOST_STRING_FIND_FORMAT_DETAIL_HPP + +#include +#include +#include +#include +#include +#include + +namespace autoboost { + namespace algorithm { + namespace detail { + +// find_format_copy (iterator variant) implementation -------------------------------// + + template< + typename OutputIteratorT, + typename InputT, + typename FormatterT, + typename FindResultT, + typename FormatResultT > + inline OutputIteratorT find_format_copy_impl2( + OutputIteratorT Output, + const InputT& Input, + FormatterT Formatter, + const FindResultT& FindResult, + const FormatResultT& FormatResult ) + { + typedef find_format_store< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type, + FormatterT, + FormatResultT > store_type; + + // Create store for the find result + store_type M( FindResult, FormatResult, Formatter ); + + if ( !M ) + { + // Match not found - return original sequence + Output = std::copy( ::autoboost::begin(Input), ::autoboost::end(Input), Output ); + return Output; + } + + // Copy the beginning of the sequence + Output = std::copy( ::autoboost::begin(Input), ::autoboost::begin(M), Output ); + // Format find result + // Copy formatted result + Output = std::copy( ::autoboost::begin(M.format_result()), ::autoboost::end(M.format_result()), Output ); + // Copy the rest of the sequence + Output = std::copy( M.end(), ::autoboost::end(Input), Output ); + + return Output; + } + + template< + typename OutputIteratorT, + typename InputT, + typename FormatterT, + typename FindResultT > + inline OutputIteratorT find_format_copy_impl( + OutputIteratorT Output, + const InputT& Input, + FormatterT Formatter, + const FindResultT& FindResult ) + { + if( ::autoboost::algorithm::detail::check_find_result(Input, FindResult) ) { + return ::autoboost::algorithm::detail::find_format_copy_impl2( + Output, + Input, + Formatter, + FindResult, + Formatter(FindResult) ); + } else { + return std::copy( ::autoboost::begin(Input), ::autoboost::end(Input), Output ); + } + } + + +// find_format_copy implementation --------------------------------------------------// + + template< + typename InputT, + typename FormatterT, + typename FindResultT, + typename FormatResultT > + inline InputT find_format_copy_impl2( + const InputT& Input, + FormatterT Formatter, + const FindResultT& FindResult, + const FormatResultT& FormatResult) + { + typedef find_format_store< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type, + FormatterT, + FormatResultT > store_type; + + // Create store for the find result + store_type M( FindResult, FormatResult, Formatter ); + + if ( !M ) + { + // Match not found - return original sequence + return InputT( Input ); + } + + InputT Output; + // Copy the beginning of the sequence + autoboost::algorithm::detail::insert( Output, ::autoboost::end(Output), ::autoboost::begin(Input), M.begin() ); + // Copy formatted result + autoboost::algorithm::detail::insert( Output, ::autoboost::end(Output), M.format_result() ); + // Copy the rest of the sequence + autoboost::algorithm::detail::insert( Output, ::autoboost::end(Output), M.end(), ::autoboost::end(Input) ); + + return Output; + } + + template< + typename InputT, + typename FormatterT, + typename FindResultT > + inline InputT find_format_copy_impl( + const InputT& Input, + FormatterT Formatter, + const FindResultT& FindResult) + { + if( ::autoboost::algorithm::detail::check_find_result(Input, FindResult) ) { + return ::autoboost::algorithm::detail::find_format_copy_impl2( + Input, + Formatter, + FindResult, + Formatter(FindResult) ); + } else { + return Input; + } + } + + // replace implementation ----------------------------------------------------// + + template< + typename InputT, + typename FormatterT, + typename FindResultT, + typename FormatResultT > + inline void find_format_impl2( + InputT& Input, + FormatterT Formatter, + const FindResultT& FindResult, + const FormatResultT& FormatResult) + { + typedef find_format_store< + AUTOBOOST_STRING_TYPENAME + range_iterator::type, + FormatterT, + FormatResultT > store_type; + + // Create store for the find result + store_type M( FindResult, FormatResult, Formatter ); + + if ( !M ) + { + // Search not found - return original sequence + return; + } + + // Replace match + ::autoboost::algorithm::detail::replace( Input, M.begin(), M.end(), M.format_result() ); + } + + template< + typename InputT, + typename FormatterT, + typename FindResultT > + inline void find_format_impl( + InputT& Input, + FormatterT Formatter, + const FindResultT& FindResult) + { + if( ::autoboost::algorithm::detail::check_find_result(Input, FindResult) ) { + ::autoboost::algorithm::detail::find_format_impl2( + Input, + Formatter, + FindResult, + Formatter(FindResult) ); + } + } + + } // namespace detail + } // namespace algorithm +} // namespace autoboost + +#endif // AUTOBOOST_STRING_FIND_FORMAT_DETAIL_HPP diff --git a/contrib/autoboost/boost/algorithm/string/detail/find_format_all.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/find_format_all.hpp similarity index 93% rename from contrib/autoboost/boost/algorithm/string/detail/find_format_all.hpp rename to contrib/autoboost/autoboost/algorithm/string/detail/find_format_all.hpp index 569db00d4..5f06e781b 100644 --- a/contrib/autoboost/boost/algorithm/string/detail/find_format_all.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/detail/find_format_all.hpp @@ -8,15 +8,15 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP -#define BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP +#ifndef AUTOBOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP +#define AUTOBOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace autoboost { namespace algorithm { @@ -39,7 +39,7 @@ namespace autoboost { const FindResultT& FindResult, const FormatResultT& FormatResult ) { - typedef BOOST_STRING_TYPENAME + typedef AUTOBOOST_STRING_TYPENAME range_const_iterator::type input_iterator_type; typedef find_format_store< @@ -113,7 +113,7 @@ namespace autoboost { const FindResultT& FindResult, const FormatResultT& FormatResult) { - typedef BOOST_STRING_TYPENAME + typedef AUTOBOOST_STRING_TYPENAME range_const_iterator::type input_iterator_type; typedef find_format_store< @@ -187,7 +187,7 @@ namespace autoboost { FindResultT FindResult, FormatResultT FormatResult) { - typedef BOOST_STRING_TYPENAME + typedef AUTOBOOST_STRING_TYPENAME range_iterator::type input_iterator_type; typedef find_format_store< input_iterator_type, @@ -199,7 +199,7 @@ namespace autoboost { // Instantiate replacement storage std::deque< - BOOST_STRING_TYPENAME range_value::type> Storage; + AUTOBOOST_STRING_TYPENAME range_value::type> Storage; // Initialize replacement iterators input_iterator_type InsertIt=::autoboost::begin(Input); @@ -270,4 +270,4 @@ namespace autoboost { } // namespace algorithm } // namespace autoboost -#endif // BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP +#endif // AUTOBOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP diff --git a/contrib/autoboost/boost/algorithm/string/detail/find_format_store.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/find_format_store.hpp similarity index 87% rename from contrib/autoboost/boost/algorithm/string/detail/find_format_store.hpp rename to contrib/autoboost/autoboost/algorithm/string/detail/find_format_store.hpp index d6d01500b..850b9c273 100644 --- a/contrib/autoboost/boost/algorithm/string/detail/find_format_store.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/detail/find_format_store.hpp @@ -8,11 +8,11 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP -#define BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP +#ifndef AUTOBOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP +#define AUTOBOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP -#include -#include +#include +#include namespace autoboost { namespace algorithm { @@ -20,7 +20,7 @@ namespace autoboost { // temporary format and find result storage --------------------------------// -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, >= 1400) #pragma warning(push) #pragma warning(disable:4512) //assignment operator could not be generated #endif @@ -73,17 +73,17 @@ namespace autoboost { template bool check_find_result(InputT&, FindResultT& FindResult) { - typedef BOOST_STRING_TYPENAME + typedef AUTOBOOST_STRING_TYPENAME range_const_iterator::type input_iterator_type; iterator_range ResultRange(FindResult); return !ResultRange.empty(); } -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, >= 1400) #pragma warning(pop) #endif } // namespace detail } // namespace algorithm } // namespace autoboost -#endif // BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP +#endif // AUTOBOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/detail/find_iterator.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/find_iterator.hpp new file mode 100644 index 000000000..2c1cd0713 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/detail/find_iterator.hpp @@ -0,0 +1,87 @@ +// Boost string_algo library find_iterator.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_FIND_ITERATOR_DETAIL_HPP +#define AUTOBOOST_STRING_FIND_ITERATOR_DETAIL_HPP + +#include +#include +#include +#include +#include + +namespace autoboost { + namespace algorithm { + namespace detail { + +// find_iterator base -----------------------------------------------// + + // Find iterator base + template + class find_iterator_base + { + protected: + // typedefs + typedef IteratorT input_iterator_type; + typedef iterator_range match_type; + typedef function2< + match_type, + input_iterator_type, + input_iterator_type> finder_type; + + protected: + // Protected construction/destruction + + // Default constructor + find_iterator_base() {}; + // Copy construction + find_iterator_base( const find_iterator_base& Other ) : + m_Finder(Other.m_Finder) {} + + // Constructor + template + find_iterator_base( FinderT Finder, int ) : + m_Finder(Finder) {} + + // Destructor + ~find_iterator_base() {} + + // Find operation + match_type do_find( + input_iterator_type Begin, + input_iterator_type End ) const + { + if (!m_Finder.empty()) + { + return m_Finder(Begin,End); + } + else + { + return match_type(End,End); + } + } + + // Check + bool is_null() const + { + return m_Finder.empty(); + } + + private: + // Finder + finder_type m_Finder; + }; + + } // namespace detail + } // namespace algorithm +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_FIND_ITERATOR_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/detail/finder.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/finder.hpp new file mode 100644 index 000000000..833c19c68 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/detail/finder.hpp @@ -0,0 +1,639 @@ +// Boost string_algo library finder.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2006. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_FINDER_DETAIL_HPP +#define AUTOBOOST_STRING_FINDER_DETAIL_HPP + +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace autoboost { + namespace algorithm { + namespace detail { + + +// find first functor -----------------------------------------------// + + // find a subsequence in the sequence ( functor ) + /* + Returns a pair marking the subsequence in the sequence. + If the find fails, functor returns + */ + template + struct first_finderF + { + typedef SearchIteratorT search_iterator_type; + + // Construction + template< typename SearchT > + first_finderF( const SearchT& Search, PredicateT Comp ) : + m_Search(::autoboost::begin(Search), ::autoboost::end(Search)), m_Comp(Comp) {} + first_finderF( + search_iterator_type SearchBegin, + search_iterator_type SearchEnd, + PredicateT Comp ) : + m_Search(SearchBegin, SearchEnd), m_Comp(Comp) {} + + // Operation + template< typename ForwardIteratorT > + iterator_range + operator()( + ForwardIteratorT Begin, + ForwardIteratorT End ) const + { + typedef iterator_range result_type; + typedef ForwardIteratorT input_iterator_type; + + // Outer loop + for(input_iterator_type OuterIt=Begin; + OuterIt!=End; + ++OuterIt) + { + // Sanity check + if( autoboost::empty(m_Search) ) + return result_type( End, End ); + + input_iterator_type InnerIt=OuterIt; + search_iterator_type SubstrIt=m_Search.begin(); + for(; + InnerIt!=End && SubstrIt!=m_Search.end(); + ++InnerIt,++SubstrIt) + { + if( !( m_Comp(*InnerIt,*SubstrIt) ) ) + break; + } + + // Substring matching succeeded + if ( SubstrIt==m_Search.end() ) + return result_type( OuterIt, InnerIt ); + } + + return result_type( End, End ); + } + + private: + iterator_range m_Search; + PredicateT m_Comp; + }; + +// find last functor -----------------------------------------------// + + // find the last match a subsequence in the sequence ( functor ) + /* + Returns a pair marking the subsequence in the sequence. + If the find fails, returns + */ + template + struct last_finderF + { + typedef SearchIteratorT search_iterator_type; + typedef first_finderF< + search_iterator_type, + PredicateT> first_finder_type; + + // Construction + template< typename SearchT > + last_finderF( const SearchT& Search, PredicateT Comp ) : + m_Search(::autoboost::begin(Search), ::autoboost::end(Search)), m_Comp(Comp) {} + last_finderF( + search_iterator_type SearchBegin, + search_iterator_type SearchEnd, + PredicateT Comp ) : + m_Search(SearchBegin, SearchEnd), m_Comp(Comp) {} + + // Operation + template< typename ForwardIteratorT > + iterator_range + operator()( + ForwardIteratorT Begin, + ForwardIteratorT End ) const + { + typedef iterator_range result_type; + + if( autoboost::empty(m_Search) ) + return result_type( End, End ); + + typedef AUTOBOOST_STRING_TYPENAME autoboost::detail:: + iterator_traits::iterator_category category; + + return findit( Begin, End, category() ); + } + + private: + // forward iterator + template< typename ForwardIteratorT > + iterator_range + findit( + ForwardIteratorT Begin, + ForwardIteratorT End, + std::forward_iterator_tag ) const + { + typedef iterator_range result_type; + + first_finder_type first_finder( + m_Search.begin(), m_Search.end(), m_Comp ); + + result_type M=first_finder( Begin, End ); + result_type Last=M; + + while( M ) + { + Last=M; + M=first_finder( ::autoboost::end(M), End ); + } + + return Last; + } + + // bidirectional iterator + template< typename ForwardIteratorT > + iterator_range + findit( + ForwardIteratorT Begin, + ForwardIteratorT End, + std::bidirectional_iterator_tag ) const + { + typedef iterator_range result_type; + typedef ForwardIteratorT input_iterator_type; + + // Outer loop + for(input_iterator_type OuterIt=End; + OuterIt!=Begin; ) + { + input_iterator_type OuterIt2=--OuterIt; + + input_iterator_type InnerIt=OuterIt2; + search_iterator_type SubstrIt=m_Search.begin(); + for(; + InnerIt!=End && SubstrIt!=m_Search.end(); + ++InnerIt,++SubstrIt) + { + if( !( m_Comp(*InnerIt,*SubstrIt) ) ) + break; + } + + // Substring matching succeeded + if( SubstrIt==m_Search.end() ) + return result_type( OuterIt2, InnerIt ); + } + + return result_type( End, End ); + } + + private: + iterator_range m_Search; + PredicateT m_Comp; + }; + +// find n-th functor -----------------------------------------------// + + // find the n-th match of a subsequence in the sequence ( functor ) + /* + Returns a pair marking the subsequence in the sequence. + If the find fails, returns + */ + template + struct nth_finderF + { + typedef SearchIteratorT search_iterator_type; + typedef first_finderF< + search_iterator_type, + PredicateT> first_finder_type; + typedef last_finderF< + search_iterator_type, + PredicateT> last_finder_type; + + // Construction + template< typename SearchT > + nth_finderF( + const SearchT& Search, + int Nth, + PredicateT Comp) : + m_Search(::autoboost::begin(Search), ::autoboost::end(Search)), + m_Nth(Nth), + m_Comp(Comp) {} + nth_finderF( + search_iterator_type SearchBegin, + search_iterator_type SearchEnd, + int Nth, + PredicateT Comp) : + m_Search(SearchBegin, SearchEnd), + m_Nth(Nth), + m_Comp(Comp) {} + + // Operation + template< typename ForwardIteratorT > + iterator_range + operator()( + ForwardIteratorT Begin, + ForwardIteratorT End ) const + { + if(m_Nth>=0) + { + return find_forward(Begin, End, m_Nth); + } + else + { + return find_backward(Begin, End, -m_Nth); + } + + } + + private: + // Implementation helpers + template< typename ForwardIteratorT > + iterator_range + find_forward( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N) const + { + typedef iterator_range result_type; + + // Sanity check + if( autoboost::empty(m_Search) ) + return result_type( End, End ); + + // Instantiate find functor + first_finder_type first_finder( + m_Search.begin(), m_Search.end(), m_Comp ); + + result_type M( Begin, Begin ); + + for( unsigned int n=0; n<=N; ++n ) + { + // find next match + M=first_finder( ::autoboost::end(M), End ); + + if ( !M ) + { + // Subsequence not found, return + return M; + } + } + + return M; + } + + template< typename ForwardIteratorT > + iterator_range + find_backward( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N) const + { + typedef iterator_range result_type; + + // Sanity check + if( autoboost::empty(m_Search) ) + return result_type( End, End ); + + // Instantiate find functor + last_finder_type last_finder( + m_Search.begin(), m_Search.end(), m_Comp ); + + result_type M( End, End ); + + for( unsigned int n=1; n<=N; ++n ) + { + // find next match + M=last_finder( Begin, ::autoboost::begin(M) ); + + if ( !M ) + { + // Subsequence not found, return + return M; + } + } + + return M; + } + + + private: + iterator_range m_Search; + int m_Nth; + PredicateT m_Comp; + }; + +// find head/tail implementation helpers ---------------------------// + + template + iterator_range + find_head_impl( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N, + std::forward_iterator_tag ) + { + typedef ForwardIteratorT input_iterator_type; + typedef iterator_range result_type; + + input_iterator_type It=Begin; + for( + unsigned int Index=0; + Index + iterator_range + find_head_impl( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N, + std::random_access_iterator_tag ) + { + typedef iterator_range result_type; + + if ( (End<=Begin) || ( static_cast(End-Begin) < N ) ) + return result_type( Begin, End ); + + return result_type(Begin,Begin+N); + } + + // Find head implementation + template + iterator_range + find_head_impl( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N ) + { + typedef AUTOBOOST_STRING_TYPENAME autoboost::detail:: + iterator_traits::iterator_category category; + + return ::autoboost::algorithm::detail::find_head_impl( Begin, End, N, category() ); + } + + template< typename ForwardIteratorT > + iterator_range + find_tail_impl( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N, + std::forward_iterator_tag ) + { + typedef ForwardIteratorT input_iterator_type; + typedef iterator_range result_type; + + unsigned int Index=0; + input_iterator_type It=Begin; + input_iterator_type It2=Begin; + + // Advance It2 by N increments + for( Index=0; Index + iterator_range + find_tail_impl( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N, + std::bidirectional_iterator_tag ) + { + typedef ForwardIteratorT input_iterator_type; + typedef iterator_range result_type; + + input_iterator_type It=End; + for( + unsigned int Index=0; + Index + iterator_range + find_tail_impl( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N, + std::random_access_iterator_tag ) + { + typedef iterator_range result_type; + + if ( (End<=Begin) || ( static_cast(End-Begin) < N ) ) + return result_type( Begin, End ); + + return result_type( End-N, End ); + } + + // Operation + template< typename ForwardIteratorT > + iterator_range + find_tail_impl( + ForwardIteratorT Begin, + ForwardIteratorT End, + unsigned int N ) + { + typedef AUTOBOOST_STRING_TYPENAME autoboost::detail:: + iterator_traits::iterator_category category; + + return ::autoboost::algorithm::detail::find_tail_impl( Begin, End, N, category() ); + } + + + +// find head functor -----------------------------------------------// + + + // find a head in the sequence ( functor ) + /* + This functor find a head of the specified range. For + a specified N, the head is a subsequence of N starting + elements of the range. + */ + struct head_finderF + { + // Construction + head_finderF( int N ) : m_N(N) {} + + // Operation + template< typename ForwardIteratorT > + iterator_range + operator()( + ForwardIteratorT Begin, + ForwardIteratorT End ) const + { + if(m_N>=0) + { + return ::autoboost::algorithm::detail::find_head_impl( Begin, End, m_N ); + } + else + { + iterator_range Res= + ::autoboost::algorithm::detail::find_tail_impl( Begin, End, -m_N ); + + return ::autoboost::make_iterator_range(Begin, Res.begin()); + } + } + + private: + int m_N; + }; + +// find tail functor -----------------------------------------------// + + + // find a tail in the sequence ( functor ) + /* + This functor find a tail of the specified range. For + a specified N, the head is a subsequence of N starting + elements of the range. + */ + struct tail_finderF + { + // Construction + tail_finderF( int N ) : m_N(N) {} + + // Operation + template< typename ForwardIteratorT > + iterator_range + operator()( + ForwardIteratorT Begin, + ForwardIteratorT End ) const + { + if(m_N>=0) + { + return ::autoboost::algorithm::detail::find_tail_impl( Begin, End, m_N ); + } + else + { + iterator_range Res= + ::autoboost::algorithm::detail::find_head_impl( Begin, End, -m_N ); + + return ::autoboost::make_iterator_range(Res.end(), End); + } + } + + private: + int m_N; + }; + +// find token functor -----------------------------------------------// + + // find a token in a sequence ( functor ) + /* + This find functor finds a token specified be a predicate + in a sequence. It is equivalent of std::find algorithm, + with an exception that it return range instead of a single + iterator. + + If bCompress is set to true, adjacent matching tokens are + concatenated into one match. + */ + template< typename PredicateT > + struct token_finderF + { + // Construction + token_finderF( + PredicateT Pred, + token_compress_mode_type eCompress=token_compress_off ) : + m_Pred(Pred), m_eCompress(eCompress) {} + + // Operation + template< typename ForwardIteratorT > + iterator_range + operator()( + ForwardIteratorT Begin, + ForwardIteratorT End ) const + { + typedef iterator_range result_type; + + ForwardIteratorT It=std::find_if( Begin, End, m_Pred ); + + if( It==End ) + { + return result_type( End, End ); + } + else + { + ForwardIteratorT It2=It; + + if( m_eCompress==token_compress_on ) + { + // Find first non-matching character + while( It2!=End && m_Pred(*It2) ) ++It2; + } + else + { + // Advance by one position + ++It2; + } + + return result_type( It, It2 ); + } + } + + private: + PredicateT m_Pred; + token_compress_mode_type m_eCompress; + }; + +// find range functor -----------------------------------------------// + + // find a range in the sequence ( functor ) + /* + This functor actually does not perform any find operation. + It always returns given iterator range as a result. + */ + template + struct range_finderF + { + typedef ForwardIterator1T input_iterator_type; + typedef iterator_range result_type; + + // Construction + range_finderF( + input_iterator_type Begin, + input_iterator_type End ) : m_Range(Begin, End) {} + + range_finderF(const iterator_range& Range) : + m_Range(Range) {} + + // Operation + template< typename ForwardIterator2T > + iterator_range + operator()( + ForwardIterator2T, + ForwardIterator2T ) const + { +#if AUTOBOOST_WORKAROUND( __MWERKS__, <= 0x3003 ) + return iterator_range(this->m_Range); +#else + return m_Range; +#endif + } + + private: + iterator_range m_Range; + }; + + + } // namespace detail + } // namespace algorithm +} // namespace autoboost + +#endif // AUTOBOOST_STRING_FINDER_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/detail/formatter.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/formatter.hpp new file mode 100644 index 000000000..71c248eea --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/detail/formatter.hpp @@ -0,0 +1,119 @@ +// Boost string_algo library formatter.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_FORMATTER_DETAIL_HPP +#define AUTOBOOST_STRING_FORMATTER_DETAIL_HPP + + +#include +#include +#include +#include + +#include + +// generic replace functors -----------------------------------------------// + +namespace autoboost { + namespace algorithm { + namespace detail { + +// const format functor ----------------------------------------------------// + + // constant format functor + template + struct const_formatF + { + private: + typedef AUTOBOOST_STRING_TYPENAME + range_const_iterator::type format_iterator; + typedef iterator_range result_type; + + public: + // Construction + const_formatF(const RangeT& Format) : + m_Format(::autoboost::begin(Format), ::autoboost::end(Format)) {} + + // Operation +#if AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT(0x564)) + template + result_type& operator()(const Range2T&) + { + return m_Format; + } +#endif + + template + const result_type& operator()(const Range2T&) const + { + return m_Format; + } + + private: + result_type m_Format; + }; + +// identity format functor ----------------------------------------------------// + + // identity format functor + template + struct identity_formatF + { + // Operation + template< typename Range2T > + const RangeT& operator()(const Range2T& Replace) const + { + return RangeT(::autoboost::begin(Replace), ::autoboost::end(Replace)); + } + }; + +// empty format functor ( used by erase ) ------------------------------------// + + // empty format functor + template< typename CharT > + struct empty_formatF + { + template< typename ReplaceT > + empty_container operator()(const ReplaceT&) const + { + return empty_container(); + } + }; + +// dissect format functor ----------------------------------------------------// + + // dissect format functor + template + struct dissect_formatF + { + public: + // Construction + dissect_formatF(FinderT Finder) : + m_Finder(Finder) {} + + // Operation + template + inline iterator_range< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + operator()(const RangeT& Replace) const + { + return m_Finder(::autoboost::begin(Replace), ::autoboost::end(Replace)); + } + + private: + FinderT m_Finder; + }; + + + } // namespace detail + } // namespace algorithm +} // namespace autoboost + +#endif // AUTOBOOST_STRING_FORMATTER_DETAIL_HPP diff --git a/contrib/autoboost/boost/algorithm/string/detail/replace_storage.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/replace_storage.hpp similarity index 94% rename from contrib/autoboost/boost/algorithm/string/detail/replace_storage.hpp rename to contrib/autoboost/autoboost/algorithm/string/detail/replace_storage.hpp index 8ac7e4b14..0c932a43e 100644 --- a/contrib/autoboost/boost/algorithm/string/detail/replace_storage.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/detail/replace_storage.hpp @@ -8,14 +8,14 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP -#define BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP +#ifndef AUTOBOOST_STRING_REPLACE_STORAGE_DETAIL_HPP +#define AUTOBOOST_STRING_REPLACE_STORAGE_DETAIL_HPP -#include +#include #include -#include -#include -#include +#include +#include +#include namespace autoboost { namespace algorithm { @@ -156,4 +156,4 @@ namespace autoboost { } // namespace algorithm } // namespace autoboost -#endif // BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP +#endif // AUTOBOOST_STRING_REPLACE_STORAGE_DETAIL_HPP diff --git a/contrib/autoboost/boost/algorithm/string/detail/sequence.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/sequence.hpp similarity index 79% rename from contrib/autoboost/boost/algorithm/string/detail/sequence.hpp rename to contrib/autoboost/autoboost/algorithm/string/detail/sequence.hpp index ebc56261c..19a276607 100644 --- a/contrib/autoboost/boost/algorithm/string/detail/sequence.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/detail/sequence.hpp @@ -8,16 +8,16 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_DETAIL_SEQUENCE_HPP -#define BOOST_STRING_DETAIL_SEQUENCE_HPP +#ifndef AUTOBOOST_STRING_DETAIL_SEQUENCE_HPP +#define AUTOBOOST_STRING_DETAIL_SEQUENCE_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace algorithm { @@ -28,7 +28,7 @@ namespace autoboost { template< typename InputT, typename ForwardIteratorT > inline void insert( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator At, + AUTOBOOST_STRING_TYPENAME InputT::iterator At, ForwardIteratorT Begin, ForwardIteratorT End ) { @@ -38,7 +38,7 @@ namespace autoboost { template< typename InputT, typename InsertT > inline void insert( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator At, + AUTOBOOST_STRING_TYPENAME InputT::iterator At, const InsertT& Insert ) { ::autoboost::algorithm::detail::insert( Input, At, ::autoboost::begin(Insert), ::autoboost::end(Insert) ); @@ -53,8 +53,8 @@ namespace autoboost { template< typename InputT > inline typename InputT::iterator erase( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator From, - BOOST_STRING_TYPENAME InputT::iterator To ) + AUTOBOOST_STRING_TYPENAME InputT::iterator From, + AUTOBOOST_STRING_TYPENAME InputT::iterator To ) { return Input.erase( From, To ); } @@ -69,14 +69,14 @@ namespace autoboost { template< typename InputT, typename ForwardIteratorT > void operator()( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator From, - BOOST_STRING_TYPENAME InputT::iterator To, + AUTOBOOST_STRING_TYPENAME InputT::iterator From, + AUTOBOOST_STRING_TYPENAME InputT::iterator To, ForwardIteratorT Begin, ForwardIteratorT End ) { // Copy data to the container ( as much as possible ) ForwardIteratorT InsertIt=Begin; - BOOST_STRING_TYPENAME InputT::iterator InputIt=From; + AUTOBOOST_STRING_TYPENAME InputT::iterator InputIt=From; for(; InsertIt!=End && InputIt!=To; InsertIt++, InputIt++ ) { *InputIt=*InsertIt; @@ -105,12 +105,12 @@ namespace autoboost { template< typename InputT, typename ForwardIteratorT > void operator()( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator From, - BOOST_STRING_TYPENAME InputT::iterator To, + AUTOBOOST_STRING_TYPENAME InputT::iterator From, + AUTOBOOST_STRING_TYPENAME InputT::iterator To, ForwardIteratorT Begin, ForwardIteratorT End ) { - BOOST_STRING_TYPENAME InputT::iterator At=Input.erase( From, To ); + AUTOBOOST_STRING_TYPENAME InputT::iterator At=Input.erase( From, To ); if ( Begin!=End ) { if(!Input.empty()) @@ -132,8 +132,8 @@ namespace autoboost { template< typename InputT, typename ForwardIteratorT > void operator()( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator From, - BOOST_STRING_TYPENAME InputT::iterator To, + AUTOBOOST_STRING_TYPENAME InputT::iterator From, + AUTOBOOST_STRING_TYPENAME InputT::iterator To, ForwardIteratorT Begin, ForwardIteratorT End ) { @@ -152,8 +152,8 @@ namespace autoboost { template< typename InputT, typename ForwardIteratorT > void operator()( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator From, - BOOST_STRING_TYPENAME InputT::iterator To, + AUTOBOOST_STRING_TYPENAME InputT::iterator From, + AUTOBOOST_STRING_TYPENAME InputT::iterator To, ForwardIteratorT Begin, ForwardIteratorT End ) { @@ -166,8 +166,8 @@ namespace autoboost { template< typename InputT, typename ForwardIteratorT > inline void replace( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator From, - BOOST_STRING_TYPENAME InputT::iterator To, + AUTOBOOST_STRING_TYPENAME InputT::iterator From, + AUTOBOOST_STRING_TYPENAME InputT::iterator To, ForwardIteratorT Begin, ForwardIteratorT End ) { @@ -178,8 +178,8 @@ namespace autoboost { template< typename InputT, typename InsertT > inline void replace( InputT& Input, - BOOST_STRING_TYPENAME InputT::iterator From, - BOOST_STRING_TYPENAME InputT::iterator To, + AUTOBOOST_STRING_TYPENAME InputT::iterator From, + AUTOBOOST_STRING_TYPENAME InputT::iterator To, const InsertT& Insert ) { if(From!=To) @@ -197,4 +197,4 @@ namespace autoboost { } // namespace autoboost -#endif // BOOST_STRING_DETAIL_SEQUENCE_HPP +#endif // AUTOBOOST_STRING_DETAIL_SEQUENCE_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/detail/trim.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/trim.hpp new file mode 100644 index 000000000..46667ae5f --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/detail/trim.hpp @@ -0,0 +1,95 @@ +// Boost string_algo library trim.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_TRIM_DETAIL_HPP +#define AUTOBOOST_STRING_TRIM_DETAIL_HPP + +#include +#include + +namespace autoboost { + namespace algorithm { + namespace detail { + +// trim iterator helper -----------------------------------------------// + + template< typename ForwardIteratorT, typename PredicateT > + inline ForwardIteratorT trim_end_iter_select( + ForwardIteratorT InBegin, + ForwardIteratorT InEnd, + PredicateT IsSpace, + std::forward_iterator_tag ) + { + ForwardIteratorT TrimIt=InBegin; + + for( ForwardIteratorT It=InBegin; It!=InEnd; ++It ) + { + if ( !IsSpace(*It) ) + { + TrimIt=It; + ++TrimIt; + } + } + + return TrimIt; + } + + template< typename ForwardIteratorT, typename PredicateT > + inline ForwardIteratorT trim_end_iter_select( + ForwardIteratorT InBegin, + ForwardIteratorT InEnd, + PredicateT IsSpace, + std::bidirectional_iterator_tag ) + { + for( ForwardIteratorT It=InEnd; It!=InBegin; ) + { + if ( !IsSpace(*(--It)) ) + return ++It; + } + + return InBegin; + } + // Search for first non matching character from the beginning of the sequence + template< typename ForwardIteratorT, typename PredicateT > + inline ForwardIteratorT trim_begin( + ForwardIteratorT InBegin, + ForwardIteratorT InEnd, + PredicateT IsSpace ) + { + ForwardIteratorT It=InBegin; + for(; It!=InEnd; ++It ) + { + if (!IsSpace(*It)) + return It; + } + + return It; + } + + // Search for first non matching character from the end of the sequence + template< typename ForwardIteratorT, typename PredicateT > + inline ForwardIteratorT trim_end( + ForwardIteratorT InBegin, + ForwardIteratorT InEnd, + PredicateT IsSpace ) + { + typedef AUTOBOOST_STRING_TYPENAME autoboost::detail:: + iterator_traits::iterator_category category; + + return ::autoboost::algorithm::detail::trim_end_iter_select( InBegin, InEnd, IsSpace, category() ); + } + + + } // namespace detail + } // namespace algorithm +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_TRIM_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/detail/util.hpp b/contrib/autoboost/autoboost/algorithm/string/detail/util.hpp new file mode 100644 index 000000000..045efc7e1 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/detail/util.hpp @@ -0,0 +1,106 @@ +// Boost string_algo library util.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_UTIL_DETAIL_HPP +#define AUTOBOOST_STRING_UTIL_DETAIL_HPP + +#include +#include +#include + +namespace autoboost { + namespace algorithm { + namespace detail { + +// empty container -----------------------------------------------// + + // empty_container + /* + This class represents always empty container, + containing elements of type CharT. + + It is supposed to be used in a const version only + */ + template< typename CharT > + struct empty_container + { + typedef empty_container type; + typedef CharT value_type; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef const value_type& reference; + typedef const value_type& const_reference; + typedef const value_type* iterator; + typedef const value_type* const_iterator; + + + // Operations + const_iterator begin() const + { + return reinterpret_cast(0); + } + + const_iterator end() const + { + return reinterpret_cast(0); + } + + bool empty() const + { + return false; + } + + size_type size() const + { + return 0; + } + }; + +// bounded copy algorithm -----------------------------------------------// + + // Bounded version of the std::copy algorithm + template + inline OutputIteratorT bounded_copy( + InputIteratorT First, + InputIteratorT Last, + OutputIteratorT DestFirst, + OutputIteratorT DestLast ) + { + InputIteratorT InputIt=First; + OutputIteratorT OutputIt=DestFirst; + for(; InputIt!=Last && OutputIt!=DestLast; InputIt++, OutputIt++ ) + { + *OutputIt=*InputIt; + } + + return OutputIt; + } + +// iterator range utilities -----------------------------------------// + + // copy range functor + template< + typename SeqT, + typename IteratorT=AUTOBOOST_STRING_TYPENAME SeqT::const_iterator > + struct copy_iterator_rangeF : + public std::unary_function< iterator_range, SeqT > + { + SeqT operator()( const iterator_range& Range ) const + { + return copy_range(Range); + } + }; + + } // namespace detail + } // namespace algorithm +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_UTIL_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/erase.hpp b/contrib/autoboost/autoboost/algorithm/string/erase.hpp new file mode 100644 index 000000000..4b8089185 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/erase.hpp @@ -0,0 +1,844 @@ +// Boost string_algo library erase.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2006. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_ERASE_HPP +#define AUTOBOOST_STRING_ERASE_HPP + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +/*! \file + Defines various erase algorithms. Each algorithm removes + part(s) of the input according to a searching criteria. +*/ + +namespace autoboost { + namespace algorithm { + +// erase_range -------------------------------------------------------// + + //! Erase range algorithm + /*! + Remove the given range from the input. The result is a modified copy of + the input. It is returned as a sequence or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input sequence + \param SearchRange A range in the input to be removed + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template + inline OutputIteratorT erase_range_copy( + OutputIteratorT Output, + const RangeT& Input, + const iterator_range< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type>& SearchRange ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::range_finder(SearchRange), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase range algorithm + /*! + \overload + */ + template + inline SequenceT erase_range_copy( + const SequenceT& Input, + const iterator_range< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type>& SearchRange ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::range_finder(SearchRange), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase range algorithm + /*! + Remove the given range from the input. + The input sequence is modified in-place. + + \param Input An input sequence + \param SearchRange A range in the input to be removed + */ + template + inline void erase_range( + SequenceT& Input, + const iterator_range< + AUTOBOOST_STRING_TYPENAME + range_iterator::type>& SearchRange ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::range_finder(SearchRange), + ::autoboost::algorithm::empty_formatter(Input) ); + } + +// erase_first --------------------------------------------------------// + + //! Erase first algorithm + /*! + Remove the first occurrence of the substring from the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT erase_first_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase first algorithm + /*! + \overload + */ + template + inline SequenceT erase_first_copy( + const SequenceT& Input, + const RangeT& Search ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase first algorithm + /*! + Remove the first occurrence of the substring from the input. + The input sequence is modified in-place. + + \param Input An input string + \param Search A substring to be searched for. + */ + template + inline void erase_first( + SequenceT& Input, + const RangeT& Search ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + +// erase_first ( case insensitive ) ------------------------------------// + + //! Erase first algorithm ( case insensitive ) + /*! + Remove the first occurrence of the substring from the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + Searching is case insensitive. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Loc A locale used for case insensitive comparison + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT ierase_first_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase first algorithm ( case insensitive ) + /*! + \overload + */ + template + inline SequenceT ierase_first_copy( + const SequenceT& Input, + const RangeT& Search, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase first algorithm ( case insensitive ) + /*! + Remove the first occurrence of the substring from the input. + The input sequence is modified in-place. Searching is case insensitive. + + \param Input An input string + \param Search A substring to be searched for + \param Loc A locale used for case insensitive comparison + */ + template + inline void ierase_first( + SequenceT& Input, + const RangeT& Search, + const std::locale& Loc=std::locale() ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + +// erase_last --------------------------------------------------------// + + //! Erase last algorithm + /*! + Remove the last occurrence of the substring from the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for. + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT erase_last_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::last_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase last algorithm + /*! + \overload + */ + template + inline SequenceT erase_last_copy( + const SequenceT& Input, + const RangeT& Search ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::last_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase last algorithm + /*! + Remove the last occurrence of the substring from the input. + The input sequence is modified in-place. + + \param Input An input string + \param Search A substring to be searched for + */ + template + inline void erase_last( + SequenceT& Input, + const RangeT& Search ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::last_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + +// erase_last ( case insensitive ) ------------------------------------// + + //! Erase last algorithm ( case insensitive ) + /*! + Remove the last occurrence of the substring from the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + Searching is case insensitive. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Loc A locale used for case insensitive comparison + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT ierase_last_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::last_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase last algorithm ( case insensitive ) + /*! + \overload + */ + template + inline SequenceT ierase_last_copy( + const SequenceT& Input, + const RangeT& Search, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::last_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase last algorithm ( case insensitive ) + /*! + Remove the last occurrence of the substring from the input. + The input sequence is modified in-place. Searching is case insensitive. + + \param Input An input string + \param Search A substring to be searched for + \param Loc A locale used for case insensitive comparison + */ + template + inline void ierase_last( + SequenceT& Input, + const RangeT& Search, + const std::locale& Loc=std::locale() ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::last_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + +// erase_nth --------------------------------------------------------------------// + + //! Erase nth algorithm + /*! + Remove the Nth occurrence of the substring in the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Nth An index of the match to be replaced. The index is 0-based. + For negative N, matches are counted from the end of string. + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT erase_nth_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + int Nth ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::nth_finder(Search, Nth), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase nth algorithm + /*! + \overload + */ + template + inline SequenceT erase_nth_copy( + const SequenceT& Input, + const RangeT& Search, + int Nth ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::nth_finder(Search, Nth), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase nth algorithm + /*! + Remove the Nth occurrence of the substring in the input. + The input sequence is modified in-place. + + \param Input An input string + \param Search A substring to be searched for. + \param Nth An index of the match to be replaced. The index is 0-based. + For negative N, matches are counted from the end of string. + */ + template + inline void erase_nth( + SequenceT& Input, + const RangeT& Search, + int Nth ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::nth_finder(Search, Nth), + ::autoboost::algorithm::empty_formatter(Input) ); + } + +// erase_nth ( case insensitive ) ---------------------------------------------// + + //! Erase nth algorithm ( case insensitive ) + /*! + Remove the Nth occurrence of the substring in the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + Searching is case insensitive. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for. + \param Nth An index of the match to be replaced. The index is 0-based. + For negative N, matches are counted from the end of string. + \param Loc A locale used for case insensitive comparison + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT ierase_nth_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + int Nth, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase nth algorithm + /*! + \overload + */ + template + inline SequenceT ierase_nth_copy( + const SequenceT& Input, + const RangeT& Search, + int Nth, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + empty_formatter(Input) ); + } + + //! Erase nth algorithm + /*! + Remove the Nth occurrence of the substring in the input. + The input sequence is modified in-place. Searching is case insensitive. + + \param Input An input string + \param Search A substring to be searched for. + \param Nth An index of the match to be replaced. The index is 0-based. + For negative N, matches are counted from the end of string. + \param Loc A locale used for case insensitive comparison + */ + template + inline void ierase_nth( + SequenceT& Input, + const RangeT& Search, + int Nth, + const std::locale& Loc=std::locale() ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + +// erase_all --------------------------------------------------------// + + //! Erase all algorithm + /*! + Remove all the occurrences of the string from the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + + \param Output An output iterator to which the result will be copied + \param Input An input sequence + \param Search A substring to be searched for. + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT erase_all_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search ) + { + return ::autoboost::algorithm::find_format_all_copy( + Output, + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase all algorithm + /*! + \overload + */ + template + inline SequenceT erase_all_copy( + const SequenceT& Input, + const RangeT& Search ) + { + return ::autoboost::algorithm::find_format_all_copy( + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase all algorithm + /*! + Remove all the occurrences of the string from the input. + The input sequence is modified in-place. + + \param Input An input string + \param Search A substring to be searched for. + */ + template + inline void erase_all( + SequenceT& Input, + const RangeT& Search ) + { + ::autoboost::algorithm::find_format_all( + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::empty_formatter(Input) ); + } + +// erase_all ( case insensitive ) ------------------------------------// + + //! Erase all algorithm ( case insensitive ) + /*! + Remove all the occurrences of the string from the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + Searching is case insensitive. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Loc A locale used for case insensitive comparison + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT ierase_all_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_all_copy( + Output, + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase all algorithm ( case insensitive ) + /*! + \overload + */ + template + inline SequenceT ierase_all_copy( + const SequenceT& Input, + const RangeT& Search, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_all_copy( + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + + //! Erase all algorithm ( case insensitive ) + /*! + Remove all the occurrences of the string from the input. + The input sequence is modified in-place. Searching is case insensitive. + + \param Input An input string + \param Search A substring to be searched for. + \param Loc A locale used for case insensitive comparison + */ + template + inline void ierase_all( + SequenceT& Input, + const RangeT& Search, + const std::locale& Loc=std::locale() ) + { + ::autoboost::algorithm::find_format_all( + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::empty_formatter(Input) ); + } + +// erase_head --------------------------------------------------------------------// + + //! Erase head algorithm + /*! + Remove the head from the input. The head is a prefix of a sequence of given size. + If the sequence is shorter then required, the whole string is + considered to be the head. The result is a modified copy of the input. + It is returned as a sequence or copied to the output iterator. + + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param N Length of the head. + For N>=0, at most N characters are extracted. + For N<0, size(Input)-|N| characters are extracted. + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename RangeT> + inline OutputIteratorT erase_head_copy( + OutputIteratorT Output, + const RangeT& Input, + int N ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::head_finder(N), + ::autoboost::algorithm::empty_formatter( Input ) ); + } + + //! Erase head algorithm + /*! + \overload + */ + template + inline SequenceT erase_head_copy( + const SequenceT& Input, + int N ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::head_finder(N), + ::autoboost::algorithm::empty_formatter( Input ) ); + } + + //! Erase head algorithm + /*! + Remove the head from the input. The head is a prefix of a sequence of given size. + If the sequence is shorter then required, the whole string is + considered to be the head. The input sequence is modified in-place. + + \param Input An input string + \param N Length of the head + For N>=0, at most N characters are extracted. + For N<0, size(Input)-|N| characters are extracted. + */ + template + inline void erase_head( + SequenceT& Input, + int N ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::head_finder(N), + ::autoboost::algorithm::empty_formatter( Input ) ); + } + +// erase_tail --------------------------------------------------------------------// + + //! Erase tail algorithm + /*! + Remove the tail from the input. The tail is a suffix of a sequence of given size. + If the sequence is shorter then required, the whole string is + considered to be the tail. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param N Length of the tail. + For N>=0, at most N characters are extracted. + For N<0, size(Input)-|N| characters are extracted. + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename RangeT> + inline OutputIteratorT erase_tail_copy( + OutputIteratorT Output, + const RangeT& Input, + int N ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::tail_finder(N), + ::autoboost::algorithm::empty_formatter( Input ) ); + } + + //! Erase tail algorithm + /*! + \overload + */ + template + inline SequenceT erase_tail_copy( + const SequenceT& Input, + int N ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::tail_finder(N), + ::autoboost::algorithm::empty_formatter( Input ) ); + } + + //! Erase tail algorithm + /*! + Remove the tail from the input. The tail is a suffix of a sequence of given size. + If the sequence is shorter then required, the whole string is + considered to be the tail. The input sequence is modified in-place. + + \param Input An input string + \param N Length of the tail + For N>=0, at most N characters are extracted. + For N<0, size(Input)-|N| characters are extracted. + */ + template + inline void erase_tail( + SequenceT& Input, + int N ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::tail_finder(N), + ::autoboost::algorithm::empty_formatter( Input ) ); + } + + } // namespace algorithm + + // pull names into the boost namespace + using algorithm::erase_range_copy; + using algorithm::erase_range; + using algorithm::erase_first_copy; + using algorithm::erase_first; + using algorithm::ierase_first_copy; + using algorithm::ierase_first; + using algorithm::erase_last_copy; + using algorithm::erase_last; + using algorithm::ierase_last_copy; + using algorithm::ierase_last; + using algorithm::erase_nth_copy; + using algorithm::erase_nth; + using algorithm::ierase_nth_copy; + using algorithm::ierase_nth; + using algorithm::erase_all_copy; + using algorithm::erase_all; + using algorithm::ierase_all_copy; + using algorithm::ierase_all; + using algorithm::erase_head_copy; + using algorithm::erase_head; + using algorithm::erase_tail_copy; + using algorithm::erase_tail; + +} // namespace autoboost + + +#endif // AUTOBOOST_ERASE_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/find_format.hpp b/contrib/autoboost/autoboost/algorithm/string/find_format.hpp new file mode 100644 index 000000000..e5eb16b4a --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/find_format.hpp @@ -0,0 +1,287 @@ +// Boost string_algo library find_format.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_FIND_FORMAT_HPP +#define AUTOBOOST_STRING_FIND_FORMAT_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/*! \file + Defines generic replace algorithms. Each algorithm replaces + part(s) of the input. The part to be replaced is looked up using a Finder object. + Result of finding is then used by a Formatter object to generate the replacement. +*/ + +namespace autoboost { + namespace algorithm { + +// generic replace -----------------------------------------------------------------// + + //! Generic replace algorithm + /*! + Use the Finder to search for a substring. Use the Formatter to format + this substring and replace it in the input. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input sequence + \param Finder A Finder object used to search for a match to be replaced + \param Formatter A Formatter object used to format a match + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename RangeT, + typename FinderT, + typename FormatterT> + inline OutputIteratorT find_format_copy( + OutputIteratorT Output, + const RangeT& Input, + FinderT Finder, + FormatterT Formatter ) + { + // Concept check + AUTOBOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + AUTOBOOST_CONCEPT_ASSERT(( + FormatterConcept< + FormatterT, + FinderT,AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + + iterator_range::type> lit_input(::autoboost::as_literal(Input)); + + return detail::find_format_copy_impl( + Output, + lit_input, + Formatter, + Finder( ::autoboost::begin(lit_input), ::autoboost::end(lit_input) ) ); + } + + //! Generic replace algorithm + /*! + \overload + */ + template< + typename SequenceT, + typename FinderT, + typename FormatterT> + inline SequenceT find_format_copy( + const SequenceT& Input, + FinderT Finder, + FormatterT Formatter ) + { + // Concept check + AUTOBOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + AUTOBOOST_CONCEPT_ASSERT(( + FormatterConcept< + FormatterT, + FinderT,AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + + return detail::find_format_copy_impl( + Input, + Formatter, + Finder(::autoboost::begin(Input), ::autoboost::end(Input))); + } + + //! Generic replace algorithm + /*! + Use the Finder to search for a substring. Use the Formatter to format + this substring and replace it in the input. The input is modified in-place. + + \param Input An input sequence + \param Finder A Finder object used to search for a match to be replaced + \param Formatter A Formatter object used to format a match + */ + template< + typename SequenceT, + typename FinderT, + typename FormatterT> + inline void find_format( + SequenceT& Input, + FinderT Finder, + FormatterT Formatter) + { + // Concept check + AUTOBOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + AUTOBOOST_CONCEPT_ASSERT(( + FormatterConcept< + FormatterT, + FinderT,AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + + detail::find_format_impl( + Input, + Formatter, + Finder(::autoboost::begin(Input), ::autoboost::end(Input))); + } + + +// find_format_all generic ----------------------------------------------------------------// + + //! Generic replace all algorithm + /*! + Use the Finder to search for a substring. Use the Formatter to format + this substring and replace it in the input. Repeat this for all matching + substrings. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input sequence + \param Finder A Finder object used to search for a match to be replaced + \param Formatter A Formatter object used to format a match + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename RangeT, + typename FinderT, + typename FormatterT> + inline OutputIteratorT find_format_all_copy( + OutputIteratorT Output, + const RangeT& Input, + FinderT Finder, + FormatterT Formatter) + { + // Concept check + AUTOBOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + AUTOBOOST_CONCEPT_ASSERT(( + FormatterConcept< + FormatterT, + FinderT,AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + + iterator_range::type> lit_input(::autoboost::as_literal(Input)); + + return detail::find_format_all_copy_impl( + Output, + lit_input, + Finder, + Formatter, + Finder(::autoboost::begin(lit_input), ::autoboost::end(lit_input))); + } + + //! Generic replace all algorithm + /*! + \overload + */ + template< + typename SequenceT, + typename FinderT, + typename FormatterT > + inline SequenceT find_format_all_copy( + const SequenceT& Input, + FinderT Finder, + FormatterT Formatter ) + { + // Concept check + AUTOBOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + AUTOBOOST_CONCEPT_ASSERT(( + FormatterConcept< + FormatterT, + FinderT,AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + + return detail::find_format_all_copy_impl( + Input, + Finder, + Formatter, + Finder( ::autoboost::begin(Input), ::autoboost::end(Input) ) ); + } + + //! Generic replace all algorithm + /*! + Use the Finder to search for a substring. Use the Formatter to format + this substring and replace it in the input. Repeat this for all matching + substrings.The input is modified in-place. + + \param Input An input sequence + \param Finder A Finder object used to search for a match to be replaced + \param Formatter A Formatter object used to format a match + */ + template< + typename SequenceT, + typename FinderT, + typename FormatterT > + inline void find_format_all( + SequenceT& Input, + FinderT Finder, + FormatterT Formatter ) + { + // Concept check + AUTOBOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + AUTOBOOST_CONCEPT_ASSERT(( + FormatterConcept< + FormatterT, + FinderT,AUTOBOOST_STRING_TYPENAME range_const_iterator::type> + )); + + detail::find_format_all_impl( + Input, + Finder, + Formatter, + Finder(::autoboost::begin(Input), ::autoboost::end(Input))); + + } + + } // namespace algorithm + + // pull the names to the boost namespace + using algorithm::find_format_copy; + using algorithm::find_format; + using algorithm::find_format_all_copy; + using algorithm::find_format_all; + +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_FIND_FORMAT_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/find_iterator.hpp b/contrib/autoboost/autoboost/algorithm/string/find_iterator.hpp new file mode 100644 index 000000000..bd8774789 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/find_iterator.hpp @@ -0,0 +1,383 @@ +// Boost string_algo library find_iterator.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2004. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_FIND_ITERATOR_HPP +#define AUTOBOOST_STRING_FIND_ITERATOR_HPP + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +/*! \file + Defines find iterator classes. Find iterator repeatedly applies a Finder + to the specified input string to search for matches. Dereferencing + the iterator yields the current match or a range between the last and the current + match depending on the iterator used. +*/ + +namespace autoboost { + namespace algorithm { + +// find_iterator -----------------------------------------------// + + //! find_iterator + /*! + Find iterator encapsulates a Finder and allows + for incremental searching in a string. + Each increment moves the iterator to the next match. + + Find iterator is a readable forward traversal iterator. + + Dereferencing the iterator yields an iterator_range delimiting + the current match. + */ + template + class find_iterator : + public iterator_facade< + find_iterator, + const iterator_range, + forward_traversal_tag >, + private detail::find_iterator_base + { + private: + // facade support + friend class ::autoboost::iterator_core_access; + + private: + // typedefs + + typedef detail::find_iterator_base base_type; + typedef AUTOBOOST_STRING_TYPENAME + base_type::input_iterator_type input_iterator_type; + typedef AUTOBOOST_STRING_TYPENAME + base_type::match_type match_type; + + public: + //! Default constructor + /*! + Construct null iterator. All null iterators are equal. + + \post eof()==true + */ + find_iterator() {} + + //! Copy constructor + /*! + Construct a copy of the find_iterator + */ + find_iterator( const find_iterator& Other ) : + base_type(Other), + m_Match(Other.m_Match), + m_End(Other.m_End) {} + + //! Constructor + /*! + Construct new find_iterator for a given finder + and a range. + */ + template + find_iterator( + IteratorT Begin, + IteratorT End, + FinderT Finder ) : + detail::find_iterator_base(Finder,0), + m_Match(Begin,Begin), + m_End(End) + { + increment(); + } + + //! Constructor + /*! + Construct new find_iterator for a given finder + and a range. + */ + template + find_iterator( + RangeT& Col, + FinderT Finder ) : + detail::find_iterator_base(Finder,0) + { + iterator_range::type> lit_col(::autoboost::as_literal(Col)); + m_Match=::autoboost::make_iterator_range(::autoboost::begin(lit_col), ::autoboost::begin(lit_col)); + m_End=::autoboost::end(lit_col); + + increment(); + } + + private: + // iterator operations + + // dereference + const match_type& dereference() const + { + return m_Match; + } + + // increment + void increment() + { + m_Match=this->do_find(m_Match.end(),m_End); + } + + // comparison + bool equal( const find_iterator& Other ) const + { + bool bEof=eof(); + bool bOtherEof=Other.eof(); + + return bEof || bOtherEof ? bEof==bOtherEof : + ( + m_Match==Other.m_Match && + m_End==Other.m_End + ); + } + + public: + // operations + + //! Eof check + /*! + Check the eof condition. Eof condition means that + there is nothing more to be searched i.e. find_iterator + is after the last match. + */ + bool eof() const + { + return + this->is_null() || + ( + m_Match.begin() == m_End && + m_Match.end() == m_End + ); + } + + private: + // Attributes + match_type m_Match; + input_iterator_type m_End; + }; + + //! find iterator construction helper + /*! + * Construct a find iterator to iterate through the specified string + */ + template + inline find_iterator< + AUTOBOOST_STRING_TYPENAME range_iterator::type> + make_find_iterator( + RangeT& Collection, + FinderT Finder) + { + return find_iterator::type>( + Collection, Finder); + } + +// split iterator -----------------------------------------------// + + //! split_iterator + /*! + Split iterator encapsulates a Finder and allows + for incremental searching in a string. + Unlike the find iterator, split iterator iterates + through gaps between matches. + + Find iterator is a readable forward traversal iterator. + + Dereferencing the iterator yields an iterator_range delimiting + the current match. + */ + template + class split_iterator : + public iterator_facade< + split_iterator, + const iterator_range, + forward_traversal_tag >, + private detail::find_iterator_base + { + private: + // facade support + friend class ::autoboost::iterator_core_access; + + private: + // typedefs + + typedef detail::find_iterator_base base_type; + typedef AUTOBOOST_STRING_TYPENAME + base_type::input_iterator_type input_iterator_type; + typedef AUTOBOOST_STRING_TYPENAME + base_type::match_type match_type; + + public: + //! Default constructor + /*! + Construct null iterator. All null iterators are equal. + + \post eof()==true + */ + split_iterator() { m_bEof = true; } + //! Copy constructor + /*! + Construct a copy of the split_iterator + */ + split_iterator( const split_iterator& Other ) : + base_type(Other), + m_Match(Other.m_Match), + m_Next(Other.m_Next), + m_End(Other.m_End), + m_bEof(Other.m_bEof) + {} + + //! Constructor + /*! + Construct new split_iterator for a given finder + and a range. + */ + template + split_iterator( + IteratorT Begin, + IteratorT End, + FinderT Finder ) : + detail::find_iterator_base(Finder,0), + m_Match(Begin,Begin), + m_Next(Begin), + m_End(End), + m_bEof(false) + { + // force the correct behavior for empty sequences and yield at least one token + if(Begin!=End) + { + increment(); + } + } + //! Constructor + /*! + Construct new split_iterator for a given finder + and a collection. + */ + template + split_iterator( + RangeT& Col, + FinderT Finder ) : + detail::find_iterator_base(Finder,0), + m_bEof(false) + { + iterator_range::type> lit_col(::autoboost::as_literal(Col)); + m_Match=make_iterator_range(::autoboost::begin(lit_col), ::autoboost::begin(lit_col)); + m_Next=::autoboost::begin(lit_col); + m_End=::autoboost::end(lit_col); + + // force the correct behavior for empty sequences and yield at least one token + if(m_Next!=m_End) + { + increment(); + } + } + + + private: + // iterator operations + + // dereference + const match_type& dereference() const + { + return m_Match; + } + + // increment + void increment() + { + match_type FindMatch=this->do_find( m_Next, m_End ); + + if(FindMatch.begin()==m_End && FindMatch.end()==m_End) + { + if(m_Match.end()==m_End) + { + // Mark iterator as eof + m_bEof=true; + } + } + + m_Match=match_type( m_Next, FindMatch.begin() ); + m_Next=FindMatch.end(); + } + + // comparison + bool equal( const split_iterator& Other ) const + { + bool bEof=eof(); + bool bOtherEof=Other.eof(); + + return bEof || bOtherEof ? bEof==bOtherEof : + ( + m_Match==Other.m_Match && + m_Next==Other.m_Next && + m_End==Other.m_End + ); + } + + public: + // operations + + //! Eof check + /*! + Check the eof condition. Eof condition means that + there is nothing more to be searched i.e. find_iterator + is after the last match. + */ + bool eof() const + { + return this->is_null() || m_bEof; + } + + private: + // Attributes + match_type m_Match; + input_iterator_type m_Next; + input_iterator_type m_End; + bool m_bEof; + }; + + //! split iterator construction helper + /*! + * Construct a split iterator to iterate through the specified collection + */ + template + inline split_iterator< + AUTOBOOST_STRING_TYPENAME range_iterator::type> + make_split_iterator( + RangeT& Collection, + FinderT Finder) + { + return split_iterator::type>( + Collection, Finder); + } + + + } // namespace algorithm + + // pull names to the boost namespace + using algorithm::find_iterator; + using algorithm::make_find_iterator; + using algorithm::split_iterator; + using algorithm::make_split_iterator; + +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_FIND_ITERATOR_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/finder.hpp b/contrib/autoboost/autoboost/algorithm/string/finder.hpp new file mode 100644 index 000000000..eea25a18f --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/finder.hpp @@ -0,0 +1,270 @@ +// Boost string_algo library finder.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2006. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_FINDER_HPP +#define AUTOBOOST_STRING_FINDER_HPP + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +/*! \file + Defines Finder generators. Finder object is a functor which is able to + find a substring matching a specific criteria in the input. + Finders are used as a pluggable components for replace, find + and split facilities. This header contains generator functions + for finders provided in this library. +*/ + +namespace autoboost { + namespace algorithm { + +// Finder generators ------------------------------------------// + + //! "First" finder + /*! + Construct the \c first_finder. The finder searches for the first + occurrence of the string in a given input. + The result is given as an \c iterator_range delimiting the match. + + \param Search A substring to be searched for. + \param Comp An element comparison predicate + \return An instance of the \c first_finder object + */ + template + inline detail::first_finderF< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type, + is_equal> + first_finder( const RangeT& Search ) + { + return + detail::first_finderF< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type, + is_equal>( ::autoboost::as_literal(Search), is_equal() ) ; + } + + //! "First" finder + /*! + \overload + */ + template + inline detail::first_finderF< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type, + PredicateT> + first_finder( + const RangeT& Search, PredicateT Comp ) + { + return + detail::first_finderF< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type, + PredicateT>( ::autoboost::as_literal(Search), Comp ); + } + + //! "Last" finder + /*! + Construct the \c last_finder. The finder searches for the last + occurrence of the string in a given input. + The result is given as an \c iterator_range delimiting the match. + + \param Search A substring to be searched for. + \param Comp An element comparison predicate + \return An instance of the \c last_finder object + */ + template + inline detail::last_finderF< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type, + is_equal> + last_finder( const RangeT& Search ) + { + return + detail::last_finderF< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type, + is_equal>( ::autoboost::as_literal(Search), is_equal() ); + } + //! "Last" finder + /*! + \overload + */ + template + inline detail::last_finderF< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type, + PredicateT> + last_finder( const RangeT& Search, PredicateT Comp ) + { + return + detail::last_finderF< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type, + PredicateT>( ::autoboost::as_literal(Search), Comp ) ; + } + + //! "Nth" finder + /*! + Construct the \c nth_finder. The finder searches for the n-th (zero-indexed) + occurrence of the string in a given input. + The result is given as an \c iterator_range delimiting the match. + + \param Search A substring to be searched for. + \param Nth An index of the match to be find + \param Comp An element comparison predicate + \return An instance of the \c nth_finder object + */ + template + inline detail::nth_finderF< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type, + is_equal> + nth_finder( + const RangeT& Search, + int Nth) + { + return + detail::nth_finderF< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type, + is_equal>( ::autoboost::as_literal(Search), Nth, is_equal() ) ; + } + //! "Nth" finder + /*! + \overload + */ + template + inline detail::nth_finderF< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type, + PredicateT> + nth_finder( + const RangeT& Search, + int Nth, + PredicateT Comp ) + { + return + detail::nth_finderF< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type, + PredicateT>( ::autoboost::as_literal(Search), Nth, Comp ); + } + + //! "Head" finder + /*! + Construct the \c head_finder. The finder returns a head of a given + input. The head is a prefix of a string up to n elements in + size. If an input has less then n elements, whole input is + considered a head. + The result is given as an \c iterator_range delimiting the match. + + \param N The size of the head + \return An instance of the \c head_finder object + */ + inline detail::head_finderF + head_finder( int N ) + { + return detail::head_finderF(N); + } + + //! "Tail" finder + /*! + Construct the \c tail_finder. The finder returns a tail of a given + input. The tail is a suffix of a string up to n elements in + size. If an input has less then n elements, whole input is + considered a head. + The result is given as an \c iterator_range delimiting the match. + + \param N The size of the head + \return An instance of the \c tail_finder object + */ + inline detail::tail_finderF + tail_finder( int N ) + { + return detail::tail_finderF(N); + } + + //! "Token" finder + /*! + Construct the \c token_finder. The finder searches for a token + specified by a predicate. It is similar to std::find_if + algorithm, with an exception that it return a range of + instead of a single iterator. + + If "compress token mode" is enabled, adjacent matching tokens are + concatenated into one match. Thus the finder can be used to + search for continuous segments of characters satisfying the + given predicate. + + The result is given as an \c iterator_range delimiting the match. + + \param Pred An element selection predicate + \param eCompress Compress flag + \return An instance of the \c token_finder object + */ + template< typename PredicateT > + inline detail::token_finderF + token_finder( + PredicateT Pred, + token_compress_mode_type eCompress=token_compress_off ) + { + return detail::token_finderF( Pred, eCompress ); + } + + //! "Range" finder + /*! + Construct the \c range_finder. The finder does not perform + any operation. It simply returns the given range for + any input. + + \param Begin Beginning of the range + \param End End of the range + \param Range The range. + \return An instance of the \c range_finger object + */ + template< typename ForwardIteratorT > + inline detail::range_finderF + range_finder( + ForwardIteratorT Begin, + ForwardIteratorT End ) + { + return detail::range_finderF( Begin, End ); + } + + //! "Range" finder + /*! + \overload + */ + template< typename ForwardIteratorT > + inline detail::range_finderF + range_finder( iterator_range Range ) + { + return detail::range_finderF( Range ); + } + + } // namespace algorithm + + // pull the names to the boost namespace + using algorithm::first_finder; + using algorithm::last_finder; + using algorithm::nth_finder; + using algorithm::head_finder; + using algorithm::tail_finder; + using algorithm::token_finder; + using algorithm::range_finder; + +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_FINDER_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/formatter.hpp b/contrib/autoboost/autoboost/algorithm/string/formatter.hpp new file mode 100644 index 000000000..09d016ab7 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/formatter.hpp @@ -0,0 +1,120 @@ +// Boost string_algo library formatter.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_FORMATTER_HPP +#define AUTOBOOST_STRING_FORMATTER_HPP + +#include +#include +#include +#include + +#include + +/*! \file + Defines Formatter generators. Formatter is a functor which formats + a string according to given parameters. A Formatter works + in conjunction with a Finder. A Finder can provide additional information + for a specific Formatter. An example of such a cooperation is regex_finder + and regex_formatter. + + Formatters are used as pluggable components for replace facilities. + This header contains generator functions for the Formatters provided in this library. +*/ + +namespace autoboost { + namespace algorithm { + +// generic formatters ---------------------------------------------------------------// + + //! Constant formatter + /*! + Constructs a \c const_formatter. Const formatter always returns + the same value, regardless of the parameter. + + \param Format A predefined value used as a result for formatting + \return An instance of the \c const_formatter object. + */ + template + inline detail::const_formatF< + iterator_range< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> > + const_formatter(const RangeT& Format) + { + return detail::const_formatF< + iterator_range< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> >(::autoboost::as_literal(Format)); + } + + //! Identity formatter + /*! + Constructs an \c identity_formatter. Identity formatter always returns + the parameter. + + \return An instance of the \c identity_formatter object. + */ + template + inline detail::identity_formatF< + iterator_range< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> > + identity_formatter() + { + return detail::identity_formatF< + iterator_range< + AUTOBOOST_STRING_TYPENAME range_const_iterator::type> >(); + } + + //! Empty formatter + /*! + Constructs an \c empty_formatter. Empty formatter always returns an empty + sequence. + + \param Input container used to select a correct value_type for the + resulting empty_container<>. + \return An instance of the \c empty_formatter object. + */ + template + inline detail::empty_formatF< + AUTOBOOST_STRING_TYPENAME range_value::type> + empty_formatter(const RangeT&) + { + return detail::empty_formatF< + AUTOBOOST_STRING_TYPENAME range_value::type>(); + } + + //! Empty formatter + /*! + Constructs a \c dissect_formatter. Dissect formatter uses a specified finder + to extract a portion of the formatted sequence. The first finder's match is returned + as a result + + \param Finder a finder used to select a portion of the formatted sequence + \return An instance of the \c dissect_formatter object. + */ + template + inline detail::dissect_formatF< FinderT > + dissect_formatter(const FinderT& Finder) + { + return detail::dissect_formatF(Finder); + } + + + } // namespace algorithm + + // pull the names to the boost namespace + using algorithm::const_formatter; + using algorithm::identity_formatter; + using algorithm::empty_formatter; + using algorithm::dissect_formatter; + +} // namespace autoboost + + +#endif // AUTOBOOST_FORMATTER_HPP diff --git a/contrib/autoboost/boost/algorithm/string/iter_find.hpp b/contrib/autoboost/autoboost/algorithm/string/iter_find.hpp similarity index 82% rename from contrib/autoboost/boost/algorithm/string/iter_find.hpp rename to contrib/autoboost/autoboost/algorithm/string/iter_find.hpp index b2685d4a4..6acbca441 100644 --- a/contrib/autoboost/boost/algorithm/string/iter_find.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/iter_find.hpp @@ -8,24 +8,24 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_ITER_FIND_HPP -#define BOOST_STRING_ITER_FIND_HPP +#ifndef AUTOBOOST_STRING_ITER_FIND_HPP +#define AUTOBOOST_STRING_ITER_FIND_HPP -#include +#include #include #include -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#include -#include -#include +#include +#include +#include /*! \file Defines generic split algorithms. Split algorithms can be @@ -74,19 +74,19 @@ namespace autoboost { RangeT& Input, FinderT Finder ) { - BOOST_CONCEPT_ASSERT(( + AUTOBOOST_CONCEPT_ASSERT(( FinderConcept< FinderT, - BOOST_STRING_TYPENAME range_iterator::type> + AUTOBOOST_STRING_TYPENAME range_iterator::type> )); - iterator_range::type> lit_input(::autoboost::as_literal(Input)); + iterator_range::type> lit_input(::autoboost::as_literal(Input)); - typedef BOOST_STRING_TYPENAME + typedef AUTOBOOST_STRING_TYPENAME range_iterator::type input_iterator_type; typedef find_iterator find_iterator_type; typedef detail::copy_iterator_rangeF< - BOOST_STRING_TYPENAME + AUTOBOOST_STRING_TYPENAME range_value::type, input_iterator_type> copy_range_type; @@ -145,18 +145,18 @@ namespace autoboost { RangeT& Input, FinderT Finder ) { - BOOST_CONCEPT_ASSERT(( + AUTOBOOST_CONCEPT_ASSERT(( FinderConcept::type> + AUTOBOOST_STRING_TYPENAME range_iterator::type> )); - iterator_range::type> lit_input(::autoboost::as_literal(Input)); + iterator_range::type> lit_input(::autoboost::as_literal(Input)); - typedef BOOST_STRING_TYPENAME + typedef AUTOBOOST_STRING_TYPENAME range_iterator::type input_iterator_type; typedef split_iterator find_iterator_type; typedef detail::copy_iterator_rangeF< - BOOST_STRING_TYPENAME + AUTOBOOST_STRING_TYPENAME range_value::type, input_iterator_type> copy_range_type; @@ -190,4 +190,4 @@ namespace autoboost { } // namespace autoboost -#endif // BOOST_STRING_ITER_FIND_HPP +#endif // AUTOBOOST_STRING_ITER_FIND_HPP diff --git a/contrib/autoboost/boost/algorithm/string/predicate_facade.hpp b/contrib/autoboost/autoboost/algorithm/string/predicate_facade.hpp similarity index 85% rename from contrib/autoboost/boost/algorithm/string/predicate_facade.hpp rename to contrib/autoboost/autoboost/algorithm/string/predicate_facade.hpp index 7adfcf299..54cfec4bc 100644 --- a/contrib/autoboost/boost/algorithm/string/predicate_facade.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/predicate_facade.hpp @@ -8,10 +8,10 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_PREDICATE_FACADE_HPP -#define BOOST_STRING_PREDICATE_FACADE_HPP +#ifndef AUTOBOOST_STRING_PREDICATE_FACADE_HPP +#define AUTOBOOST_STRING_PREDICATE_FACADE_HPP -#include +#include /* \file boost/algorith/string/predicate_facade.hpp @@ -39,4 +39,4 @@ namespace autoboost { } // namespace autoboost -#endif // BOOST_STRING_CLASSIFICATION_DETAIL_HPP +#endif // AUTOBOOST_STRING_CLASSIFICATION_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/replace.hpp b/contrib/autoboost/autoboost/algorithm/string/replace.hpp new file mode 100644 index 000000000..e4dbf1de9 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/replace.hpp @@ -0,0 +1,928 @@ +// Boost string_algo library replace.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2006. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_REPLACE_HPP +#define AUTOBOOST_STRING_REPLACE_HPP + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/*! \file + Defines various replace algorithms. Each algorithm replaces + part(s) of the input according to set of searching and replace criteria. +*/ + +namespace autoboost { + namespace algorithm { + +// replace_range --------------------------------------------------------------------// + + //! Replace range algorithm + /*! + Replace the given range in the input string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param SearchRange A range in the input to be substituted + \param Format A substitute string + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT replace_range_copy( + OutputIteratorT Output, + const Range1T& Input, + const iterator_range< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type>& SearchRange, + const Range2T& Format) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::range_finder(SearchRange), + ::autoboost::algorithm::const_formatter(Format)); + } + + //! Replace range algorithm + /*! + \overload + */ + template + inline SequenceT replace_range_copy( + const SequenceT& Input, + const iterator_range< + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type>& SearchRange, + const RangeT& Format) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::range_finder(SearchRange), + ::autoboost::algorithm::const_formatter(Format)); + } + + //! Replace range algorithm + /*! + Replace the given range in the input string. + The input sequence is modified in-place. + + \param Input An input string + \param SearchRange A range in the input to be substituted + \param Format A substitute string + */ + template + inline void replace_range( + SequenceT& Input, + const iterator_range< + AUTOBOOST_STRING_TYPENAME + range_iterator::type>& SearchRange, + const RangeT& Format) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::range_finder(SearchRange), + ::autoboost::algorithm::const_formatter(Format)); + } + +// replace_first --------------------------------------------------------------------// + + //! Replace first algorithm + /*! + Replace the first match of the search substring in the input + with the format string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T, + typename Range3T> + inline OutputIteratorT replace_first_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const Range3T& Format) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace first algorithm + /*! + \overload + */ + template + inline SequenceT replace_first_copy( + const SequenceT& Input, + const Range1T& Search, + const Range2T& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace first algorithm + /*! + replace the first match of the search substring in the input + with the format string. The input sequence is modified in-place. + + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + */ + template + inline void replace_first( + SequenceT& Input, + const Range1T& Search, + const Range2T& Format ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_first ( case insensitive ) ---------------------------------------------// + + //! Replace first algorithm ( case insensitive ) + /*! + Replace the first match of the search substring in the input + with the format string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + Searching is case insensitive. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \param Loc A locale used for case insensitive comparison + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T, + typename Range3T> + inline OutputIteratorT ireplace_first_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const Range3T& Format, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace first algorithm ( case insensitive ) + /*! + \overload + */ + template + inline SequenceT ireplace_first_copy( + const SequenceT& Input, + const Range2T& Search, + const Range1T& Format, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace first algorithm ( case insensitive ) + /*! + Replace the first match of the search substring in the input + with the format string. Input sequence is modified in-place. + Searching is case insensitive. + + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \param Loc A locale used for case insensitive comparison + */ + template + inline void ireplace_first( + SequenceT& Input, + const Range1T& Search, + const Range2T& Format, + const std::locale& Loc=std::locale() ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_last --------------------------------------------------------------------// + + //! Replace last algorithm + /*! + Replace the last match of the search string in the input + with the format string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T, + typename Range3T> + inline OutputIteratorT replace_last_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const Range3T& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::last_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace last algorithm + /*! + \overload + */ + template + inline SequenceT replace_last_copy( + const SequenceT& Input, + const Range1T& Search, + const Range2T& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::last_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace last algorithm + /*! + Replace the last match of the search string in the input + with the format string. Input sequence is modified in-place. + + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + */ + template + inline void replace_last( + SequenceT& Input, + const Range1T& Search, + const Range2T& Format ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::last_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_last ( case insensitive ) -----------------------------------------------// + + //! Replace last algorithm ( case insensitive ) + /*! + Replace the last match of the search string in the input + with the format string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + Searching is case insensitive. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \param Loc A locale used for case insensitive comparison + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T, + typename Range3T> + inline OutputIteratorT ireplace_last_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const Range3T& Format, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::last_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace last algorithm ( case insensitive ) + /*! + \overload + */ + template + inline SequenceT ireplace_last_copy( + const SequenceT& Input, + const Range1T& Search, + const Range2T& Format, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::last_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace last algorithm ( case insensitive ) + /*! + Replace the last match of the search string in the input + with the format string.The input sequence is modified in-place. + Searching is case insensitive. + + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \param Loc A locale used for case insensitive comparison + \return A reference to the modified input + */ + template + inline void ireplace_last( + SequenceT& Input, + const Range1T& Search, + const Range2T& Format, + const std::locale& Loc=std::locale() ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::last_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_nth --------------------------------------------------------------------// + + //! Replace nth algorithm + /*! + Replace an Nth (zero-indexed) match of the search string in the input + with the format string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Nth An index of the match to be replaced. The index is 0-based. + For negative N, matches are counted from the end of string. + \param Format A substitute string + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T, + typename Range3T> + inline OutputIteratorT replace_nth_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + int Nth, + const Range3T& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::nth_finder(Search, Nth), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace nth algorithm + /*! + \overload + */ + template + inline SequenceT replace_nth_copy( + const SequenceT& Input, + const Range1T& Search, + int Nth, + const Range2T& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::nth_finder(Search, Nth), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace nth algorithm + /*! + Replace an Nth (zero-indexed) match of the search string in the input + with the format string. Input sequence is modified in-place. + + \param Input An input string + \param Search A substring to be searched for + \param Nth An index of the match to be replaced. The index is 0-based. + For negative N, matches are counted from the end of string. + \param Format A substitute string + */ + template + inline void replace_nth( + SequenceT& Input, + const Range1T& Search, + int Nth, + const Range2T& Format ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::nth_finder(Search, Nth), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_nth ( case insensitive ) -----------------------------------------------// + + //! Replace nth algorithm ( case insensitive ) + /*! + Replace an Nth (zero-indexed) match of the search string in the input + with the format string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + Searching is case insensitive. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Nth An index of the match to be replaced. The index is 0-based. + For negative N, matches are counted from the end of string. + \param Format A substitute string + \param Loc A locale used for case insensitive comparison + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T, + typename Range3T> + inline OutputIteratorT ireplace_nth_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + int Nth, + const Range3T& Format, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc) ), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace nth algorithm ( case insensitive ) + /*! + \overload + */ + template + inline SequenceT ireplace_nth_copy( + const SequenceT& Input, + const Range1T& Search, + int Nth, + const Range2T& Format, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace nth algorithm ( case insensitive ) + /*! + Replace an Nth (zero-indexed) match of the search string in the input + with the format string. Input sequence is modified in-place. + Searching is case insensitive. + + \param Input An input string + \param Search A substring to be searched for + \param Nth An index of the match to be replaced. The index is 0-based. + For negative N, matches are counted from the end of string. + \param Format A substitute string + \param Loc A locale used for case insensitive comparison + */ + template + inline void ireplace_nth( + SequenceT& Input, + const Range1T& Search, + int Nth, + const Range2T& Format, + const std::locale& Loc=std::locale() ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_all --------------------------------------------------------------------// + + //! Replace all algorithm + /*! + Replace all occurrences of the search string in the input + with the format string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T, + typename Range3T> + inline OutputIteratorT replace_all_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const Range3T& Format ) + { + return ::autoboost::algorithm::find_format_all_copy( + Output, + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace all algorithm + /*! + \overload + */ + template + inline SequenceT replace_all_copy( + const SequenceT& Input, + const Range1T& Search, + const Range2T& Format ) + { + return ::autoboost::algorithm::find_format_all_copy( + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace all algorithm + /*! + Replace all occurrences of the search string in the input + with the format string. The input sequence is modified in-place. + + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \return A reference to the modified input + */ + template + inline void replace_all( + SequenceT& Input, + const Range1T& Search, + const Range2T& Format ) + { + ::autoboost::algorithm::find_format_all( + Input, + ::autoboost::algorithm::first_finder(Search), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_all ( case insensitive ) -----------------------------------------------// + + //! Replace all algorithm ( case insensitive ) + /*! + Replace all occurrences of the search string in the input + with the format string. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + Searching is case insensitive. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \param Loc A locale used for case insensitive comparison + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T, + typename Range3T> + inline OutputIteratorT ireplace_all_copy( + OutputIteratorT Output, + const Range1T& Input, + const Range2T& Search, + const Range3T& Format, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_all_copy( + Output, + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace all algorithm ( case insensitive ) + /*! + \overload + */ + template + inline SequenceT ireplace_all_copy( + const SequenceT& Input, + const Range1T& Search, + const Range2T& Format, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::find_format_all_copy( + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace all algorithm ( case insensitive ) + /*! + Replace all occurrences of the search string in the input + with the format string.The input sequence is modified in-place. + Searching is case insensitive. + + \param Input An input string + \param Search A substring to be searched for + \param Format A substitute string + \param Loc A locale used for case insensitive comparison + */ + template + inline void ireplace_all( + SequenceT& Input, + const Range1T& Search, + const Range2T& Format, + const std::locale& Loc=std::locale() ) + { + ::autoboost::algorithm::find_format_all( + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc)), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_head --------------------------------------------------------------------// + + //! Replace head algorithm + /*! + Replace the head of the input with the given format string. + The head is a prefix of a string of given size. + If the sequence is shorter then required, whole string if + considered to be the head. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param N Length of the head. + For N>=0, at most N characters are extracted. + For N<0, size(Input)-|N| characters are extracted. + \param Format A substitute string + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT replace_head_copy( + OutputIteratorT Output, + const Range1T& Input, + int N, + const Range2T& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::head_finder(N), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace head algorithm + /*! + \overload + */ + template + inline SequenceT replace_head_copy( + const SequenceT& Input, + int N, + const RangeT& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::head_finder(N), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace head algorithm + /*! + Replace the head of the input with the given format string. + The head is a prefix of a string of given size. + If the sequence is shorter then required, the whole string is + considered to be the head. The input sequence is modified in-place. + + \param Input An input string + \param N Length of the head. + For N>=0, at most N characters are extracted. + For N<0, size(Input)-|N| characters are extracted. + \param Format A substitute string + */ + template + inline void replace_head( + SequenceT& Input, + int N, + const RangeT& Format ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::head_finder(N), + ::autoboost::algorithm::const_formatter(Format) ); + } + +// replace_tail --------------------------------------------------------------------// + + //! Replace tail algorithm + /*! + Replace the tail of the input with the given format string. + The tail is a suffix of a string of given size. + If the sequence is shorter then required, whole string is + considered to be the tail. + The result is a modified copy of the input. It is returned as a sequence + or copied to the output iterator. + + \param Output An output iterator to which the result will be copied + \param Input An input string + \param N Length of the tail. + For N>=0, at most N characters are extracted. + For N<0, size(Input)-|N| characters are extracted. + \param Format A substitute string + \return An output iterator pointing just after the last inserted character or + a modified copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template< + typename OutputIteratorT, + typename Range1T, + typename Range2T> + inline OutputIteratorT replace_tail_copy( + OutputIteratorT Output, + const Range1T& Input, + int N, + const Range2T& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Output, + Input, + ::autoboost::algorithm::tail_finder(N), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace tail algorithm + /*! + \overload + */ + template + inline SequenceT replace_tail_copy( + const SequenceT& Input, + int N, + const RangeT& Format ) + { + return ::autoboost::algorithm::find_format_copy( + Input, + ::autoboost::algorithm::tail_finder(N), + ::autoboost::algorithm::const_formatter(Format) ); + } + + //! Replace tail algorithm + /*! + Replace the tail of the input with the given format sequence. + The tail is a suffix of a string of given size. + If the sequence is shorter then required, the whole string is + considered to be the tail. The input sequence is modified in-place. + + \param Input An input string + \param N Length of the tail. + For N>=0, at most N characters are extracted. + For N<0, size(Input)-|N| characters are extracted. + \param Format A substitute string + */ + template + inline void replace_tail( + SequenceT& Input, + int N, + const RangeT& Format ) + { + ::autoboost::algorithm::find_format( + Input, + ::autoboost::algorithm::tail_finder(N), + ::autoboost::algorithm::const_formatter(Format) ); + } + + } // namespace algorithm + + // pull names to the boost namespace + using algorithm::replace_range_copy; + using algorithm::replace_range; + using algorithm::replace_first_copy; + using algorithm::replace_first; + using algorithm::ireplace_first_copy; + using algorithm::ireplace_first; + using algorithm::replace_last_copy; + using algorithm::replace_last; + using algorithm::ireplace_last_copy; + using algorithm::ireplace_last; + using algorithm::replace_nth_copy; + using algorithm::replace_nth; + using algorithm::ireplace_nth_copy; + using algorithm::ireplace_nth; + using algorithm::replace_all_copy; + using algorithm::replace_all; + using algorithm::ireplace_all_copy; + using algorithm::ireplace_all; + using algorithm::replace_head_copy; + using algorithm::replace_head; + using algorithm::replace_tail_copy; + using algorithm::replace_tail; + +} // namespace autoboost + +#endif // AUTOBOOST_REPLACE_HPP diff --git a/contrib/autoboost/boost/algorithm/string/sequence_traits.hpp b/contrib/autoboost/autoboost/algorithm/string/sequence_traits.hpp similarity index 76% rename from contrib/autoboost/boost/algorithm/string/sequence_traits.hpp rename to contrib/autoboost/autoboost/algorithm/string/sequence_traits.hpp index d668b1ed8..ea3a8c8b4 100644 --- a/contrib/autoboost/boost/algorithm/string/sequence_traits.hpp +++ b/contrib/autoboost/autoboost/algorithm/string/sequence_traits.hpp @@ -8,12 +8,12 @@ // See http://www.boost.org/ for updates, documentation, and revision history. -#ifndef BOOST_STRING_SEQUENCE_TRAITS_HPP -#define BOOST_STRING_SEQUENCE_TRAITS_HPP +#ifndef AUTOBOOST_STRING_SEQUENCE_TRAITS_HPP +#define AUTOBOOST_STRING_SEQUENCE_TRAITS_HPP -#include -#include -#include +#include +#include +#include /*! \file Traits defined in this header are used by various algorithms to achieve @@ -46,11 +46,11 @@ namespace autoboost { { public: -# if BOOST_WORKAROUND( __IBMCPP__, <= 600 ) +# if AUTOBOOST_WORKAROUND( __IBMCPP__, <= 600 ) enum { value = false }; # else - BOOST_STATIC_CONSTANT(bool, value=false); -# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) + AUTOBOOST_STATIC_CONSTANT(bool, value=false); +# endif // AUTOBOOST_WORKAROUND( __IBMCPP__, <= 600 ) typedef mpl::bool_::value> type; @@ -66,11 +66,11 @@ namespace autoboost { class has_stable_iterators { public: -# if BOOST_WORKAROUND( __IBMCPP__, <= 600 ) +# if AUTOBOOST_WORKAROUND( __IBMCPP__, <= 600 ) enum { value = false }; # else - BOOST_STATIC_CONSTANT(bool, value=false); -# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) + AUTOBOOST_STATIC_CONSTANT(bool, value=false); +# endif // AUTOBOOST_WORKAROUND( __IBMCPP__, <= 600 ) typedef mpl::bool_::value> type; }; @@ -85,11 +85,11 @@ namespace autoboost { class has_const_time_insert { public: -# if BOOST_WORKAROUND( __IBMCPP__, <= 600 ) +# if AUTOBOOST_WORKAROUND( __IBMCPP__, <= 600 ) enum { value = false }; # else - BOOST_STATIC_CONSTANT(bool, value=false); -# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) + AUTOBOOST_STATIC_CONSTANT(bool, value=false); +# endif // AUTOBOOST_WORKAROUND( __IBMCPP__, <= 600 ) typedef mpl::bool_::value> type; }; @@ -104,11 +104,11 @@ namespace autoboost { class has_const_time_erase { public: -# if BOOST_WORKAROUND( __IBMCPP__, <= 600 ) +# if AUTOBOOST_WORKAROUND( __IBMCPP__, <= 600 ) enum { value = false }; # else - BOOST_STATIC_CONSTANT(bool, value=false); -# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 ) + AUTOBOOST_STATIC_CONSTANT(bool, value=false); +# endif // AUTOBOOST_WORKAROUND( __IBMCPP__, <= 600 ) typedef mpl::bool_::value> type; }; @@ -117,4 +117,4 @@ namespace autoboost { } // namespace autoboost -#endif // BOOST_STRING_SEQUENCE_TRAITS_HPP +#endif // AUTOBOOST_STRING_SEQUENCE_TRAITS_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/split.hpp b/contrib/autoboost/autoboost/algorithm/string/split.hpp new file mode 100644 index 000000000..299b3c171 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/split.hpp @@ -0,0 +1,163 @@ +// Boost string_algo library split.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2006. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_SPLIT_HPP +#define AUTOBOOST_STRING_SPLIT_HPP + +#include + +#include +#include +#include + +/*! \file + Defines basic split algorithms. + Split algorithms can be used to divide a string + into several parts according to given criteria. + + Each part is copied and added as a new element to the + output container. + Thus the result container must be able to hold copies + of the matches (in a compatible structure like std::string) or + a reference to it (e.g. using the iterator range class). + Examples of such a container are \c std::vector + or \c std::list> +*/ + +namespace autoboost { + namespace algorithm { + +// find_all ------------------------------------------------------------// + + //! Find all algorithm + /*! + This algorithm finds all occurrences of the search string + in the input. + + Each part is copied and added as a new element to the + output container. + Thus the result container must be able to hold copies + of the matches (in a compatible structure like std::string) or + a reference to it (e.g. using the iterator range class). + Examples of such a container are \c std::vector + or \c std::list> + + \param Result A container that can hold copies of references to the substrings + \param Input A container which will be searched. + \param Search A substring to be searched for. + \return A reference the result + + \note Prior content of the result will be overwritten. + + \note This function provides the strong exception-safety guarantee + */ + template< typename SequenceSequenceT, typename Range1T, typename Range2T > + inline SequenceSequenceT& find_all( + SequenceSequenceT& Result, + Range1T& Input, + const Range2T& Search) + { + return ::autoboost::algorithm::iter_find( + Result, + Input, + ::autoboost::algorithm::first_finder(Search) ); + } + + //! Find all algorithm ( case insensitive ) + /*! + This algorithm finds all occurrences of the search string + in the input. + Each part is copied and added as a new element to the + output container. Thus the result container must be able to hold copies + of the matches (in a compatible structure like std::string) or + a reference to it (e.g. using the iterator range class). + Examples of such a container are \c std::vector + or \c std::list> + + Searching is case insensitive. + + \param Result A container that can hold copies of references to the substrings + \param Input A container which will be searched. + \param Search A substring to be searched for. + \param Loc A locale used for case insensitive comparison + \return A reference the result + + \note Prior content of the result will be overwritten. + + \note This function provides the strong exception-safety guarantee + */ + template< typename SequenceSequenceT, typename Range1T, typename Range2T > + inline SequenceSequenceT& ifind_all( + SequenceSequenceT& Result, + Range1T& Input, + const Range2T& Search, + const std::locale& Loc=std::locale() ) + { + return ::autoboost::algorithm::iter_find( + Result, + Input, + ::autoboost::algorithm::first_finder(Search, is_iequal(Loc) ) ); + } + + +// tokenize -------------------------------------------------------------// + + //! Split algorithm + /*! + Tokenize expression. This function is equivalent to C strtok. Input + sequence is split into tokens, separated by separators. Separators + are given by means of the predicate. + + Each part is copied and added as a new element to the + output container. + Thus the result container must be able to hold copies + of the matches (in a compatible structure like std::string) or + a reference to it (e.g. using the iterator range class). + Examples of such a container are \c std::vector + or \c std::list> + + \param Result A container that can hold copies of references to the substrings + \param Input A container which will be searched. + \param Pred A predicate to identify separators. This predicate is + supposed to return true if a given element is a separator. + \param eCompress If eCompress argument is set to token_compress_on, adjacent + separators are merged together. Otherwise, every two separators + delimit a token. + \return A reference the result + + \note Prior content of the result will be overwritten. + + \note This function provides the strong exception-safety guarantee + */ + template< typename SequenceSequenceT, typename RangeT, typename PredicateT > + inline SequenceSequenceT& split( + SequenceSequenceT& Result, + RangeT& Input, + PredicateT Pred, + token_compress_mode_type eCompress=token_compress_off ) + { + return ::autoboost::algorithm::iter_split( + Result, + Input, + ::autoboost::algorithm::token_finder( Pred, eCompress ) ); + } + + } // namespace algorithm + + // pull names to the boost namespace + using algorithm::find_all; + using algorithm::ifind_all; + using algorithm::split; + +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_SPLIT_HPP + diff --git a/contrib/autoboost/autoboost/algorithm/string/trim.hpp b/contrib/autoboost/autoboost/algorithm/string/trim.hpp new file mode 100644 index 000000000..26db59e70 --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/trim.hpp @@ -0,0 +1,398 @@ +// Boost string_algo library trim.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_TRIM_HPP +#define AUTOBOOST_STRING_TRIM_HPP + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +/*! \file + Defines trim algorithms. + Trim algorithms are used to remove trailing and leading spaces from a + sequence (string). Space is recognized using given locales. + + Parametric (\c _if) variants use a predicate (functor) to select which characters + are to be trimmed.. + Functions take a selection predicate as a parameter, which is used to determine + whether a character is a space. Common predicates are provided in classification.hpp header. + +*/ + +namespace autoboost { + namespace algorithm { + + // left trim -----------------------------------------------// + + + //! Left trim - parametric + /*! + Remove all leading spaces from the input. + The supplied predicate is used to determine which characters are considered spaces. + The result is a trimmed copy of the input. It is returned as a sequence + or copied to the output iterator + + \param Output An output iterator to which the result will be copied + \param Input An input range + \param IsSpace A unary predicate identifying spaces + \return + An output iterator pointing just after the last inserted character or + a copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template + inline OutputIteratorT trim_left_copy_if( + OutputIteratorT Output, + const RangeT& Input, + PredicateT IsSpace) + { + iterator_range::type> lit_range(::autoboost::as_literal(Input)); + + std::copy( + ::autoboost::algorithm::detail::trim_begin( + ::autoboost::begin(lit_range), + ::autoboost::end(lit_range), + IsSpace ), + ::autoboost::end(lit_range), + Output); + + return Output; + } + + //! Left trim - parametric + /*! + \overload + */ + template + inline SequenceT trim_left_copy_if(const SequenceT& Input, PredicateT IsSpace) + { + return SequenceT( + ::autoboost::algorithm::detail::trim_begin( + ::autoboost::begin(Input), + ::autoboost::end(Input), + IsSpace ), + ::autoboost::end(Input)); + } + + //! Left trim - parametric + /*! + Remove all leading spaces from the input. + The result is a trimmed copy of the input. + + \param Input An input sequence + \param Loc a locale used for 'space' classification + \return A trimmed copy of the input + + \note This function provides the strong exception-safety guarantee + */ + template + inline SequenceT trim_left_copy(const SequenceT& Input, const std::locale& Loc=std::locale()) + { + return + ::autoboost::algorithm::trim_left_copy_if( + Input, + is_space(Loc)); + } + + //! Left trim + /*! + Remove all leading spaces from the input. The supplied predicate is + used to determine which characters are considered spaces. + The input sequence is modified in-place. + + \param Input An input sequence + \param IsSpace A unary predicate identifying spaces + */ + template + inline void trim_left_if(SequenceT& Input, PredicateT IsSpace) + { + Input.erase( + ::autoboost::begin(Input), + ::autoboost::algorithm::detail::trim_begin( + ::autoboost::begin(Input), + ::autoboost::end(Input), + IsSpace)); + } + + //! Left trim + /*! + Remove all leading spaces from the input. + The Input sequence is modified in-place. + + \param Input An input sequence + \param Loc A locale used for 'space' classification + */ + template + inline void trim_left(SequenceT& Input, const std::locale& Loc=std::locale()) + { + ::autoboost::algorithm::trim_left_if( + Input, + is_space(Loc)); + } + + // right trim -----------------------------------------------// + + //! Right trim - parametric + /*! + Remove all trailing spaces from the input. + The supplied predicate is used to determine which characters are considered spaces. + The result is a trimmed copy of the input. It is returned as a sequence + or copied to the output iterator + + \param Output An output iterator to which the result will be copied + \param Input An input range + \param IsSpace A unary predicate identifying spaces + \return + An output iterator pointing just after the last inserted character or + a copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template + inline OutputIteratorT trim_right_copy_if( + OutputIteratorT Output, + const RangeT& Input, + PredicateT IsSpace ) + { + iterator_range::type> lit_range(::autoboost::as_literal(Input)); + + std::copy( + ::autoboost::begin(lit_range), + ::autoboost::algorithm::detail::trim_end( + ::autoboost::begin(lit_range), + ::autoboost::end(lit_range), + IsSpace ), + Output ); + + return Output; + } + + //! Right trim - parametric + /*! + \overload + */ + template + inline SequenceT trim_right_copy_if(const SequenceT& Input, PredicateT IsSpace) + { + return SequenceT( + ::autoboost::begin(Input), + ::autoboost::algorithm::detail::trim_end( + ::autoboost::begin(Input), + ::autoboost::end(Input), + IsSpace) + ); + } + + //! Right trim + /*! + Remove all trailing spaces from the input. + The result is a trimmed copy of the input + + \param Input An input sequence + \param Loc A locale used for 'space' classification + \return A trimmed copy of the input + + \note This function provides the strong exception-safety guarantee + */ + template + inline SequenceT trim_right_copy(const SequenceT& Input, const std::locale& Loc=std::locale()) + { + return + ::autoboost::algorithm::trim_right_copy_if( + Input, + is_space(Loc)); + } + + + //! Right trim - parametric + /*! + Remove all trailing spaces from the input. + The supplied predicate is used to determine which characters are considered spaces. + The input sequence is modified in-place. + + \param Input An input sequence + \param IsSpace A unary predicate identifying spaces + */ + template + inline void trim_right_if(SequenceT& Input, PredicateT IsSpace) + { + Input.erase( + ::autoboost::algorithm::detail::trim_end( + ::autoboost::begin(Input), + ::autoboost::end(Input), + IsSpace ), + ::autoboost::end(Input) + ); + } + + + //! Right trim + /*! + Remove all trailing spaces from the input. + The input sequence is modified in-place. + + \param Input An input sequence + \param Loc A locale used for 'space' classification + */ + template + inline void trim_right(SequenceT& Input, const std::locale& Loc=std::locale()) + { + ::autoboost::algorithm::trim_right_if( + Input, + is_space(Loc) ); + } + + // both side trim -----------------------------------------------// + + //! Trim - parametric + /*! + Remove all trailing and leading spaces from the input. + The supplied predicate is used to determine which characters are considered spaces. + The result is a trimmed copy of the input. It is returned as a sequence + or copied to the output iterator + + \param Output An output iterator to which the result will be copied + \param Input An input range + \param IsSpace A unary predicate identifying spaces + \return + An output iterator pointing just after the last inserted character or + a copy of the input + + \note The second variant of this function provides the strong exception-safety guarantee + */ + template + inline OutputIteratorT trim_copy_if( + OutputIteratorT Output, + const RangeT& Input, + PredicateT IsSpace) + { + iterator_range::type> lit_range(::autoboost::as_literal(Input)); + + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type TrimEnd= + ::autoboost::algorithm::detail::trim_end( + ::autoboost::begin(lit_range), + ::autoboost::end(lit_range), + IsSpace); + + std::copy( + detail::trim_begin( + ::autoboost::begin(lit_range), TrimEnd, IsSpace), + TrimEnd, + Output + ); + + return Output; + } + + //! Trim - parametric + /*! + \overload + */ + template + inline SequenceT trim_copy_if(const SequenceT& Input, PredicateT IsSpace) + { + AUTOBOOST_STRING_TYPENAME + range_const_iterator::type TrimEnd= + ::autoboost::algorithm::detail::trim_end( + ::autoboost::begin(Input), + ::autoboost::end(Input), + IsSpace); + + return SequenceT( + detail::trim_begin( + ::autoboost::begin(Input), + TrimEnd, + IsSpace), + TrimEnd + ); + } + + //! Trim + /*! + Remove all leading and trailing spaces from the input. + The result is a trimmed copy of the input + + \param Input An input sequence + \param Loc A locale used for 'space' classification + \return A trimmed copy of the input + + \note This function provides the strong exception-safety guarantee + */ + template + inline SequenceT trim_copy( const SequenceT& Input, const std::locale& Loc=std::locale() ) + { + return + ::autoboost::algorithm::trim_copy_if( + Input, + is_space(Loc) ); + } + + //! Trim + /*! + Remove all leading and trailing spaces from the input. + The supplied predicate is used to determine which characters are considered spaces. + The input sequence is modified in-place. + + \param Input An input sequence + \param IsSpace A unary predicate identifying spaces + */ + template + inline void trim_if(SequenceT& Input, PredicateT IsSpace) + { + ::autoboost::algorithm::trim_right_if( Input, IsSpace ); + ::autoboost::algorithm::trim_left_if( Input, IsSpace ); + } + + //! Trim + /*! + Remove all leading and trailing spaces from the input. + The input sequence is modified in-place. + + \param Input An input sequence + \param Loc A locale used for 'space' classification + */ + template + inline void trim(SequenceT& Input, const std::locale& Loc=std::locale()) + { + ::autoboost::algorithm::trim_if( + Input, + is_space( Loc ) ); + } + + } // namespace algorithm + + // pull names to the boost namespace + using algorithm::trim_left; + using algorithm::trim_left_if; + using algorithm::trim_left_copy; + using algorithm::trim_left_copy_if; + using algorithm::trim_right; + using algorithm::trim_right_if; + using algorithm::trim_right_copy; + using algorithm::trim_right_copy_if; + using algorithm::trim; + using algorithm::trim_if; + using algorithm::trim_copy; + using algorithm::trim_copy_if; + +} // namespace autoboost + +#endif // AUTOBOOST_STRING_TRIM_HPP diff --git a/contrib/autoboost/autoboost/algorithm/string/yes_no_type.hpp b/contrib/autoboost/autoboost/algorithm/string/yes_no_type.hpp new file mode 100644 index 000000000..00604285f --- /dev/null +++ b/contrib/autoboost/autoboost/algorithm/string/yes_no_type.hpp @@ -0,0 +1,33 @@ +// Boost string_algo library yes_no_type.hpp header file ---------------------------// + +// Copyright Pavol Droba 2002-2003. +// +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_STRING_YES_NO_TYPE_DETAIL_HPP +#define AUTOBOOST_STRING_YES_NO_TYPE_DETAIL_HPP + +namespace autoboost { + namespace algorithm { + + // taken from boost mailing-list + // when yes_no_type will become officially + // a part of boost distribution, this header + // will be deprecated + template struct size_descriptor + { + typedef char (& type)[I]; + }; + + typedef size_descriptor<1>::type yes_type; + typedef size_descriptor<2>::type no_type; + + } // namespace algorithm +} // namespace autoboost + + +#endif // AUTOBOOST_STRING_YES_NO_TYPE_DETAIL_HPP diff --git a/contrib/autoboost/autoboost/align/align.hpp b/contrib/autoboost/autoboost/align/align.hpp new file mode 100644 index 000000000..cf948733e --- /dev/null +++ b/contrib/autoboost/autoboost/align/align.hpp @@ -0,0 +1,20 @@ +/* + (c) 2014 Glen Joseph Fernandes + glenjofe at gmail dot com + + Distributed under the Boost Software + License, Version 1.0. + http://boost.org/LICENSE_1_0.txt +*/ +#ifndef AUTOBOOST_ALIGN_ALIGN_HPP +#define AUTOBOOST_ALIGN_ALIGN_HPP + +#include + +#if !defined(AUTOBOOST_NO_CXX11_STD_ALIGN) +#include +#else +#include +#endif + +#endif diff --git a/contrib/autoboost/autoboost/align/detail/address.hpp b/contrib/autoboost/autoboost/align/detail/address.hpp new file mode 100644 index 000000000..739a15909 --- /dev/null +++ b/contrib/autoboost/autoboost/align/detail/address.hpp @@ -0,0 +1,27 @@ +/* + (c) 2014 Glen Joseph Fernandes + glenjofe at gmail dot com + + Distributed under the Boost Software + License, Version 1.0. + http://boost.org/LICENSE_1_0.txt +*/ +#ifndef AUTOBOOST_ALIGN_DETAIL_ADDRESS_HPP +#define AUTOBOOST_ALIGN_DETAIL_ADDRESS_HPP + +#include +#include + +namespace autoboost { + namespace alignment { + namespace detail { +#if defined(AUTOBOOST_HAS_INTPTR_T) + typedef autoboost::uintptr_t address_t; +#else + typedef std::size_t address_t; +#endif + } + } +} + +#endif diff --git a/contrib/autoboost/autoboost/align/detail/align.hpp b/contrib/autoboost/autoboost/align/detail/align.hpp new file mode 100644 index 000000000..ecda35b38 --- /dev/null +++ b/contrib/autoboost/autoboost/align/detail/align.hpp @@ -0,0 +1,38 @@ +/* + (c) 2014 Glen Joseph Fernandes + glenjofe at gmail dot com + + Distributed under the Boost Software + License, Version 1.0. + http://boost.org/LICENSE_1_0.txt +*/ +#ifndef AUTOBOOST_ALIGN_DETAIL_ALIGN_HPP +#define AUTOBOOST_ALIGN_DETAIL_ALIGN_HPP + +#include +#include +#include +#include + +namespace autoboost { + namespace alignment { + inline void* align(std::size_t alignment, std::size_t size, + void*& ptr, std::size_t& space) + { + AUTOBOOST_ASSERT(detail::is_alignment(alignment)); + std::size_t n = detail::address_t(ptr) & (alignment - 1); + if (n != 0) { + n = alignment - n; + } + void* p = 0; + if (n <= space && size <= space - n) { + p = static_cast(ptr) + n; + ptr = p; + space -= n; + } + return p; + } + } +} + +#endif diff --git a/contrib/autoboost/autoboost/align/detail/align_cxx11.hpp b/contrib/autoboost/autoboost/align/detail/align_cxx11.hpp new file mode 100644 index 000000000..d49b1fcf7 --- /dev/null +++ b/contrib/autoboost/autoboost/align/detail/align_cxx11.hpp @@ -0,0 +1,20 @@ +/* + (c) 2014 Glen Joseph Fernandes + glenjofe at gmail dot com + + Distributed under the Boost Software + License, Version 1.0. + http://boost.org/LICENSE_1_0.txt +*/ +#ifndef AUTOBOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP +#define AUTOBOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP + +#include + +namespace autoboost { + namespace alignment { + using std::align; + } +} + +#endif diff --git a/contrib/autoboost/autoboost/align/detail/is_alignment.hpp b/contrib/autoboost/autoboost/align/detail/is_alignment.hpp new file mode 100644 index 000000000..6009c51da --- /dev/null +++ b/contrib/autoboost/autoboost/align/detail/is_alignment.hpp @@ -0,0 +1,27 @@ +/* + (c) 2014 Glen Joseph Fernandes + glenjofe at gmail dot com + + Distributed under the Boost Software + License, Version 1.0. + http://boost.org/LICENSE_1_0.txt +*/ +#ifndef AUTOBOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP +#define AUTOBOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP + +#include +#include + +namespace autoboost { + namespace alignment { + namespace detail { + AUTOBOOST_CONSTEXPR inline bool is_alignment(std::size_t + value) AUTOBOOST_NOEXCEPT + { + return (value > 0) && ((value & (value - 1)) == 0); + } + } + } +} + +#endif diff --git a/contrib/autoboost/autoboost/aligned_storage.hpp b/contrib/autoboost/autoboost/aligned_storage.hpp new file mode 100644 index 000000000..74c370929 --- /dev/null +++ b/contrib/autoboost/autoboost/aligned_storage.hpp @@ -0,0 +1,143 @@ +//----------------------------------------------------------------------------- +// boost aligned_storage.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002-2003 +// Eric Friedman, Itay Maman +// +// 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) + +#ifndef AUTOBOOST_ALIGNED_STORAGE_HPP +#define AUTOBOOST_ALIGNED_STORAGE_HPP + +#include // for std::size_t + +#include "autoboost/config.hpp" +#include "autoboost/detail/workaround.hpp" +#include "autoboost/type_traits/alignment_of.hpp" +#include "autoboost/type_traits/type_with_alignment.hpp" +#include "autoboost/type_traits/is_pod.hpp" + +#include "autoboost/mpl/eval_if.hpp" +#include "autoboost/mpl/identity.hpp" + +#include "autoboost/type_traits/detail/bool_trait_def.hpp" + +namespace autoboost { + +namespace detail { namespace aligned_storage { + +AUTOBOOST_STATIC_CONSTANT( + std::size_t + , alignment_of_max_align = ::autoboost::alignment_of::value + ); + +// +// To be TR1 conforming this must be a POD type: +// +template < + std::size_t size_ + , std::size_t alignment_ +> +struct aligned_storage_imp +{ + union data_t + { + char buf[size_]; + + typename ::autoboost::mpl::eval_if_c< + alignment_ == std::size_t(-1) + , ::autoboost::mpl::identity< ::autoboost::detail::max_align > + , ::autoboost::type_with_alignment + >::type align_; + } data_; + void* address() const { return const_cast(this); } +}; + +template< std::size_t alignment_ > +struct aligned_storage_imp<0u,alignment_> +{ + /* intentionally empty */ + void* address() const { return 0; } +}; + +}} // namespace detail::aligned_storage + +template < + std::size_t size_ + , std::size_t alignment_ = std::size_t(-1) +> +class aligned_storage : +#ifndef __BORLANDC__ + private +#else + public +#endif + ::autoboost::detail::aligned_storage::aligned_storage_imp +{ + +public: // constants + + typedef ::autoboost::detail::aligned_storage::aligned_storage_imp type; + + AUTOBOOST_STATIC_CONSTANT( + std::size_t + , size = size_ + ); + AUTOBOOST_STATIC_CONSTANT( + std::size_t + , alignment = ( + alignment_ == std::size_t(-1) + ? ::autoboost::detail::aligned_storage::alignment_of_max_align + : alignment_ + ) + ); + +private: // noncopyable + + aligned_storage(const aligned_storage&); + aligned_storage& operator=(const aligned_storage&); + +public: // structors + + aligned_storage() + { + } + + ~aligned_storage() + { + } + +public: // accessors + + void* address() + { + return static_cast(this)->address(); + } + + const void* address() const + { + return static_cast(this)->address(); + } +}; + +// +// Make sure that is_pod recognises aligned_storage<>::type +// as a POD (Note that aligned_storage<> itself is not a POD): +// +template +struct is_pod< ::autoboost::detail::aligned_storage::aligned_storage_imp > + AUTOBOOST_TT_AUX_BOOL_C_BASE(true) +{ + AUTOBOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) +}; + + +} // namespace autoboost + +#include "autoboost/type_traits/detail/bool_trait_undef.hpp" + +#endif // AUTOBOOST_ALIGNED_STORAGE_HPP diff --git a/contrib/autoboost/autoboost/archive/add_facet.hpp b/contrib/autoboost/autoboost/archive/add_facet.hpp new file mode 100644 index 000000000..a3d787ae3 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/add_facet.hpp @@ -0,0 +1,55 @@ +#ifndef AUTOBOOST_ARCHIVE_ADD_FACET_HPP +#define AUTOBOOST_ARCHIVE_ADD_FACET_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// add_facet.hpp + +// (C) Copyright 2003 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include +#include +#include + +// does STLport uses native STL for locales? +#if (defined(__SGI_STL_PORT)&& defined(_STLP_NO_OWN_IOSTREAMS)) +// and this native STL lib is old Dinkumware (has not defined _CPPLIB_VER) +# if (defined(_YVALS) && !defined(__IBMCPP__)) || !defined(_CPPLIB_VER) +# define AUTOBOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT +# endif +#endif + +namespace autoboost { +namespace archive { + +template +inline std::locale * +add_facet(const std::locale &l, Facet * f){ + return + #if defined AUTOBOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT + // std namespace used for native locale + new std::locale(std::_Addfac(l, f)); + #elif AUTOBOOST_WORKAROUND(AUTOBOOST_DINKUMWARE_STDLIB, == 1) // old Dinkumwar + // std namespace used for native locale + new std::locale(std::_Addfac(l, f)); + #else + // standard compatible + new std::locale(l, f); + #endif +} + +} // namespace archive +} // namespace autoboost + +#undef AUTOBOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT + +#endif // AUTOBOOST_ARCHIVE_ADD_FACET_HPP diff --git a/contrib/autoboost/boost/archive/archive_exception.hpp b/contrib/autoboost/autoboost/archive/archive_exception.hpp similarity index 85% rename from contrib/autoboost/boost/archive/archive_exception.hpp rename to contrib/autoboost/autoboost/archive/archive_exception.hpp index 7dfdcdda0..5af0d8f60 100644 --- a/contrib/autoboost/boost/archive/archive_exception.hpp +++ b/contrib/autoboost/autoboost/archive/archive_exception.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP -#define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP +#ifndef AUTOBOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP +#define AUTOBOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -17,22 +17,22 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include +#include #include -#include -#include -#include +#include +#include +#include // note: the only reason this is in here is that windows header // includes #define exception_code _exception_code (arrrgghhhh!). // the most expedient way to address this is be sure that this // header is always included whenever this header file is included. -#if defined(BOOST_WINDOWS) +#if defined(AUTOBOOST_WINDOWS) #include #endif -#include // must be the last header +#include // must be the last header namespace autoboost { namespace archive { @@ -40,7 +40,7 @@ namespace archive { ////////////////////////////////////////////////////////////////////// // exceptions thrown by archives // -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) archive_exception : public virtual std::exception { protected: @@ -94,6 +94,6 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : }// namespace archive }// namespace autoboost -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas -#endif //BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP +#endif //AUTOBOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP diff --git a/contrib/autoboost/autoboost/archive/basic_archive.hpp b/contrib/autoboost/autoboost/archive/basic_archive.hpp new file mode 100644 index 000000000..eb1649bd5 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/basic_archive.hpp @@ -0,0 +1,304 @@ +#ifndef AUTOBOOST_ARCHIVE_BASIC_ARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_ARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_archive.hpp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. +#include // count +#include +#include +#include // size_t +#include +#include + +#include +#include // must be the last header + +namespace autoboost { +namespace archive { + +#if defined(_MSC_VER) +#pragma warning( push ) +#pragma warning( disable : 4244 4267 ) +#endif + +/* NOTE : Warning : Warning : Warning : Warning : Warning + * Don't ever changes this. If you do, they previously created + * binary archives won't be readable !!! + */ +class library_version_type { +private: + typedef uint_least16_t base_type; + base_type t; +public: + library_version_type(): t(0) {}; + explicit library_version_type(const unsigned int & t_) : t(t_){ + AUTOBOOST_ASSERT(t_ <= autoboost::integer_traits::const_max); + } + library_version_type(const library_version_type & t_) : + t(t_.t) + {} + library_version_type & operator=(const library_version_type & rhs){ + t = rhs.t; + return *this; + } + // used for text output + operator base_type () const { + return t; + } + // used for text input + operator base_type & (){ + return t; + } + bool operator==(const library_version_type & rhs) const { + return t == rhs.t; + } + bool operator<(const library_version_type & rhs) const { + return t < rhs.t; + } +}; + +AUTOBOOST_ARCHIVE_DECL(library_version_type) +AUTOBOOST_ARCHIVE_VERSION(); + +class version_type { +private: + typedef uint_least32_t base_type; + base_type t; +public: + // should be private - but MPI fails if it's not!!! + version_type(): t(0) {}; + explicit version_type(const unsigned int & t_) : t(t_){ + AUTOBOOST_ASSERT(t_ <= autoboost::integer_traits::const_max); + } + version_type(const version_type & t_) : + t(t_.t) + {} + version_type & operator=(const version_type & rhs){ + t = rhs.t; + return *this; + } + // used for text output + operator base_type () const { + return t; + } + // used for text intput + operator base_type & (){ + return t; + } + bool operator==(const version_type & rhs) const { + return t == rhs.t; + } + bool operator<(const version_type & rhs) const { + return t < rhs.t; + } +}; + +class class_id_type { +private: + typedef int_least16_t base_type; + base_type t; +public: + // should be private - but then can't use AUTOBOOST_STRONG_TYPE below + class_id_type() : t(0) {}; + explicit class_id_type(const int t_) : t(t_){ + AUTOBOOST_ASSERT(t_ <= autoboost::integer_traits::const_max); + } + explicit class_id_type(const std::size_t t_) : t(t_){ + // AUTOBOOST_ASSERT(t_ <= autoboost::integer_traits::const_max); + } + class_id_type(const class_id_type & t_) : + t(t_.t) + {} + class_id_type & operator=(const class_id_type & rhs){ + t = rhs.t; + return *this; + } + + // used for text output + operator int () const { + return t; + } + // used for text input + operator int_least16_t &() { + return t; + } + bool operator==(const class_id_type & rhs) const { + return t == rhs.t; + } + bool operator<(const class_id_type & rhs) const { + return t < rhs.t; + } +}; + +#define NULL_POINTER_TAG autoboost::archive::class_id_type(-1) + +class object_id_type { +private: + typedef uint_least32_t base_type; + base_type t; +public: + object_id_type(): t(0) {}; + // note: presumes that size_t >= unsigned int. + explicit object_id_type(const std::size_t & t_) : t(t_){ + AUTOBOOST_ASSERT(t_ <= autoboost::integer_traits::const_max); + } + object_id_type(const object_id_type & t_) : + t(t_.t) + {} + object_id_type & operator=(const object_id_type & rhs){ + t = rhs.t; + return *this; + } + // used for text output + operator uint_least32_t () const { + return t; + } + // used for text input + operator uint_least32_t & () { + return t; + } + bool operator==(const object_id_type & rhs) const { + return t == rhs.t; + } + bool operator<(const object_id_type & rhs) const { + return t < rhs.t; + } +}; + +#if defined(_MSC_VER) +#pragma warning( pop ) +#endif + +struct tracking_type { + bool t; + explicit tracking_type(const bool t_ = false) + : t(t_) + {}; + tracking_type(const tracking_type & t_) + : t(t_.t) + {} + operator bool () const { + return t; + }; + operator bool & () { + return t; + }; + tracking_type & operator=(const bool t_){ + t = t_; + return *this; + } + bool operator==(const tracking_type & rhs) const { + return t == rhs.t; + } + bool operator==(const bool & rhs) const { + return t == rhs; + } + tracking_type & operator=(const tracking_type & rhs){ + t = rhs.t; + return *this; + } +}; + +struct class_name_type : + private autoboost::noncopyable +{ + char *t; + operator const char * & () const { + return const_cast(t); + } + operator char * () { + return t; + } + std::size_t size() const { + return std::strlen(t); + } + explicit class_name_type(const char *key_) + : t(const_cast(key_)){} + explicit class_name_type(char *key_) + : t(key_){} + class_name_type & operator=(const class_name_type & rhs){ + t = rhs.t; + return *this; + } +}; + +enum archive_flags { + no_header = 1, // suppress archive header info + no_codecvt = 2, // suppress alteration of codecvt facet + no_xml_tag_checking = 4, // suppress checking of xml tags + no_tracking = 8, // suppress ALL tracking + flags_last = 8 +}; + +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_SIGNATURE(); + +/* NOTE : Warning : Warning : Warning : Warning : Warning + * If any of these are changed to different sized types, + * binary_iarchive won't be able to read older archives + * unless you rev the library version and include conditional + * code based on the library version. There is nothing + * inherently wrong in doing this - but you have to be super + * careful because it's easy to get wrong and start breaking + * old archives !!! + */ + +#define AUTOBOOST_ARCHIVE_STRONG_TYPEDEF(T, D) \ + class D : public T { \ + public: \ + explicit D(const T tt) : T(tt){} \ + }; \ +/**/ + +AUTOBOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_reference_type) +AUTOBOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_optional_type) +AUTOBOOST_ARCHIVE_STRONG_TYPEDEF(object_id_type, object_reference_type) + +}// namespace archive +}// namespace autoboost + +#include // pops abi_suffix.hpp pragmas + +#include + +// set implementation level to primitive for all types +// used internally by the serialization library + +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::library_version_type, primitive_type) +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::version_type, primitive_type) +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::class_id_type, primitive_type) +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::class_id_reference_type, primitive_type) +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::class_id_optional_type, primitive_type) +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::class_name_type, primitive_type) +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::object_id_type, primitive_type) +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::object_reference_type, primitive_type) +AUTOBOOST_CLASS_IMPLEMENTATION(autoboost::archive::tracking_type, primitive_type) + +#include + +// set types used internally by the serialization library +// to be bitwise serializable + +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::library_version_type) +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::version_type) +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::class_id_type) +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::class_id_reference_type) +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::class_id_optional_type) +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::class_name_type) +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::object_id_type) +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::object_reference_type) +AUTOBOOST_IS_BITWISE_SERIALIZABLE(autoboost::archive::tracking_type) + +#endif //AUTOBOOST_ARCHIVE_BASIC_ARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/basic_binary_iarchive.hpp b/contrib/autoboost/autoboost/archive/basic_binary_iarchive.hpp similarity index 82% rename from contrib/autoboost/boost/archive/basic_binary_iarchive.hpp rename to contrib/autoboost/autoboost/archive/basic_binary_iarchive.hpp index f089ab2e4..b1df083b9 100644 --- a/contrib/autoboost/boost/archive/basic_binary_iarchive.hpp +++ b/contrib/autoboost/autoboost/archive/basic_binary_iarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP -#define BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -23,23 +23,23 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif -#include // must be the last header +#include // must be the last header namespace autoboost { namespace archive { @@ -54,11 +54,11 @@ template class basic_binary_iarchive : public detail::common_iarchive { -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) // for some inexplicable reason insertion of "class" generates compile erro // on msvc 7.1 friend detail::interface_iarchive; @@ -72,18 +72,18 @@ class basic_binary_iarchive : // note extra nonsense to sneak it pass the borland compiers typedef detail::common_iarchive detail_common_iarchive; template - void load_override(T & t, BOOST_PFTO int version){ + void load_override(T & t, AUTOBOOST_PFTO int version){ this->detail_common_iarchive::load_override(t, static_cast(version)); } // include these to trap a change in binary format which // isn't specifically handled // upto 32K classes - BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t)); - BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t)); + AUTOBOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t)); + AUTOBOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t)); // upto 2G objects - BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t)); - BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t)); + AUTOBOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t)); + AUTOBOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t)); // binary files don't include the optional information void load_override(class_id_optional_type & /* t */, int){} @@ -206,9 +206,9 @@ class basic_binary_iarchive : } } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) load_override(class_name_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) init(); basic_binary_iarchive(unsigned int flags) : @@ -219,10 +219,10 @@ class basic_binary_iarchive : } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas -#endif // BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/basic_binary_iprimitive.hpp b/contrib/autoboost/autoboost/archive/basic_binary_iprimitive.hpp new file mode 100644 index 000000000..9efe5581a --- /dev/null +++ b/contrib/autoboost/autoboost/archive/basic_binary_iprimitive.hpp @@ -0,0 +1,190 @@ +#ifndef AUTOBOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP +#define AUTOBOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +#if defined(_MSC_VER) +#pragma warning( disable : 4800 ) +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_iprimitive.hpp +// +// archives stored as native binary - this should be the fastest way +// to archive the state of a group of obects. It makes no attempt to +// convert to any canonical form. + +// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE +// ON PLATFORM APART FROM THE ONE THEY ARE CREATED ON + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include +#include +#include +#include // std::memcpy +#include // std::size_t +#include // basic_streambuf +#include + +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include // must be the last header + +namespace autoboost { +namespace archive { + +///////////////////////////////////////////////////////////////////////////// +// class binary_iarchive - read serialized objects from a input binary stream +template +class basic_binary_iprimitive +{ +#ifndef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS + friend class load_access; +protected: +#else +public: +#endif + std::basic_streambuf & m_sb; + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + + #ifndef AUTOBOOST_NO_STD_LOCALE + autoboost::scoped_ptr archive_locale; + basic_streambuf_locale_saver locale_saver; + #endif + + // main template for serilization of primitive types + template + void load(T & t){ + load_binary(& t, sizeof(T)); + } + + ///////////////////////////////////////////////////////// + // fundamental types that need special treatment + + // trap usage of invalid uninitialized boolean + void load(bool & t){ + load_binary(& t, sizeof(t)); + int i = t; + AUTOBOOST_ASSERT(0 == i || 1 == i); + (void)i; // warning suppression for release builds. + } + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load(std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load(std::wstring &ws); + #endif + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load(char * t); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load(wchar_t * t); + + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + basic_binary_iprimitive( + std::basic_streambuf & sb, + bool no_codecvt + ); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~basic_binary_iprimitive(); +public: + // we provide an optimized load for all fundamental types + // typedef serialization::is_bitwise_serializable + // use_array_optimization; + struct use_array_optimization { + template + #if defined(AUTOBOOST_NO_DEPENDENT_NESTED_DERIVATIONS) + struct apply { + typedef typename autoboost::serialization::is_bitwise_serializable< T >::type type; + }; + #else + struct apply : public autoboost::serialization::is_bitwise_serializable< T > {}; + #endif + }; + + // the optimized load_array dispatches to load_binary + template + void load_array(serialization::array& a, unsigned int) + { + load_binary(a.address(),a.count()*sizeof(ValueType)); + } + + void + load_binary(void *address, std::size_t count); +}; + +template +inline void +basic_binary_iprimitive::load_binary( + void *address, + std::size_t count +){ + // note: an optimizer should eliminate the following for char files + AUTOBOOST_ASSERT( + static_cast(count / sizeof(Elem)) + <= autoboost::integer_traits::const_max + ); + std::streamsize s = static_cast(count / sizeof(Elem)); + std::streamsize scount = m_sb.sgetn( + static_cast(address), + s + ); + if(scount != s) + autoboost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + // note: an optimizer should eliminate the following for char files + AUTOBOOST_ASSERT(count % sizeof(Elem) <= autoboost::integer_traits::const_max); + s = static_cast(count % sizeof(Elem)); + if(0 < s){ +// if(is.fail()) +// autoboost::serialization::throw_exception( +// archive_exception(archive_exception::stream_error) +// ); + Elem t; + scount = m_sb.sgetn(& t, 1); + if(scount != 1) + autoboost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + std::memcpy(static_cast(address) + (count - s), &t, static_cast(s)); + } +} + +} // namespace archive +} // namespace autoboost + +#include // pop pragmas + +#endif // AUTOBOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP diff --git a/contrib/autoboost/boost/archive/basic_binary_oarchive.hpp b/contrib/autoboost/autoboost/archive/basic_binary_oarchive.hpp similarity index 78% rename from contrib/autoboost/boost/archive/basic_binary_oarchive.hpp rename to contrib/autoboost/autoboost/archive/basic_binary_oarchive.hpp index 35be208d5..b265482e1 100644 --- a/contrib/autoboost/boost/archive/basic_binary_oarchive.hpp +++ b/contrib/autoboost/autoboost/archive/basic_binary_oarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP -#define BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -23,22 +23,22 @@ // IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE // ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include // must be the last header +#include // must be the last header -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -62,11 +62,11 @@ template class basic_binary_oarchive : public archive::detail::common_oarchive { -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) // for some inexplicable reason insertion of "class" generates compile erro // on msvc 7.1 friend detail::interface_oarchive; @@ -77,19 +77,19 @@ class basic_binary_oarchive : // any datatype not specifed below will be handled by base class typedef detail::common_oarchive detail_common_oarchive; template - void save_override(const T & t, BOOST_PFTO int version){ + void save_override(const T & t, AUTOBOOST_PFTO int version){ this->detail_common_oarchive::save_override(t, static_cast(version)); } // include these to trap a change in binary format which // isn't specifically handled - BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(bool)); + AUTOBOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(bool)); // upto 32K classes - BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t)); - BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t)); + AUTOBOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t)); + AUTOBOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t)); // upto 2G objects - BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t)); - BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t)); + AUTOBOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t)); + AUTOBOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t)); // binary files don't include the optional information void save_override(const class_id_optional_type & /* t */, int){} @@ -166,7 +166,7 @@ class basic_binary_oarchive : } } #endif - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) init(); basic_binary_oarchive(unsigned int flags) : @@ -177,10 +177,10 @@ class basic_binary_oarchive : } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas -#endif // BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/basic_binary_oprimitive.hpp b/contrib/autoboost/autoboost/archive/basic_binary_oprimitive.hpp new file mode 100644 index 000000000..a79850d8f --- /dev/null +++ b/contrib/autoboost/autoboost/archive/basic_binary_oprimitive.hpp @@ -0,0 +1,183 @@ +#ifndef AUTOBOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_oprimitive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +// archives stored as native binary - this should be the fastest way +// to archive the state of a group of obects. It makes no attempt to +// convert to any canonical form. + +// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE +// ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON + +#include +#include +#include +#include // basic_streambuf +#include +#include // size_t + +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include // must be the last header + +namespace autoboost { +namespace archive { + +///////////////////////////////////////////////////////////////////////// +// class basic_binary_oprimitive - binary output of prmitives + +template +class basic_binary_oprimitive { +#ifndef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS + friend class save_access; +protected: +#else +public: +#endif + std::basic_streambuf & m_sb; + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + #ifndef AUTOBOOST_NO_STD_LOCALE + autoboost::scoped_ptr archive_locale; + basic_streambuf_locale_saver locale_saver; + #endif + // default saving of primitives. + template + void save(const T & t) + { + save_binary(& t, sizeof(T)); + } + + ///////////////////////////////////////////////////////// + // fundamental types that need special treatment + + // trap usage of invalid uninitialized boolean which would + // otherwise crash on load. + void save(const bool t){ + AUTOBOOST_ASSERT(0 == static_cast(t) || 1 == static_cast(t)); + save_binary(& t, sizeof(t)); + } + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save(const std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save(const char * t); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save(const wchar_t * t); + + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + basic_binary_oprimitive( + std::basic_streambuf & sb, + bool no_codecvt + ); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~basic_binary_oprimitive(); +public: + + // we provide an optimized save for all fundamental types + // typedef serialization::is_bitwise_serializable + // use_array_optimization; + // workaround without using mpl lambdas + struct use_array_optimization { + template + #if defined(AUTOBOOST_NO_DEPENDENT_NESTED_DERIVATIONS) + struct apply { + typedef typename autoboost::serialization::is_bitwise_serializable< T >::type type; + }; + #else + struct apply : public autoboost::serialization::is_bitwise_serializable< T > {}; + #endif + }; + + + // the optimized save_array dispatches to save_binary + template + void save_array(autoboost::serialization::array const& a, unsigned int) + { + save_binary(a.address(),a.count()*sizeof(ValueType)); + } + + void save_binary(const void *address, std::size_t count); +}; + +template +inline void +basic_binary_oprimitive::save_binary( + const void *address, + std::size_t count +){ + //AUTOBOOST_ASSERT( + // static_cast((std::numeric_limits::max)()) >= count + //); + // note: if the following assertions fail + // a likely cause is that the output stream is set to "text" + // mode where by cr characters recieve special treatment. + // be sure that the output stream is opened with ios::binary + //if(os.fail()) + // autoboost::serialization::throw_exception( + // archive_exception(archive_exception::output_stream_error) + // ); + // figure number of elements to output - round up + count = ( count + sizeof(Elem) - 1) + / sizeof(Elem); + AUTOBOOST_ASSERT(count <= std::size_t(autoboost::integer_traits::const_max)); + std::streamsize scount = m_sb.sputn( + static_cast(address), + static_cast(count) + ); + if(count != static_cast(scount)) + autoboost::serialization::throw_exception( + archive_exception(archive_exception::output_stream_error) + ); + //os.write( + // static_cast(address), + // count + //); + //AUTOBOOST_ASSERT(os.good()); +} + +} //namespace autoboost +} //namespace archive + +#include // pop pragmas + +#endif // AUTOBOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP diff --git a/contrib/autoboost/boost/archive/basic_streambuf_locale_saver.hpp b/contrib/autoboost/autoboost/archive/basic_streambuf_locale_saver.hpp similarity index 83% rename from contrib/autoboost/boost/archive/basic_streambuf_locale_saver.hpp rename to contrib/autoboost/autoboost/archive/basic_streambuf_locale_saver.hpp index fd45ed9de..b28089299 100644 --- a/contrib/autoboost/boost/archive/basic_streambuf_locale_saver.hpp +++ b/contrib/autoboost/autoboost/archive/basic_streambuf_locale_saver.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP -#define BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP +#define AUTOBOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -24,15 +24,15 @@ // See for the library's home page. -#ifndef BOOST_NO_STD_LOCALE +#ifndef AUTOBOOST_NO_STD_LOCALE #include // for std::locale #include // for std::basic_streambuf -#include -#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -65,9 +65,9 @@ class basic_streambuf_locale_saver : } // archive } // boost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#endif // BOOST_NO_STD_LOCALE -#endif // BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP +#endif // AUTOBOOST_NO_STD_LOCALE +#endif // AUTOBOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP diff --git a/contrib/autoboost/boost/archive/basic_text_iarchive.hpp b/contrib/autoboost/autoboost/archive/basic_text_iarchive.hpp similarity index 75% rename from contrib/autoboost/boost/archive/basic_text_iarchive.hpp rename to contrib/autoboost/autoboost/archive/basic_text_iarchive.hpp index 057ab2cf9..8f19c0d69 100644 --- a/contrib/autoboost/boost/archive/basic_text_iarchive.hpp +++ b/contrib/autoboost/autoboost/archive/basic_text_iarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP -#define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -24,15 +24,15 @@ // in such cases. So we can't use basic_ostream but rather // use two template parameters -#include -#include -#include +#include +#include +#include -#include +#include -#include // must be the last header +#include // must be the last header -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -50,11 +50,11 @@ template class basic_text_iarchive : public detail::common_iarchive { -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) // for some inexplicable reason insertion of "class" generates compile erro // on msvc 7.1 friend detail::interface_iarchive; @@ -67,16 +67,16 @@ class basic_text_iarchive : // template ordering typedef detail::common_iarchive detail_common_iarchive; template - void load_override(T & t, BOOST_PFTO int){ + void load_override(T & t, AUTOBOOST_PFTO int){ this->detail_common_iarchive::load_override(t, 0); } // text file don't include the optional information void load_override(class_id_optional_type & /*t*/, int){} - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) load_override(class_name_type & t, int); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) init(void); basic_text_iarchive(unsigned int flags) : @@ -88,10 +88,10 @@ class basic_text_iarchive : } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas -#endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/basic_text_iprimitive.hpp b/contrib/autoboost/autoboost/archive/basic_text_iprimitive.hpp new file mode 100644 index 000000000..2c80c007f --- /dev/null +++ b/contrib/autoboost/autoboost/archive/basic_text_iprimitive.hpp @@ -0,0 +1,137 @@ +#ifndef AUTOBOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_iprimitive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +// archives stored as text - note these are templated on the basic +// stream templates to accommodate wide (and other?) kind of characters +// +// Note the fact that on libraries without wide characters, ostream is +// not a specialization of basic_ostream which in fact is not defined +// in such cases. So we can't use basic_ostream but rather +// use two template parameters + +#include +#include +#include // size_t + +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; + #if ! defined(AUTOBOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT) + using ::locale; + #endif +} // namespace std +#endif + +#include +#if AUTOBOOST_WORKAROUND(AUTOBOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include // must be the last header + +namespace autoboost { +namespace archive { + +///////////////////////////////////////////////////////////////////////// +// class basic_text_iarchive - load serialized objects from a input text stream +#if defined(_MSC_VER) +#pragma warning( push ) +#pragma warning( disable : 4244 4267 ) +#endif + +template +class basic_text_iprimitive { +protected: + IStream &is; + io::ios_flags_saver flags_saver; + io::ios_precision_saver precision_saver; + + #ifndef AUTOBOOST_NO_STD_LOCALE + autoboost::scoped_ptr archive_locale; + basic_streambuf_locale_saver< + typename IStream::char_type, + typename IStream::traits_type + > locale_saver; + #endif + + template + void load(T & t) + { + if(is >> t) + return; + autoboost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + } + + void load(char & t) + { + short int i; + load(i); + t = i; + } + void load(signed char & t) + { + short int i; + load(i); + t = i; + } + void load(unsigned char & t) + { + unsigned short int i; + load(i); + t = i; + } + + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + void load(wchar_t & t) + { + AUTOBOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int)); + int i; + load(i); + t = i; + } + #endif + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + basic_text_iprimitive(IStream &is, bool no_codecvt); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~basic_text_iprimitive(); +public: + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_binary(void *address, std::size_t count); +}; + +#if defined(_MSC_VER) +#pragma warning( pop ) +#endif + +} // namespace archive +} // namespace autoboost + +#include // pop pragmas + +#endif // AUTOBOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP diff --git a/contrib/autoboost/boost/archive/basic_text_oarchive.hpp b/contrib/autoboost/autoboost/archive/basic_text_oarchive.hpp similarity index 76% rename from contrib/autoboost/boost/archive/basic_text_oarchive.hpp rename to contrib/autoboost/autoboost/archive/basic_text_oarchive.hpp index 3c6d9701b..3b8a6fcd0 100644 --- a/contrib/autoboost/boost/archive/basic_text_oarchive.hpp +++ b/contrib/autoboost/autoboost/archive/basic_text_oarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP -#define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -24,17 +24,17 @@ // in such cases. So we can't use basic_ostream but rather // use two template parameters -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include +#include +#include -#include // must be the last header +#include // must be the last header -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -52,11 +52,11 @@ template class basic_text_oarchive : public detail::common_oarchive { -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) // for some inexplicable reason insertion of "class" generates compile erro // on msvc 7.1 friend detail::interface_oarchive; @@ -71,7 +71,7 @@ class basic_text_oarchive : space } delimiter; - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) newtoken(); void newline(){ @@ -82,7 +82,7 @@ class basic_text_oarchive : // extra stuff to get it passed borland compilers typedef detail::common_oarchive detail_common_oarchive; template - void save_override(T & t, BOOST_PFTO int){ + void save_override(T & t, AUTOBOOST_PFTO int){ this->detail_common_oarchive::save_override(t, 0); } @@ -100,7 +100,7 @@ class basic_text_oarchive : * this->This() << s; } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) init(); basic_text_oarchive(unsigned int flags) : @@ -113,10 +113,10 @@ class basic_text_oarchive : } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas -#endif // BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/basic_text_oprimitive.hpp b/contrib/autoboost/autoboost/archive/basic_text_oprimitive.hpp similarity index 78% rename from contrib/autoboost/boost/archive/basic_text_oprimitive.hpp rename to contrib/autoboost/autoboost/archive/basic_text_oprimitive.hpp index a463f4b7e..6667eadaa 100644 --- a/contrib/autoboost/boost/archive/basic_text_oprimitive.hpp +++ b/contrib/autoboost/autoboost/archive/basic_text_oprimitive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP -#define BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -26,37 +26,37 @@ #include #include -#include +#include #include // size_t -#include -#include -#include -#include +#include +#include +#include +#include -#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) -#include +#if AUTOBOOST_WORKAROUND(AUTOBOOST_DINKUMWARE_STDLIB, == 1) +#include #endif -#if defined(BOOST_NO_STDC_NAMESPACE) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; - #if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT) + #if ! defined(AUTOBOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT) using ::locale; #endif } // namespace std #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // must be the last header +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // must be the last header namespace autoboost { namespace archive { @@ -73,7 +73,7 @@ class basic_text_oprimitive io::ios_flags_saver flags_saver; io::ios_precision_saver precision_saver; - #ifndef BOOST_NO_STD_LOCALE + #ifndef AUTOBOOST_NO_STD_LOCALE autoboost::scoped_ptr archive_locale; basic_streambuf_locale_saver< typename OStream::char_type, @@ -86,7 +86,7 @@ class basic_text_oprimitive void save(const bool t){ // trap usage of invalid uninitialized boolean which would // otherwise crash on load. - BOOST_ASSERT(0 == static_cast(t) || 1 == static_cast(t)); + AUTOBOOST_ASSERT(0 == static_cast(t) || 1 == static_cast(t)); if(os.fail()) autoboost::serialization::throw_exception( archive_exception(archive_exception::output_stream_error) @@ -105,10 +105,10 @@ class basic_text_oprimitive { save(static_cast(t)); } - #ifndef BOOST_NO_INTRINSIC_WCHAR_T + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T void save(const wchar_t t) { - BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int)); + AUTOBOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int)); save(static_cast(t)); } #endif @@ -160,7 +160,7 @@ class basic_text_oprimitive // const unsigned int digits = (std::numeric_limits::digits * 3010) / 10000; // note: I've commented out the above because I didn't get good results. e.g. // in one case I got a difference of 19 units. - #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS + #ifndef AUTOBOOST_NO_CXX11_NUMERIC_LIMITS const unsigned int digits = std::numeric_limits::max_digits10; #else const unsigned int digits = std::numeric_limits::digits10 + 2; @@ -176,9 +176,9 @@ class basic_text_oprimitive save_impl(t, tf); } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_text_oprimitive(OStream & os, bool no_codecvt); - BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) ~basic_text_oprimitive(); public: // unformatted append of one character @@ -194,13 +194,13 @@ class basic_text_oprimitive while('\0' != *s) os.put(*s++); } - BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) save_binary(const void *address, std::size_t count); }; } //namespace autoboost } //namespace archive -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas -#endif // BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP +#endif // AUTOBOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/basic_xml_archive.hpp b/contrib/autoboost/autoboost/archive/basic_xml_archive.hpp new file mode 100644 index 000000000..ecd03fdd3 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/basic_xml_archive.hpp @@ -0,0 +1,67 @@ +#ifndef AUTOBOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_archive.hpp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include + +#include +#include // must be the last header + +namespace autoboost { +namespace archive { + +// constant strings used in xml i/o + +extern +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_XML_OBJECT_ID(); + +extern +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_XML_OBJECT_REFERENCE(); + +extern +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_XML_CLASS_ID(); + +extern +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(); + +extern +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_XML_CLASS_NAME(); + +extern +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_XML_TRACKING(); + +extern +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_XML_VERSION(); + +extern +AUTOBOOST_ARCHIVE_DECL(const char *) +AUTOBOOST_ARCHIVE_XML_SIGNATURE(); + +}// namespace archive +}// namespace autoboost + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP + diff --git a/contrib/autoboost/autoboost/archive/basic_xml_iarchive.hpp b/contrib/autoboost/autoboost/archive/basic_xml_iarchive.hpp new file mode 100644 index 000000000..fb8cc4817 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/basic_xml_iarchive.hpp @@ -0,0 +1,133 @@ +#ifndef AUTOBOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_iarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include +#include +#include + +#include + +#include +#include + +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_iarchive; +} // namespace detail + +///////////////////////////////////////////////////////////////////////// +// class xml_iarchive - read serialized objects from a input text stream +template +class basic_xml_iarchive : + public detail::common_iarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + #else + friend class detail::interface_iarchive; + #endif +#endif + unsigned int depth; + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_start(const char *name); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_end(const char *name); + + // Anything not an attribute and not a name-value pair is an + // should be trapped here. + template + void load_override(T & t, AUTOBOOST_PFTO int) + { + // If your program fails to compile here, its most likely due to + // not specifying an nvp wrapper around the variable to + // be serialized. + AUTOBOOST_MPL_ASSERT((serialization::is_wrapper< T >)); + this->detail_common_iarchive::load_override(t, 0); + } + + // Anything not an attribute - see below - should be a name value + // pair and be processed here + typedef detail::common_iarchive detail_common_iarchive; + template + void load_override( + #ifndef AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + autoboost::serialization::nvp< T > & t, + int + ){ + this->This()->load_start(t.name()); + this->detail_common_iarchive::load_override(t.value(), 0); + this->This()->load_end(t.name()); + } + + // specific overrides for attributes - handle as + // primitives. These are not name-value pairs + // so they have to be intercepted here and passed on to load. + // although the class_id is included in the xml text file in order + // to make the file self describing, it isn't used when loading + // an xml archive. So we can skip it here. Note: we MUST override + // it otherwise it will be loaded as a normal primitive w/o tag and + // leaving the archive in an undetermined state + void load_override(class_id_optional_type & /* t */, int){} + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_override(object_id_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_override(version_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_override(class_id_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_override(tracking_type & t, int); + // class_name_type can't be handled here as it depends upon the + // char type used by the stream. So require the derived implementation + // handle this. + // void load_override(class_name_type & t, int); + + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + basic_xml_iarchive(unsigned int flags); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~basic_xml_iarchive(); +}; + +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/basic_xml_oarchive.hpp b/contrib/autoboost/autoboost/archive/basic_xml_oarchive.hpp new file mode 100644 index 000000000..51aadccb8 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/basic_xml_oarchive.hpp @@ -0,0 +1,150 @@ +#ifndef AUTOBOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_oarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include + +#include + +#include +#include +#include + +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_oarchive; +} // namespace detail + +////////////////////////////////////////////////////////////////////// +// class basic_xml_oarchive - write serialized objects to a xml output stream +template +class basic_xml_oarchive : + public detail::common_oarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: +#endif +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; +#else + friend class detail::interface_oarchive; +#endif + friend class save_access; + // special stuff for xml output + unsigned int depth; + bool indent_next; + bool pending_preamble; + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + indent(); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + write_attribute( + const char *attribute_name, + int t, + const char *conjunction = "=\"" + ); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + write_attribute( + const char *attribute_name, + const char *key + ); + // helpers used below + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_start(const char *name); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_end(const char *name); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + end_preamble(); + + // Anything not an attribute and not a name-value pair is an + // error and should be trapped here. + template + void save_override(T & t, AUTOBOOST_PFTO int) + { + // If your program fails to compile here, its most likely due to + // not specifying an nvp wrapper around the variable to + // be serialized. + AUTOBOOST_MPL_ASSERT((serialization::is_wrapper< T >)); + this->detail_common_oarchive::save_override(t, 0); + } + + // special treatment for name-value pairs. + typedef detail::common_oarchive detail_common_oarchive; + template + void save_override( + #ifndef AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + ::autoboost::serialization::nvp< T > & t, + int + ){ + this->This()->save_start(t.name()); + this->detail_common_oarchive::save_override(t.const_value(), 0); + this->This()->save_end(t.name()); + } + + // specific overrides for attributes - not name value pairs so we + // want to trap them before the above "fall through" + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_override(const object_id_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_override(const object_reference_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_override(const version_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_override(const class_id_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_override(const class_id_optional_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_override(const class_id_reference_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_override(const class_name_type & t, int); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_override(const tracking_type & t, int); + + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + basic_xml_oarchive(unsigned int flags); + AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~basic_xml_oarchive(); +}; + +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/binary_iarchive.hpp b/contrib/autoboost/autoboost/archive/binary_iarchive.hpp similarity index 77% rename from contrib/autoboost/boost/archive/binary_iarchive.hpp rename to contrib/autoboost/autoboost/archive/binary_iarchive.hpp index 33ead9a4c..f39bcda4e 100644 --- a/contrib/autoboost/boost/archive/binary_iarchive.hpp +++ b/contrib/autoboost/autoboost/archive/binary_iarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_HPP -#define BOOST_ARCHIVE_BINARY_IARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BINARY_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BINARY_IARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -17,10 +17,10 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include -#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -54,11 +54,11 @@ class binary_iarchive : } // namespace autoboost // required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::binary_iarchive) -BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(autoboost::archive::binary_iarchive) +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::binary_iarchive) +AUTOBOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(autoboost::archive::binary_iarchive) -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_BINARY_IARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/binary_iarchive_impl.hpp b/contrib/autoboost/autoboost/archive/binary_iarchive_impl.hpp similarity index 84% rename from contrib/autoboost/boost/archive/binary_iarchive_impl.hpp rename to contrib/autoboost/autoboost/archive/binary_iarchive_impl.hpp index 83f8c51d0..57c0ba03a 100644 --- a/contrib/autoboost/boost/archive/binary_iarchive_impl.hpp +++ b/contrib/autoboost/autoboost/archive/binary_iarchive_impl.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP -#define BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP +#ifndef AUTOBOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP +#define AUTOBOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -17,11 +17,11 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include -#include -#include +#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -38,11 +38,11 @@ class binary_iarchive_impl : public basic_binary_iprimitive, public basic_binary_iarchive { -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) // for some inexplicable reason insertion of "class" generates compile erro // on msvc 7.1 friend detail::interface_iarchive; @@ -58,7 +58,7 @@ class binary_iarchive_impl : // fails to compile one test (test_shared_ptr) without it !!! // make this protected so it can be called from a derived archive template - void load_override(T & t, BOOST_PFTO int){ + void load_override(T & t, AUTOBOOST_PFTO int){ this->basic_binary_iarchive::load_override(t, 0L); } void init(unsigned int flags){ @@ -101,8 +101,8 @@ class binary_iarchive_impl : } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP +#endif // AUTOBOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP diff --git a/contrib/autoboost/boost/archive/binary_oarchive.hpp b/contrib/autoboost/autoboost/archive/binary_oarchive.hpp similarity index 75% rename from contrib/autoboost/boost/archive/binary_oarchive.hpp rename to contrib/autoboost/autoboost/archive/binary_oarchive.hpp index 9557ee406..621a6edaa 100644 --- a/contrib/autoboost/boost/archive/binary_oarchive.hpp +++ b/contrib/autoboost/autoboost/archive/binary_oarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_HPP -#define BOOST_ARCHIVE_BINARY_OARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BINARY_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BINARY_OARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -17,11 +17,11 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include -#include -#include +#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -54,11 +54,11 @@ class binary_oarchive : } // namespace autoboost // required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::binary_oarchive) -BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(autoboost::archive::binary_oarchive) +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::binary_oarchive) +AUTOBOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(autoboost::archive::binary_oarchive) -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_BINARY_OARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/binary_oarchive_impl.hpp b/contrib/autoboost/autoboost/archive/binary_oarchive_impl.hpp similarity index 83% rename from contrib/autoboost/boost/archive/binary_oarchive_impl.hpp rename to contrib/autoboost/autoboost/archive/binary_oarchive_impl.hpp index 07fb9320f..fcfc44ee7 100644 --- a/contrib/autoboost/boost/archive/binary_oarchive_impl.hpp +++ b/contrib/autoboost/autoboost/archive/binary_oarchive_impl.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP -#define BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP +#ifndef AUTOBOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP +#define AUTOBOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -17,12 +17,12 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include -#include -#include -#include +#include +#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -39,11 +39,11 @@ class binary_oarchive_impl : public basic_binary_oprimitive, public basic_binary_oarchive { -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) // for some inexplicable reason insertion of "class" generates compile erro // on msvc 7.1 friend detail::interface_oarchive; @@ -59,7 +59,7 @@ class binary_oarchive_impl : // fails to compile one test (test_shared_ptr) without it !!! // make this protected so it can be called from a derived archive template - void save_override(T & t, BOOST_PFTO int){ + void save_override(T & t, AUTOBOOST_PFTO int){ this->basic_binary_oarchive::save_override(t, 0L); } void init(unsigned int flags) { @@ -102,8 +102,8 @@ class binary_oarchive_impl : } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#endif // BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP +#endif // AUTOBOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP diff --git a/contrib/autoboost/boost/archive/binary_wiarchive.hpp b/contrib/autoboost/autoboost/archive/binary_wiarchive.hpp similarity index 75% rename from contrib/autoboost/boost/archive/binary_wiarchive.hpp rename to contrib/autoboost/autoboost/archive/binary_wiarchive.hpp index 641e7ca27..0d7c66b00 100644 --- a/contrib/autoboost/boost/archive/binary_wiarchive.hpp +++ b/contrib/autoboost/autoboost/archive/binary_wiarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP -#define BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BINARY_WIARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BINARY_WIARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,14 +16,14 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include -#ifdef BOOST_NO_STD_WSTREAMBUF +#include +#ifdef AUTOBOOST_NO_STD_WSTREAMBUF #error "wide char i/o not supported on this platform" #else #include // wistream -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -50,7 +50,7 @@ class binary_wiarchive : } // namespace autoboost // required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::binary_wiarchive) +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::binary_wiarchive) -#endif // BOOST_NO_STD_WSTREAMBUF -#endif // BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP +#endif // AUTOBOOST_NO_STD_WSTREAMBUF +#endif // AUTOBOOST_ARCHIVE_BINARY_WIARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/binary_woarchive.hpp b/contrib/autoboost/autoboost/archive/binary_woarchive.hpp similarity index 77% rename from contrib/autoboost/boost/archive/binary_woarchive.hpp rename to contrib/autoboost/autoboost/archive/binary_woarchive.hpp index 3ab4238e6..f43baa76b 100644 --- a/contrib/autoboost/boost/archive/binary_woarchive.hpp +++ b/contrib/autoboost/autoboost/archive/binary_woarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP -#define BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BINARY_WOARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BINARY_WOARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,14 +16,14 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include -#ifdef BOOST_NO_STD_WSTREAMBUF +#include +#ifdef AUTOBOOST_NO_STD_WSTREAMBUF #error "wide char i/o not supported on this platform" #else #include -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -53,7 +53,7 @@ class binary_woarchive : } // namespace autoboost // required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::binary_woarchive) +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::binary_woarchive) -#endif // BOOST_NO_STD_WSTREAMBUF -#endif // BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP +#endif // AUTOBOOST_NO_STD_WSTREAMBUF +#endif // AUTOBOOST_ARCHIVE_BINARY_WOARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/codecvt_null.hpp b/contrib/autoboost/autoboost/archive/codecvt_null.hpp similarity index 75% rename from contrib/autoboost/boost/archive/codecvt_null.hpp rename to contrib/autoboost/autoboost/archive/codecvt_null.hpp index ca6e90a8f..b0e2d0d94 100644 --- a/contrib/autoboost/boost/archive/codecvt_null.hpp +++ b/contrib/autoboost/autoboost/archive/codecvt_null.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_CODECVT_NULL_HPP -#define BOOST_ARCHIVE_CODECVT_NULL_HPP +#ifndef AUTOBOOST_ARCHIVE_CODECVT_NULL_HPP +#define AUTOBOOST_ARCHIVE_CODECVT_NULL_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -19,12 +19,13 @@ #include #include // NULL, size_t #include // for mbstate_t -#include -#include // must be the last header +#include +#include +#include // must be the last header -#if defined(BOOST_NO_STDC_NAMESPACE) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std { -// For STLport on WinCE, BOOST_NO_STDC_NAMESPACE can get defined if STLport is putting symbols in its own namespace. +// For STLport on WinCE, AUTOBOOST_NO_STDC_NAMESPACE can get defined if STLport is putting symbols in its own namespace. // In the case of codecvt, however, this does not mean that codecvt is in the global namespace (it will be in STLport's namespace) # if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) using ::codecvt; @@ -34,7 +35,7 @@ namespace std { } // namespace #endif -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -60,7 +61,7 @@ class codecvt_null : public std::codecvt template<> class codecvt_null : public std::codecvt { - virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result) + virtual AUTOBOOST_WARCHIVE_DECL(std::codecvt_base::result) do_out( std::mbstate_t & state, const wchar_t * first1, @@ -70,7 +71,7 @@ class codecvt_null : public std::codecvt char * last2, char * & next2 ) const; - virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result) + virtual AUTOBOOST_WARCHIVE_DECL(std::codecvt_base::result) do_in( std::mbstate_t & state, const char * first1, @@ -91,9 +92,9 @@ class codecvt_null : public std::codecvt } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(pop) #endif -#include // pop pragmas +#include // pop pragmas -#endif //BOOST_ARCHIVE_CODECVT_NULL_HPP +#endif //AUTOBOOST_ARCHIVE_CODECVT_NULL_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/abi_prefix.hpp b/contrib/autoboost/autoboost/archive/detail/abi_prefix.hpp new file mode 100644 index 000000000..d727325cd --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/abi_prefix.hpp @@ -0,0 +1,20 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// abi_prefix.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include // must be the last header +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275) +#endif + +#if defined( __BORLANDC__ ) +#pragma nopushoptwarn +#endif + diff --git a/contrib/autoboost/autoboost/archive/detail/abi_suffix.hpp b/contrib/autoboost/autoboost/archive/detail/abi_suffix.hpp new file mode 100644 index 000000000..9c6c9c622 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/abi_suffix.hpp @@ -0,0 +1,19 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// abi_suffix.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif +#include // pops abi_suffix.hpp pragmas + +#if defined( __BORLANDC__ ) +#pragma nopushoptwarn +#endif + diff --git a/contrib/autoboost/autoboost/archive/detail/archive_serializer_map.hpp b/contrib/autoboost/autoboost/archive/detail/archive_serializer_map.hpp new file mode 100644 index 000000000..f947b38f9 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/archive_serializer_map.hpp @@ -0,0 +1,55 @@ +#ifndef AUTOBOOST_ARCHIVE_SERIALIZER_MAP_HPP +#define AUTOBOOST_ARCHIVE_SERIALIZER_MAP_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// archive_serializer_map.hpp: extenstion of type_info required for +// serialization. + +// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +// note: this is nothing more than the thinest of wrappers around +// basic_serializer_map so we can have a one map / archive type. + +#include +#include +#include // must be the last header + +namespace autoboost { + +namespace serialization { + class extended_type_info; +} // namespace serialization + +namespace archive { +namespace detail { + +class basic_serializer; + +template +class AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) +archive_serializer_map { +public: + static bool insert(const basic_serializer * bs); + static void erase(const basic_serializer * bs); + static const basic_serializer * find( + const autoboost::serialization::extended_type_info & type_ + ); +}; + +} // namespace detail +} // namespace archive +} // namespace autoboost + +#include // must be the last header + +#endif //AUTOBOOST_ARCHIVE_SERIALIZER_MAP_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/auto_link_archive.hpp b/contrib/autoboost/autoboost/archive/detail/auto_link_archive.hpp new file mode 100644 index 000000000..5545d10ba --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/auto_link_archive.hpp @@ -0,0 +1,28 @@ +#ifndef AUTOBOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// auto_link_archive.hpp +// +// (c) Copyright Robert Ramey 2004 +// Use, modification, and distribution is subject to 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 library home page at http://www.boost.org/libs/serialization + +//----------------------------------------------------------------------------// + +// This header implements separate compilation features as described in +// http://www.boost.org/more/separate_compilation.html + +// enable automatic library variant selection ------------------------------// + +#include + +#endif // AUTOBOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/auto_link_warchive.hpp b/contrib/autoboost/autoboost/archive/detail/auto_link_warchive.hpp new file mode 100644 index 000000000..30d1edbf6 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/auto_link_warchive.hpp @@ -0,0 +1,28 @@ +#ifndef AUTOBOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// auto_link_warchive.hpp +// +// (c) Copyright Robert Ramey 2004 +// Use, modification, and distribution is subject to 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 library home page at http://www.boost.org/libs/serialization + +//----------------------------------------------------------------------------// + +// This header implements separate compilation features as described in +// http://www.boost.org/more/separate_compilation.html + +// enable automatic library variant selection ------------------------------// + +#include + +#endif // ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/detail/basic_iarchive.hpp b/contrib/autoboost/autoboost/archive/detail/basic_iarchive.hpp similarity index 76% rename from contrib/autoboost/boost/archive/detail/basic_iarchive.hpp rename to contrib/autoboost/autoboost/archive/detail/basic_iarchive.hpp index 87d6fb8a8..33dd2a8e0 100644 --- a/contrib/autoboost/boost/archive/detail/basic_iarchive.hpp +++ b/contrib/autoboost/autoboost/archive/detail/basic_iarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP -#define BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -17,16 +17,16 @@ // See http://www.boost.org for updates, documentation, and revision history. // can't use this - much as I'd like to as borland doesn't support it -// #include +// #include -#include -#include +#include +#include -#include -#include -#include -#include -#include // must be the last header +#include +#include +#include +#include +#include // must be the last header namespace autoboost { namespace serialization { @@ -37,11 +37,11 @@ namespace archive { namespace detail { class basic_iarchive_impl; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_iserializer; +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_pointer_iserializer; ////////////////////////////////////////////////////////////////////// // class basic_iarchive - read serialized objects from a input stream -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_iarchive : private autoboost::noncopyable, public autoboost::archive::detail::helper_collection { @@ -100,6 +100,6 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : } // namespace archive } // namespace autoboost -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas -#endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP +#endif //AUTOBOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/basic_iserializer.hpp b/contrib/autoboost/autoboost/archive/detail/basic_iserializer.hpp new file mode 100644 index 000000000..afc7e2e38 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/basic_iserializer.hpp @@ -0,0 +1,95 @@ +#ifndef AUTOBOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_iserializer.hpp: extenstion of type_info required for serialization. + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include // NULL +#include + +#include +#include +#include +#include +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +// forward declarations +namespace archive { +namespace detail { + +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_iarchive; +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_pointer_iserializer; + +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_iserializer : + public basic_serializer +{ +private: + basic_pointer_iserializer *m_bpis; +protected: + explicit basic_iserializer( + const autoboost::serialization::extended_type_info & type + ); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_iserializer(); +public: + bool serialized_as_pointer() const { + return m_bpis != NULL; + } + void set_bpis(basic_pointer_iserializer *bpis){ + m_bpis = bpis; + } + const basic_pointer_iserializer * get_bpis_ptr() const { + return m_bpis; + } + virtual void load_object_data( + basic_iarchive & ar, + void *x, + const unsigned int file_version + ) const = 0; + // returns true if class_info should be saved + virtual bool class_info() const = 0 ; + // returns true if objects should be tracked + virtual bool tracking(const unsigned int) const = 0 ; + // returns class version + virtual version_type version() const = 0 ; + // returns true if this class is polymorphic + virtual bool is_polymorphic() const = 0; + virtual void destroy(/*const*/ void *address) const = 0 ; +}; + +} // namespae detail +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP diff --git a/contrib/autoboost/boost/archive/detail/basic_oarchive.hpp b/contrib/autoboost/autoboost/archive/detail/basic_oarchive.hpp similarity index 77% rename from contrib/autoboost/boost/archive/detail/basic_oarchive.hpp rename to contrib/autoboost/autoboost/archive/detail/basic_oarchive.hpp index f388cb56a..9cf75d96f 100644 --- a/contrib/autoboost/boost/archive/detail/basic_oarchive.hpp +++ b/contrib/autoboost/autoboost/archive/detail/basic_oarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_OARCHIVE_HPP -#define BOOST_ARCHIVE_BASIC_OARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_BASIC_OARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -17,16 +17,16 @@ // See http://www.boost.org for updates, documentation, and revision history. #include // NULL -#include -#include +#include +#include // can't use this - much as I'd like to as borland doesn't support it -// #include +// #include -#include -#include -#include -#include // must be the last header +#include +#include +#include +#include // must be the last header namespace autoboost { namespace serialization { @@ -37,12 +37,12 @@ namespace archive { namespace detail { class basic_oarchive_impl; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_oserializer; +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_pointer_oserializer; ////////////////////////////////////////////////////////////////////// // class basic_oarchive - write serialized objects to an output stream -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : +class AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_oarchive : private autoboost::noncopyable, public autoboost::archive::detail::helper_collection { @@ -95,6 +95,6 @@ class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : } // namespace archive } // namespace autoboost -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas -#endif //BOOST_ARCHIVE_BASIC_OARCHIVE_HPP +#endif //AUTOBOOST_ARCHIVE_BASIC_OARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/basic_oserializer.hpp b/contrib/autoboost/autoboost/archive/detail/basic_oserializer.hpp new file mode 100644 index 000000000..ab45567ab --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/basic_oserializer.hpp @@ -0,0 +1,93 @@ +#ifndef AUTOBOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP +#define AUTOBOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_oserializer.hpp: extenstion of type_info required for serialization. + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include // NULL +#include +#include + +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +// forward declarations +namespace archive { +namespace detail { + +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_oarchive; +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_pointer_oserializer; + +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_oserializer : + public basic_serializer +{ +private: + basic_pointer_oserializer *m_bpos; +protected: + explicit basic_oserializer( + const autoboost::serialization::extended_type_info & type_ + ); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_oserializer(); +public: + bool serialized_as_pointer() const { + return m_bpos != NULL; + } + void set_bpos(basic_pointer_oserializer *bpos){ + m_bpos = bpos; + } + const basic_pointer_oserializer * get_bpos() const { + return m_bpos; + } + virtual void save_object_data( + basic_oarchive & ar, const void * x + ) const = 0; + // returns true if class_info should be saved + virtual bool class_info() const = 0; + // returns true if objects should be tracked + virtual bool tracking(const unsigned int flags) const = 0; + // returns class version + virtual version_type version() const = 0; + // returns true if this class is polymorphic + virtual bool is_polymorphic() const = 0; +}; + +} // namespace detail +} // namespace serialization +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/basic_pointer_iserializer.hpp b/contrib/autoboost/autoboost/archive/detail/basic_pointer_iserializer.hpp new file mode 100644 index 000000000..e6cb1fb26 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/basic_pointer_iserializer.hpp @@ -0,0 +1,74 @@ +#ifndef AUTOBOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP +#define AUTOBOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_pointer_oserializer.hpp: extenstion of type_info required for +// serialization. + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +// forward declarations +namespace archive { +namespace detail { + +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_iarchive; +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_iserializer; + +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_pointer_iserializer + : public basic_serializer { +protected: + explicit basic_pointer_iserializer( + const autoboost::serialization::extended_type_info & type_ + ); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_pointer_iserializer(); +public: + virtual void * heap_allocation() const = 0; + virtual const basic_iserializer & get_basic_serializer() const = 0; + virtual void load_object_ptr( + basic_iarchive & ar, + void * x, + const unsigned int file_version + ) const = 0; +}; + +} // namespace detail +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/basic_pointer_oserializer.hpp b/contrib/autoboost/autoboost/archive/detail/basic_pointer_oserializer.hpp new file mode 100644 index 000000000..69a9ca99a --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/basic_pointer_oserializer.hpp @@ -0,0 +1,72 @@ +#ifndef AUTOBOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP +#define AUTOBOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_pointer_oserializer.hpp: extenstion of type_info required for +// serialization. + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +namespace archive { +namespace detail { + +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_oarchive; +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_oserializer; + +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_pointer_oserializer : + public basic_serializer +{ +protected: + explicit basic_pointer_oserializer( + const autoboost::serialization::extended_type_info & type_ + ); +public: + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_pointer_oserializer(); + virtual const basic_oserializer & get_basic_serializer() const = 0; + virtual void save_object_ptr( + basic_oarchive & ar, + const void * x + ) const = 0; +}; + +} // namespace detail +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP diff --git a/contrib/autoboost/boost/archive/detail/basic_serializer.hpp b/contrib/autoboost/autoboost/archive/detail/basic_serializer.hpp similarity index 82% rename from contrib/autoboost/boost/archive/detail/basic_serializer.hpp rename to contrib/autoboost/autoboost/archive/detail/basic_serializer.hpp index 98ef3646a..7892dd7c6 100644 --- a/contrib/autoboost/boost/archive/detail/basic_serializer.hpp +++ b/contrib/autoboost/autoboost/archive/detail/basic_serializer.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_SERIALIZER_HPP -#define BOOST_ARCHIVE_BASIC_SERIALIZER_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_SERIALIZER_HPP +#define AUTOBOOST_ARCHIVE_BASIC_SERIALIZER_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,14 +16,14 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include // NULL -#include -#include -#include +#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -42,7 +42,7 @@ class basic_serializer : ) : m_eti(& eti) { - BOOST_ASSERT(NULL != & eti); + AUTOBOOST_ASSERT(NULL != & eti); } public: inline bool @@ -72,8 +72,8 @@ class basic_serializer_arg : public basic_serializer { } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#endif // BOOST_ARCHIVE_BASIC_SERIALIZER_HPP +#endif // AUTOBOOST_ARCHIVE_BASIC_SERIALIZER_HPP diff --git a/contrib/autoboost/boost/archive/detail/basic_serializer_map.hpp b/contrib/autoboost/autoboost/archive/detail/basic_serializer_map.hpp similarity index 76% rename from contrib/autoboost/boost/archive/detail/basic_serializer_map.hpp rename to contrib/autoboost/autoboost/archive/detail/basic_serializer_map.hpp index 3c3eff54f..001d75b8b 100644 --- a/contrib/autoboost/boost/archive/detail/basic_serializer_map.hpp +++ b/contrib/autoboost/autoboost/archive/detail/basic_serializer_map.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_SERIALIZER_MAP_HPP -#define BOOST_SERIALIZER_MAP_HPP +#ifndef AUTOBOOST_SERIALIZER_MAP_HPP +#define AUTOBOOST_SERIALIZER_MAP_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -18,10 +18,11 @@ #include -#include -#include +#include +#include +#include -#include // must be the last header +#include // must be the last header namespace autoboost { namespace serialization { @@ -33,7 +34,7 @@ namespace detail { class basic_serializer; -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +class AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_serializer_map : public autoboost::noncopyable { @@ -63,6 +64,6 @@ basic_serializer_map : public } // namespace archive } // namespace autoboost -#include // must be the last header +#include // must be the last header -#endif // BOOST_SERIALIZER_MAP_HPP +#endif // AUTOBOOST_SERIALIZER_MAP_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/check.hpp b/contrib/autoboost/autoboost/archive/detail/check.hpp new file mode 100644 index 000000000..bfd58b15b --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/check.hpp @@ -0,0 +1,169 @@ +#ifndef AUTOBOOST_ARCHIVE_DETAIL_CHECK_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_CHECK_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#pragma inline_depth(511) +#pragma inline_recursion(on) +#endif + +#if defined(__MWERKS__) +#pragma inline_depth(511) +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// check.hpp: interface for serialization system. + +// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace autoboost { +namespace archive { +namespace detail { + +// checks for objects + +template +inline void check_object_level(){ + typedef + typename mpl::greater_equal< + serialization::implementation_level< T >, + mpl::int_ + >::type typex; + + // trap attempts to serialize objects marked + // not_serializable + AUTOBOOST_STATIC_ASSERT(typex::value); +} + +template +inline void check_object_versioning(){ + typedef + typename mpl::or_< + typename mpl::greater< + serialization::implementation_level< T >, + mpl::int_ + >, + typename mpl::equal_to< + serialization::version< T >, + mpl::int_<0> + > + > typex; + // trap attempts to serialize with objects that don't + // save class information in the archive with versioning. + AUTOBOOST_STATIC_ASSERT(typex::value); +} + +template +inline void check_object_tracking(){ + // presume it has already been determined that + // T is not a const + AUTOBOOST_STATIC_ASSERT(! autoboost::is_const< T >::value); + typedef typename mpl::equal_to< + serialization::tracking_level< T >, + mpl::int_ + >::type typex; + // saving an non-const object of a type not marked "track_never) + + // may be an indicator of an error usage of the + // serialization library and should be double checked. + // See documentation on object tracking. Also, see the + // "rationale" section of the documenation + // for motivation for this checking. + + AUTOBOOST_STATIC_WARNING(typex::value); +} + +// checks for pointers + +template +inline void check_pointer_level(){ + // we should only invoke this once we KNOW that T + // has been used as a pointer!! + typedef + typename mpl::or_< + typename mpl::greater< + serialization::implementation_level< T >, + mpl::int_ + >, + typename mpl::not_< + typename mpl::equal_to< + serialization::tracking_level< T >, + mpl::int_ + > + > + > typex; + // Address the following when serializing to a pointer: + + // a) This type doesn't save class information in the + // archive. That is, the serialization trait implementation + // level <= object_serializable. + // b) Tracking for this type is set to "track selectively" + + // in this case, indication that an object is tracked is + // not stored in the archive itself - see level == object_serializable + // but rather the existence of the operation ar >> T * is used to + // infer that an object of this type should be tracked. So, if + // you save via a pointer but don't load via a pointer the operation + // will fail on load without given any valid reason for the failure. + + // So if your program traps here, consider changing the + // tracking or implementation level traits - or not + // serializing via a pointer. + AUTOBOOST_STATIC_WARNING(typex::value); +} + +template +void inline check_pointer_tracking(){ + typedef typename mpl::greater< + serialization::tracking_level< T >, + mpl::int_ + >::type typex; + // serializing an object of a type marked "track_never" through a pointer + // could result in creating more objects than were saved! + AUTOBOOST_STATIC_WARNING(typex::value); +} + +template +inline void check_const_loading(){ + typedef + typename mpl::or_< + typename autoboost::serialization::is_wrapper< T >, + typename mpl::not_< + typename autoboost::is_const< T > + > + >::type typex; + // cannot load data into a "const" object unless it's a + // wrapper around some other non-const object. + AUTOBOOST_STATIC_ASSERT(typex::value); +} + +} // detail +} // archive +} // boost + +#endif // AUTOBOOST_ARCHIVE_DETAIL_CHECK_HPP diff --git a/contrib/autoboost/boost/archive/detail/common_iarchive.hpp b/contrib/autoboost/autoboost/archive/detail/common_iarchive.hpp similarity index 81% rename from contrib/autoboost/boost/archive/detail/common_iarchive.hpp rename to contrib/autoboost/autoboost/archive/detail/common_iarchive.hpp index 2609506f5..de787fa49 100644 --- a/contrib/autoboost/boost/archive/detail/common_iarchive.hpp +++ b/contrib/autoboost/autoboost/archive/detail/common_iarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP -#define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,13 +16,13 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include -#include -#include -#include +#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -62,7 +62,7 @@ class common_iarchive : protected: // default processing - invoke serialization library template - void load_override(T & t, BOOST_PFTO int){ + void load_override(T & t, AUTOBOOST_PFTO int){ archive::load(* this->This(), t); } // default implementations of functions which emit start/end tags for @@ -80,9 +80,9 @@ class common_iarchive : } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/detail/common_oarchive.hpp b/contrib/autoboost/autoboost/archive/detail/common_oarchive.hpp similarity index 83% rename from contrib/autoboost/boost/archive/detail/common_oarchive.hpp rename to contrib/autoboost/autoboost/archive/detail/common_oarchive.hpp index 815195972..d7dd4f400 100644 --- a/contrib/autoboost/boost/archive/detail/common_oarchive.hpp +++ b/contrib/autoboost/autoboost/archive/detail/common_oarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP -#define BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,12 +16,12 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include -#include -#include +#include +#include -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -65,7 +65,7 @@ class common_oarchive : protected: // default processing - invoke serialization library template - void save_override(T & t, BOOST_PFTO int){ + void save_override(T & t, AUTOBOOST_PFTO int){ archive::save(* this->This(), t); } void save_start(const char * /*name*/){} @@ -80,8 +80,8 @@ class common_oarchive : } // namespace archive } // namespace autoboost -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif -#endif // BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/decl.hpp b/contrib/autoboost/autoboost/archive/detail/decl.hpp new file mode 100644 index 000000000..3f8a84d13 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/decl.hpp @@ -0,0 +1,79 @@ +#ifndef AUTOBOOST_ARCHIVE_DETAIL_DECL_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_DECL_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2///////// 3/////////4/////////5/////////6/////////7/////////8 +// decl.hpp +// +// (c) Copyright Robert Ramey 2004 +// Use, modification, and distribution is subject to 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 library home page at http://www.boost.org/libs/serialization + +//----------------------------------------------------------------------------// + +// This header implements separate compilation features as described in +// http://www.boost.org/more/separate_compilation.html + +#include +#include + +#if defined(AUTOBOOST_HAS_DECLSPEC) + #if (defined(AUTOBOOST_ALL_DYN_LINK) || defined(AUTOBOOST_SERIALIZATION_DYN_LINK)) + #if defined(AUTOBOOST_ARCHIVE_SOURCE) + #if defined(__BORLANDC__) + #define AUTOBOOST_ARCHIVE_DECL(T) T __export + #define AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export + #else + #define AUTOBOOST_ARCHIVE_DECL(T) __declspec(dllexport) T + #define AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T + #endif + #else + #if defined(__BORLANDC__) + #define AUTOBOOST_ARCHIVE_DECL(T) T __import + #else + #define AUTOBOOST_ARCHIVE_DECL(T) __declspec(dllimport) T + #endif + #endif + #if defined(AUTOBOOST_WARCHIVE_SOURCE) + #if defined(__BORLANDC__) + #define AUTOBOOST_WARCHIVE_DECL(T) T __export + #define AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export + #else + #define AUTOBOOST_WARCHIVE_DECL(T) __declspec(dllexport) T + #define AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T + #endif + #else + #if defined(__BORLANDC__) + #define AUTOBOOST_WARCHIVE_DECL(T) T __import + #else + #define AUTOBOOST_WARCHIVE_DECL(T) __declspec(dllimport) T + #endif + #endif + #if !defined(AUTOBOOST_WARCHIVE_SOURCE) && !defined(AUTOBOOST_ARCHIVE_SOURCE) + #if defined(__BORLANDC__) + #define AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __import + #else + #define AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllimport) T + #endif + #endif + #endif +#endif // AUTOBOOST_HAS_DECLSPEC + +#if ! defined(AUTOBOOST_ARCHIVE_DECL) + #define AUTOBOOST_ARCHIVE_DECL(T) T +#endif +#if ! defined(AUTOBOOST_WARCHIVE_DECL) + #define AUTOBOOST_WARCHIVE_DECL(T) T +#endif +#if ! defined(AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL) + #define AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T +#endif + +#endif // AUTOBOOST_ARCHIVE_DETAIL_DECL_HPP diff --git a/contrib/autoboost/boost/archive/detail/helper_collection.hpp b/contrib/autoboost/autoboost/archive/detail/helper_collection.hpp similarity index 87% rename from contrib/autoboost/boost/archive/detail/helper_collection.hpp rename to contrib/autoboost/autoboost/archive/detail/helper_collection.hpp index 2c7babf84..be58871de 100644 --- a/contrib/autoboost/boost/archive/detail/helper_collection.hpp +++ b/contrib/autoboost/autoboost/archive/detail/helper_collection.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP -#define BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP +#ifndef AUTOBOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) @@ -22,11 +22,11 @@ #include #include -#include +#include -#ifdef BOOST_NO_CXX11_SMART_PTR - #include - #include +#ifdef AUTOBOOST_NO_CXX11_SMART_PTR + #include + #include #endif namespace autoboost { @@ -42,7 +42,7 @@ class helper_collection // note: we dont' actually "share" the function object pointer // we only use shared_ptr to make sure that it get's deleted - #ifndef BOOST_NO_CXX11_SMART_PTR + #ifndef AUTOBOOST_NO_CXX11_SMART_PTR typedef std::pair< const void *, std::shared_ptr @@ -105,4 +105,4 @@ class helper_collection } // namespace serialization } // namespace autoboost -#endif // BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP +#endif // AUTOBOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/interface_iarchive.hpp b/contrib/autoboost/autoboost/archive/detail/interface_iarchive.hpp new file mode 100644 index 000000000..30a86f9c4 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/interface_iarchive.hpp @@ -0,0 +1,77 @@ +#ifndef AUTOBOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// interface_iarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. +#include // NULL +#include +#include +#include +#include +#include +#include // must be the last header + +namespace autoboost { +namespace archive { +namespace detail { + +class AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_pointer_iserializer; + +template +class interface_iarchive +{ +protected: + interface_iarchive(){}; +public: + ///////////////////////////////////////////////////////// + // archive public interface + typedef mpl::bool_ is_loading; + typedef mpl::bool_ is_saving; + + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + + template + const basic_pointer_iserializer * + register_type(T * = NULL){ + const basic_pointer_iserializer & bpis = + autoboost::serialization::singleton< + pointer_iserializer + >::get_const_instance(); + this->This()->register_basic_serializer(bpis.get_basic_serializer()); + return & bpis; + } + template + Archive & operator>>(T & t){ + this->This()->load_override(t, 0); + return * this->This(); + } + + // the & operator + template + Archive & operator&(T & t){ + return *(this->This()) >> t; + } +}; + +} // namespace detail +} // namespace archive +} // namespace autoboost + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/interface_oarchive.hpp b/contrib/autoboost/autoboost/archive/detail/interface_oarchive.hpp new file mode 100644 index 000000000..f4d9acd19 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/interface_oarchive.hpp @@ -0,0 +1,84 @@ +#ifndef AUTOBOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// interface_oarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. +#include // NULL +#include +#include + +#include +#include +#include // must be the last header + +#include + +namespace autoboost { +namespace archive { +namespace detail { + +class AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_pointer_oserializer; + +template +class interface_oarchive +{ +protected: + interface_oarchive(){}; +public: + ///////////////////////////////////////////////////////// + // archive public interface + typedef mpl::bool_ is_loading; + typedef mpl::bool_ is_saving; + + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + + template + const basic_pointer_oserializer * + register_type(const T * = NULL){ + const basic_pointer_oserializer & bpos = + autoboost::serialization::singleton< + pointer_oserializer + >::get_const_instance(); + this->This()->register_basic_serializer(bpos.get_basic_serializer()); + return & bpos; + } + + template + Archive & operator<<(T & t){ + this->This()->save_override(t, 0); + return * this->This(); + } + + // the & operator + template + Archive & operator&(T & t){ + #ifndef AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING + return * this->This() << const_cast(t); + #else + return * this->This() << t; + #endif + } +}; + +} // namespace detail +} // namespace archive +} // namespace autoboost + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP diff --git a/contrib/autoboost/boost/archive/detail/iserializer.hpp b/contrib/autoboost/autoboost/archive/detail/iserializer.hpp similarity index 86% rename from contrib/autoboost/boost/archive/detail/iserializer.hpp rename to contrib/autoboost/autoboost/archive/detail/iserializer.hpp index 63eaaf306..8979b7afb 100644 --- a/contrib/autoboost/boost/archive/detail/iserializer.hpp +++ b/contrib/autoboost/autoboost/archive/detail/iserializer.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP -#define BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP +#ifndef AUTOBOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -25,66 +25,66 @@ #include // for placement new #include // size_t, NULL -#include -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO - #include +#ifndef AUTOBOOST_SERIALIZATION_DEFAULT_TYPE_INFO + #include #endif -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include #define DONT_USE_HAS_NEW_OPERATOR ( \ defined(__BORLANDC__) \ - || BOOST_WORKAROUND(__IBMCPP__, < 1210) \ + || AUTOBOOST_WORKAROUND(__IBMCPP__, < 1210) \ || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \ ) #if ! DONT_USE_HAS_NEW_OPERATOR -#include +#include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // the following is need only for dynamic cast of polymorphic pointers -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace autoboost { @@ -106,7 +106,7 @@ class load_access { namespace detail { -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -129,11 +129,11 @@ class iserializer : public basic_iserializer ) {} public: - virtual BOOST_DLLEXPORT void load_object_data( + virtual AUTOBOOST_DLLEXPORT void load_object_data( basic_iarchive & ar, void *x, const unsigned int file_version - ) const BOOST_USED; + ) const AUTOBOOST_USED; virtual bool class_info() const { return autoboost::serialization::implementation_level< T >::value >= autoboost::serialization::object_class_info; @@ -154,12 +154,12 @@ class iserializer : public basic_iserializer virtual ~iserializer(){}; }; -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(pop) #endif template -BOOST_DLLEXPORT void iserializer::load_object_data( +AUTOBOOST_DLLEXPORT void iserializer::load_object_data( basic_iarchive & ar, void *x, const unsigned int file_version @@ -188,7 +188,7 @@ BOOST_DLLEXPORT void iserializer::load_object_data( ); } -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -301,25 +301,25 @@ class pointer_iserializer : iserializer >::get_const_instance(); } - BOOST_DLLEXPORT virtual void load_object_ptr( + AUTOBOOST_DLLEXPORT virtual void load_object_ptr( basic_iarchive & ar, void * x, const unsigned int file_version - ) const BOOST_USED; + ) const AUTOBOOST_USED; protected: // this should alway be a singleton so make the constructor protected pointer_iserializer(); ~pointer_iserializer(); }; -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(pop) #endif -// note: BOOST_DLLEXPORT is so that code for polymorphic class +// note: AUTOBOOST_DLLEXPORT is so that code for polymorphic class // serialized only through base class won't get optimized out template -BOOST_DLLEXPORT void pointer_iserializer::load_object_ptr( +AUTOBOOST_DLLEXPORT void pointer_iserializer::load_object_ptr( basic_iarchive & ar, void * t, const unsigned int file_version @@ -334,7 +334,7 @@ BOOST_DLLEXPORT void pointer_iserializer::load_object_ptr( // catch exception during load_construct_data so that we don't // automatically delete the t which is most likely not fully // constructed - BOOST_TRY { + AUTOBOOST_TRY { // this addresses an obscure situation that occurs when // load_constructor de-serializes something through a pointer. ar.next_object_pointer(t); @@ -344,13 +344,13 @@ BOOST_DLLEXPORT void pointer_iserializer::load_object_ptr( file_version ); } - BOOST_CATCH(...){ + AUTOBOOST_CATCH(...){ // if we get here the load_construct failed. The heap_allocation // will be automatically deleted so we don't have to do anything // special here. - BOOST_RETHROW; + AUTOBOOST_RETHROW; } - BOOST_CATCH_END + AUTOBOOST_CATCH_END ar_impl >> autoboost::serialization::make_nvp(NULL, * static_cast(t)); } @@ -470,7 +470,7 @@ struct load_pointer_type { template static const basic_pointer_iserializer * register_type(Archive & /* ar */){ // it has? to be polymorphic - BOOST_STATIC_ASSERT(autoboost::is_polymorphic< T >::value); + AUTOBOOST_STATIC_ASSERT(autoboost::is_polymorphic< T >::value); return static_cast(NULL); } }; @@ -581,7 +581,7 @@ struct load_array_type { - static_cast(static_cast(&t[0])) ); autoboost::serialization::collection_size_type count; - ar >> BOOST_SERIALIZATION_NVP(count); + ar >> AUTOBOOST_SERIALIZATION_NVP(count); if(static_cast(count) > current_count) autoboost::serialization::throw_exception( archive::archive_exception( @@ -621,7 +621,7 @@ inline void load(Archive & ar, T &t){ #if 0 // BORLAND -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) +#if AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT(0x560)) // borland has a couple of problems // a) if function is partially specialized - see below // const paramters are transformed to non-const ones @@ -636,13 +636,13 @@ inline void load(Archive &ar, const T & t){ #endif // let wrappers through. -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +#ifndef AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING template inline void load_wrapper(Archive &ar, const T&t, mpl::true_){ autoboost::archive::load(ar, const_cast(t)); } -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) +#if !AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT(0x560)) template inline void load(Archive &ar, const T&t){ load_wrapper(ar,t,serialization::is_wrapper< T >()); @@ -655,4 +655,4 @@ inline void load(Archive &ar, const T&t){ } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP +#endif // AUTOBOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP diff --git a/contrib/autoboost/boost/archive/detail/oserializer.hpp b/contrib/autoboost/autoboost/archive/detail/oserializer.hpp similarity index 85% rename from contrib/autoboost/boost/archive/detail/oserializer.hpp rename to contrib/autoboost/autoboost/archive/detail/oserializer.hpp index 23aca6d84..b1bcdf26a 100644 --- a/contrib/autoboost/boost/archive/detail/oserializer.hpp +++ b/contrib/autoboost/autoboost/archive/detail/oserializer.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_OSERIALIZER_HPP -#define BOOST_ARCHIVE_OSERIALIZER_HPP +#ifndef AUTOBOOST_ARCHIVE_OSERIALIZER_HPP +#define AUTOBOOST_ARCHIVE_OSERIALIZER_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -22,49 +22,49 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include // NULL -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO - #include +#ifndef AUTOBOOST_SERIALIZATION_DEFAULT_TYPE_INFO + #include #endif -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include namespace autoboost { @@ -91,7 +91,7 @@ class save_access { namespace detail { -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -103,7 +103,7 @@ class oserializer : public basic_oserializer // private constructor to inhibit any existence other than the // static one public: - explicit BOOST_DLLEXPORT oserializer() : + explicit AUTOBOOST_DLLEXPORT oserializer() : basic_oserializer( autoboost::serialization::singleton< typename @@ -111,10 +111,10 @@ class oserializer : public basic_oserializer >::get_const_instance() ) {} - virtual BOOST_DLLEXPORT void save_object_data( + virtual AUTOBOOST_DLLEXPORT void save_object_data( basic_oarchive & ar, const void *x - ) const BOOST_USED; + ) const AUTOBOOST_USED; virtual bool class_info() const { return autoboost::serialization::implementation_level< T >::value >= autoboost::serialization::object_class_info; @@ -133,18 +133,18 @@ class oserializer : public basic_oserializer virtual ~oserializer(){} }; -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(pop) #endif template -BOOST_DLLEXPORT void oserializer::save_object_data( +AUTOBOOST_DLLEXPORT void oserializer::save_object_data( basic_oarchive & ar, const void *x ) const { // make sure call is routed through the highest interface that might // be specialized by the user. - BOOST_STATIC_ASSERT(autoboost::is_const< T >::value == false); + AUTOBOOST_STATIC_ASSERT(autoboost::is_const< T >::value == false); autoboost::serialization::serialize_adl( autoboost::serialization::smart_cast_reference(ar), * static_cast(const_cast(x)), @@ -152,7 +152,7 @@ BOOST_DLLEXPORT void oserializer::save_object_data( ); } -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -168,25 +168,25 @@ class pointer_oserializer : oserializer >::get_const_instance(); } - virtual BOOST_DLLEXPORT void save_object_ptr( + virtual AUTOBOOST_DLLEXPORT void save_object_ptr( basic_oarchive & ar, const void * x - ) const BOOST_USED; + ) const AUTOBOOST_USED; public: pointer_oserializer(); ~pointer_oserializer(); }; -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(pop) #endif template -BOOST_DLLEXPORT void pointer_oserializer::save_object_ptr( +AUTOBOOST_DLLEXPORT void pointer_oserializer::save_object_ptr( basic_oarchive & ar, const void * x ) const { - BOOST_ASSERT(NULL != x); + AUTOBOOST_ASSERT(NULL != x); // make sure call is routed through the highest interface that might // be specialized by the user. T * t = static_cast(const_cast(x)); @@ -322,7 +322,7 @@ struct save_pointer_type { template static const basic_pointer_oserializer * register_type(Archive & /* ar */){ // it has? to be polymorphic - BOOST_STATIC_ASSERT(autoboost::is_polymorphic< T >::value); + AUTOBOOST_STATIC_ASSERT(autoboost::is_polymorphic< T >::value); return NULL; } }; @@ -384,7 +384,7 @@ struct save_pointer_type { // retrieve the true type of the object pointed to // if this assertion fails its an error in this library - BOOST_ASSERT(NULL != this_type); + AUTOBOOST_ASSERT(NULL != this_type); const autoboost::serialization::extended_type_info * true_type = i.get_derived_extended_type_info(t); @@ -433,7 +433,7 @@ struct save_pointer_type { archive_serializer_map >::get_const_instance().find(*true_type) ); - BOOST_ASSERT(NULL != bpos); + AUTOBOOST_ASSERT(NULL != bpos); if(NULL == bpos) autoboost::serialization::throw_exception( archive_exception( @@ -499,7 +499,7 @@ struct save_array_type - static_cast(static_cast(&t[0])) ); autoboost::serialization::collection_size_type count(c); - ar << BOOST_SERIALIZATION_NVP(count); + ar << AUTOBOOST_SERIALIZATION_NVP(count); ar << serialization::make_array(static_cast(&t[0]),count); } }; @@ -528,4 +528,4 @@ inline void save(Archive & ar, /*const*/ T &t){ } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_OSERIALIZER_HPP +#endif // AUTOBOOST_ARCHIVE_OSERIALIZER_HPP diff --git a/contrib/autoboost/boost/archive/detail/register_archive.hpp b/contrib/autoboost/autoboost/archive/detail/register_archive.hpp similarity index 86% rename from contrib/autoboost/boost/archive/detail/register_archive.hpp rename to contrib/autoboost/autoboost/archive/detail/register_archive.hpp index b9ab80483..36af1cff2 100644 --- a/contrib/autoboost/boost/archive/detail/register_archive.hpp +++ b/contrib/autoboost/autoboost/archive/detail/register_archive.hpp @@ -1,13 +1,13 @@ // Copyright David Abrahams 2006. 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) -#ifndef BOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP -# define BOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP +#ifndef AUTOBOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP +# define AUTOBOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP namespace autoboost { namespace archive { namespace detail { // No instantiate_ptr_serialization overloads generated by -// BOOST_SERIALIZATION_REGISTER_ARCHIVE that lexically follow the call +// AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE that lexically follow the call // will be seen *unless* they are in an associated namespace of one of // the arguments, so we pass one of these along to make sure this // namespace is considered. See temp.dep.candidate (14.6.4.2) in the @@ -52,7 +52,7 @@ char adjust_counter(counter<0>); template void instantiate_ptr_serialization(Serializable*, counter<0>) {} -#define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \ +#define AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \ namespace autoboost { namespace archive { namespace detail { \ get_counter::next adjust_counter(get_counter::type);\ template \ @@ -68,7 +68,7 @@ namespace autoboost { namespace archive { namespace detail { \ // This function gets called, but its only purpose is to participate // in overload resolution with the functions declared by -// BOOST_SERIALIZATION_REGISTER_ARCHIVE, below. +// AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE, below. template void instantiate_ptr_serialization(Serializable*, int, adl_tag ) {} @@ -77,7 +77,7 @@ void instantiate_ptr_serialization(Serializable*, int, adl_tag ) {} // enough to cause registration of serialization functions between // Archive and any exported Serializable type. See also: // boost/serialization/export.hpp -# define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \ +# define AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \ namespace autoboost { namespace archive { namespace detail { \ \ template \ @@ -88,4 +88,4 @@ instantiate_ptr_serialization( Serializable*, Archive*, adl_tag ); #endif }}} // namespace autoboost::archive::detail -#endif // BOOST_ARCHIVE_DETAIL_INSTANTIATE_SERIALIZE_DWA2006521_HPP +#endif // AUTOBOOST_ARCHIVE_DETAIL_INSTANTIATE_SERIALIZE_DWA2006521_HPP diff --git a/contrib/autoboost/autoboost/archive/detail/utf8_codecvt_facet.hpp b/contrib/autoboost/autoboost/archive/detail/utf8_codecvt_facet.hpp new file mode 100644 index 000000000..4b7ba8326 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/detail/utf8_codecvt_facet.hpp @@ -0,0 +1,23 @@ +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). +// 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) + +#ifndef AUTOBOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP +#define AUTOBOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP + +#ifdef AUTOBOOST_NO_CXX11_HDR_CODECVT + #define AUTOBOOST_UTF8_BEGIN_NAMESPACE \ + namespace autoboost { namespace archive { namespace detail { + #define AUTOBOOST_UTF8_DECL + #define AUTOBOOST_UTF8_END_NAMESPACE }}} + + #include + + #undef AUTOBOOST_UTF8_END_NAMESPACE + #undef AUTOBOOST_UTF8_DECL + #undef AUTOBOOST_UTF8_BEGIN_NAMESPACE +#endif // AUTOBOOST_NO_CXX11_HDR_CODECVT +#endif // AUTOBOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP + diff --git a/contrib/autoboost/autoboost/archive/dinkumware.hpp b/contrib/autoboost/autoboost/archive/dinkumware.hpp new file mode 100644 index 000000000..e4c98fd3f --- /dev/null +++ b/contrib/autoboost/autoboost/archive/dinkumware.hpp @@ -0,0 +1,224 @@ +#ifndef AUTOBOOST_ARCHIVE_DINKUMWARE_HPP +#define AUTOBOOST_ARCHIVE_DINKUMWARE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// dinkumware.hpp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +// this file adds a couple of things that are missing from the dinkumware +// implementation of the standard library. + +#include +#include + +#include +#include + +namespace std { + +// define i/o operators for 64 bit integers +template +basic_ostream & +operator<<(basic_ostream & os, autoboost::uint64_t t){ + // octal rendering of 64 bit number would be 22 octets + eos + CharType d[23]; + unsigned int radix; + + if(os.flags() & (int)std::ios_base::hex) + radix = 16; + else + if(os.flags() & (int)std::ios_base::oct) + radix = 8; + else + //if(s.flags() & (int)std::ios_base::dec) + radix = 10; + unsigned int i = 0; + do{ + unsigned int j = t % radix; + d[i++] = j + ((j < 10) ? '0' : ('a' - 10)); + t /= radix; + } + while(t > 0); + d[i--] = '\0'; + + // reverse digits + unsigned int j = 0; + while(j < i){ + CharType k = d[i]; + d[i] = d[j]; + d[j] = k; + --i;++j; + } + os << d; + return os; + +} + +template +basic_ostream & +operator<<(basic_ostream &os, autoboost::int64_t t){ + if(0 <= t){ + os << static_cast(t); + } + else{ + os.put('-'); + os << -t; + } + return os; +} + +template +basic_istream & +operator>>(basic_istream &is, autoboost::int64_t & t){ + CharType d; + do{ + d = is.get(); + } + while(::isspace(d)); + bool negative = (d == '-'); + if(negative) + d = is.get(); + unsigned int radix; + if(is.flags() & (int)std::ios_base::hex) + radix = 16; + else + if(is.flags() & (int)std::ios_base::oct) + radix = 8; + else + //if(s.flags() & (int)std::ios_base::dec) + radix = 10; + t = 0; + do{ + if('0' <= d && d <= '9') + t = t * radix + (d - '0'); + else + if('a' <= d && d <= 'f') + t = t * radix + (d - 'a' + 10); + else + break; + d = is.get(); + } + while(!is.fail()); + // restore the delimiter + is.putback(d); + is.clear(); + if(negative) + t = -t; + return is; +} + +template +basic_istream & +operator>>(basic_istream &is, autoboost::uint64_t & t){ + autoboost::int64_t it; + is >> it; + t = it; + return is; +} + +//#endif + +template<> +class back_insert_iterator > : public + iterator +{ +public: + typedef basic_string container_type; + typedef container_type::reference reference; + + explicit back_insert_iterator(container_type & s) + : container(& s) + {} // construct with container + + back_insert_iterator & operator=( + container_type::const_reference Val_ + ){ // push value into container + //container->push_back(Val_); + *container += Val_; + return (*this); + } + + back_insert_iterator & operator*(){ + return (*this); + } + + back_insert_iterator & operator++(){ + // pretend to preincrement + return (*this); + } + + back_insert_iterator operator++(int){ + // pretend to postincrement + return (*this); + } + +protected: + container_type *container; // pointer to container +}; + +template +inline back_insert_iterator > back_inserter( + basic_string & s +){ + return (std::back_insert_iterator >(s)); +} + +template<> +class back_insert_iterator > : public + iterator +{ +public: + typedef basic_string container_type; + typedef container_type::reference reference; + + explicit back_insert_iterator(container_type & s) + : container(& s) + {} // construct with container + + back_insert_iterator & operator=( + container_type::const_reference Val_ + ){ // push value into container + //container->push_back(Val_); + *container += Val_; + return (*this); + } + + back_insert_iterator & operator*(){ + return (*this); + } + + back_insert_iterator & operator++(){ + // pretend to preincrement + return (*this); + } + + back_insert_iterator operator++(int){ + // pretend to postincrement + return (*this); + } + +protected: + container_type *container; // pointer to container +}; + +template +inline back_insert_iterator > back_inserter( + basic_string & s +){ + return (std::back_insert_iterator >(s)); +} + +} // namespace std + +#endif //AUTOBOOST_ARCHIVE_DINKUMWARE_HPP diff --git a/contrib/autoboost/boost/archive/impl/archive_serializer_map.ipp b/contrib/autoboost/autoboost/archive/impl/archive_serializer_map.ipp similarity index 81% rename from contrib/autoboost/boost/archive/impl/archive_serializer_map.ipp rename to contrib/autoboost/autoboost/archive/impl/archive_serializer_map.ipp index 5b719a7e6..85c8ad2b1 100644 --- a/contrib/autoboost/boost/archive/impl/archive_serializer_map.ipp +++ b/contrib/autoboost/autoboost/archive/impl/archive_serializer_map.ipp @@ -12,16 +12,16 @@ // implementation of basic_text_iprimitive overrides for the combination // of template parameters used to implement a text_iprimitive -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { namespace archive { namespace detail { -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif @@ -32,12 +32,12 @@ namespace extra_detail { // anon {}; } -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC # pragma warning(pop) #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(bool) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(bool) archive_serializer_map::insert(const basic_serializer * bs){ return autoboost::serialization::singleton< extra_detail::map @@ -45,7 +45,7 @@ archive_serializer_map::insert(const basic_serializer * bs){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) archive_serializer_map::erase(const basic_serializer * bs){ if(autoboost::serialization::singleton< extra_detail::map @@ -57,7 +57,7 @@ archive_serializer_map::erase(const basic_serializer * bs){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(const basic_serializer *) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(const basic_serializer *) archive_serializer_map::find( const autoboost::serialization::extended_type_info & eti ) { diff --git a/contrib/autoboost/boost/archive/impl/basic_binary_iarchive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_binary_iarchive.ipp similarity index 80% rename from contrib/autoboost/boost/archive/impl/basic_binary_iarchive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_binary_iarchive.ipp index 2e4cdc897..151796006 100644 --- a/contrib/autoboost/boost/archive/impl/basic_binary_iarchive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_binary_iarchive.ipp @@ -8,12 +8,12 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include +#include #include #include -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; using ::strlen; @@ -21,10 +21,10 @@ namespace std{ } #endif -#include -#include +#include +#include -#include +#include namespace autoboost { namespace archive { @@ -32,12 +32,12 @@ namespace archive { /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // implementation of binary_binary_archive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_iarchive::load_override(class_name_type & t, int){ std::string cn; - cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE); + cn.reserve(AUTOBOOST_SERIALIZATION_MAX_KEY_SIZE); load_override(cn, 0); - if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) + if(cn.size() > (AUTOBOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) autoboost::serialization::throw_exception( archive_exception(archive_exception::invalid_class_name) ); @@ -47,7 +47,7 @@ basic_binary_iarchive::load_override(class_name_type & t, int){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_iarchive::init(){ // read signature in an archive version independent manner std::string file_signature; @@ -56,9 +56,9 @@ basic_binary_iarchive::init(){ try { std::size_t l; this->This()->load(l); - if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) { + if(l == std::strlen(AUTOBOOST_ARCHIVE_SIGNATURE())) { // borland de-allocator fixup - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) if(NULL != file_signature.data()) #endif file_signature.resize(l); @@ -76,7 +76,7 @@ basic_binary_iarchive::init(){ * this->This() >> file_signature; #endif - if(file_signature != BOOST_ARCHIVE_SIGNATURE()) + if(file_signature != AUTOBOOST_ARCHIVE_SIGNATURE()) autoboost::serialization::throw_exception( archive_exception(archive_exception::invalid_signature) ); @@ -88,7 +88,7 @@ basic_binary_iarchive::init(){ { int v = 0; v = this->This()->m_sb.sbumpc(); - #if defined(BOOST_LITTLE_ENDIAN) + #if defined(AUTOBOOST_LITTLE_ENDIAN) if(v < 6){ ; } @@ -110,20 +110,20 @@ basic_binary_iarchive::init(){ // version 8+ followed by a zero this->This()->m_sb.sbumpc(); } - #elif defined(BOOST_BIG_ENDIAN) + #elif defined(AUTOBOOST_BIG_ENDIAN) if(v == 0) v = this->This()->m_sb.sbumpc(); #endif input_library_version = static_cast(v); } - #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + #if AUTOBOOST_WORKAROUND(__MWERKS__, AUTOBOOST_TESTED_AT(0x3205)) this->set_library_version(input_library_version); #else detail::basic_iarchive::set_library_version(input_library_version); #endif - if(BOOST_ARCHIVE_VERSION() < input_library_version) + if(AUTOBOOST_ARCHIVE_VERSION() < input_library_version) autoboost::serialization::throw_exception( archive_exception(archive_exception::unsupported_version) ); diff --git a/contrib/autoboost/boost/archive/impl/basic_binary_iprimitive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_binary_iprimitive.ipp similarity index 83% rename from contrib/autoboost/boost/archive/impl/basic_binary_iprimitive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_binary_iprimitive.ipp index 4715e95c3..773cdb516 100644 --- a/contrib/autoboost/boost/archive/impl/basic_binary_iprimitive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_binary_iprimitive.ipp @@ -8,27 +8,27 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include // size_t, NULL #include // memcpy -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; using ::memcpy; } // namespace std #endif -#include // fixup for RogueWave +#include // fixup for RogueWave -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { namespace archive { @@ -37,7 +37,7 @@ namespace archive { // implementation of basic_binary_iprimitive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_iprimitive::init() { // Detect attempts to pass native binary archives across @@ -90,7 +90,7 @@ basic_binary_iprimitive::init() } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_iprimitive::load(wchar_t * ws) { std::size_t l; // number of wchar_t !!! @@ -100,13 +100,13 @@ basic_binary_iprimitive::load(wchar_t * ws) } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_iprimitive::load(std::string & s) { std::size_t l; this->This()->load(l); // borland de-allocator fixup - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) if(NULL != s.data()) #endif s.resize(l); @@ -115,9 +115,9 @@ basic_binary_iprimitive::load(std::string & s) load_binary(&(*s.begin()), l); } -#ifndef BOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_CWCHAR template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_iprimitive::load(char * s) { std::size_t l; @@ -127,15 +127,15 @@ basic_binary_iprimitive::load(char * s) } #endif -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_iprimitive::load(std::wstring & ws) { std::size_t l; this->This()->load(l); // borland de-allocator fixup - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) if(NULL != ws.data()) #endif ws.resize(l); @@ -145,12 +145,12 @@ basic_binary_iprimitive::load(std::wstring & ws) #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_binary_iprimitive::basic_binary_iprimitive( std::basic_streambuf & sb, bool no_codecvt ) : -#ifndef BOOST_NO_STD_LOCALE +#ifndef AUTOBOOST_NO_STD_LOCALE m_sb(sb), archive_locale(NULL), locale_saver(m_sb) @@ -183,7 +183,7 @@ template class input_streambuf_access : public std::basic_streambuf { public: virtual int sync(){ -#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) +#if AUTOBOOST_WORKAROUND(__MWERKS__, AUTOBOOST_TESTED_AT(0x3206)) return this->basic_streambuf::sync(); #else return this->basic_streambuf::sync(); @@ -195,7 +195,7 @@ class input_streambuf_access : public std::basic_streambuf { // scoped_ptr requires that archive_locale be a complete type at time of // destruction so define destructor here rather than in the header template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_binary_iprimitive::~basic_binary_iprimitive(){ // push back unread characters //destructor can't throw ! diff --git a/contrib/autoboost/boost/archive/impl/basic_binary_oarchive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_binary_oarchive.ipp similarity index 75% rename from contrib/autoboost/boost/archive/impl/basic_binary_oarchive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_binary_oarchive.ipp index 62ba82cba..f70fca959 100644 --- a/contrib/autoboost/boost/archive/impl/basic_binary_oarchive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_binary_oarchive.ipp @@ -8,18 +8,18 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include +#include #include #include -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; } #endif -#include +#include namespace autoboost { namespace archive { @@ -29,16 +29,16 @@ namespace archive { template #if !defined(__BORLANDC__) -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) #else void #endif basic_binary_oarchive::init(){ // write signature in an archive version independent manner - const std::string file_signature(BOOST_ARCHIVE_SIGNATURE()); + const std::string file_signature(AUTOBOOST_ARCHIVE_SIGNATURE()); * this->This() << file_signature; // write library version - const library_version_type v(BOOST_ARCHIVE_VERSION()); + const library_version_type v(AUTOBOOST_ARCHIVE_VERSION()); * this->This() << v; } diff --git a/contrib/autoboost/boost/archive/impl/basic_binary_oprimitive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_binary_oprimitive.ipp similarity index 83% rename from contrib/autoboost/boost/archive/impl/basic_binary_oprimitive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_binary_oprimitive.ipp index 976aac419..0ccc831e9 100644 --- a/contrib/autoboost/boost/archive/impl/basic_binary_oprimitive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_binary_oprimitive.ipp @@ -12,26 +12,26 @@ #include // NULL #include -#include +#include -#if defined(BOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__) namespace std{ using ::strlen; } // namespace std #endif -#ifndef BOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_CWCHAR #include -#ifdef BOOST_NO_STDC_NAMESPACE +#ifdef AUTOBOOST_NO_STDC_NAMESPACE namespace std{ using ::wcslen; } #endif #endif -#include +#include -#include -#include -#include +#include +#include +#include namespace autoboost { namespace archive { @@ -40,7 +40,7 @@ namespace archive { // implementation of basic_binary_oprimitive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_oprimitive::init() { // record native sizes of fundamental types @@ -56,7 +56,7 @@ basic_binary_oprimitive::init() } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_oprimitive::save(const char * s) { std::size_t l = std::strlen(s); @@ -65,7 +65,7 @@ basic_binary_oprimitive::save(const char * s) } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_oprimitive::save(const std::string &s) { std::size_t l = static_cast(s.size()); @@ -73,9 +73,9 @@ basic_binary_oprimitive::save(const std::string &s) save_binary(s.data(), l); } -#ifndef BOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_CWCHAR template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_oprimitive::save(const wchar_t * ws) { std::size_t l = std::wcslen(ws); @@ -84,9 +84,9 @@ basic_binary_oprimitive::save(const wchar_t * ws) } #endif -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_binary_oprimitive::save(const std::wstring &ws) { std::size_t l = ws.size(); @@ -96,12 +96,12 @@ basic_binary_oprimitive::save(const std::wstring &ws) #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_binary_oprimitive::basic_binary_oprimitive( std::basic_streambuf & sb, bool no_codecvt ) : -#ifndef BOOST_NO_STD_LOCALE +#ifndef AUTOBOOST_NO_STD_LOCALE m_sb(sb), archive_locale(NULL), locale_saver(m_sb) @@ -134,7 +134,7 @@ template class output_streambuf_access : public std::basic_streambuf { public: virtual int sync(){ -#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) +#if AUTOBOOST_WORKAROUND(__MWERKS__, AUTOBOOST_TESTED_AT(0x3206)) return this->basic_streambuf::sync(); #else return this->basic_streambuf::sync(); @@ -146,7 +146,7 @@ class output_streambuf_access : public std::basic_streambuf { // scoped_ptr requires that g be a complete type at time of // destruction so define destructor here rather than in the header template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_binary_oprimitive::~basic_binary_oprimitive(){ // flush buffer //destructor can't throw diff --git a/contrib/autoboost/boost/archive/impl/basic_text_iarchive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_text_iarchive.ipp similarity index 76% rename from contrib/autoboost/boost/archive/impl/basic_text_iarchive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_text_iarchive.ipp index ecafd55a6..70872d417 100644 --- a/contrib/autoboost/boost/archive/impl/basic_text_iarchive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_text_iarchive.ipp @@ -11,16 +11,16 @@ #include #include -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; } #endif -#include -#include -#include +#include +#include +#include namespace autoboost { namespace archive { @@ -29,12 +29,12 @@ namespace archive { // implementation of text_text_archive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_text_iarchive::load_override(class_name_type & t, int){ std::string cn; - cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE); + cn.reserve(AUTOBOOST_SERIALIZATION_MAX_KEY_SIZE); load_override(cn, 0); - if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) + if(cn.size() > (AUTOBOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) autoboost::serialization::throw_exception( archive_exception(archive_exception::invalid_class_name) ); @@ -44,12 +44,12 @@ basic_text_iarchive::load_override(class_name_type & t, int){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_text_iarchive::init(void){ // read signature in an archive version independent manner std::string file_signature; * this->This() >> file_signature; - if(file_signature != BOOST_ARCHIVE_SIGNATURE()) + if(file_signature != AUTOBOOST_ARCHIVE_SIGNATURE()) autoboost::serialization::throw_exception( archive_exception(archive_exception::invalid_signature) ); @@ -59,14 +59,14 @@ basic_text_iarchive::init(void){ library_version_type input_library_version; * this->This() >> input_library_version; - #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + #if AUTOBOOST_WORKAROUND(__MWERKS__, AUTOBOOST_TESTED_AT(0x3205)) this->set_library_version(input_library_version); #else detail::basic_iarchive::set_library_version(input_library_version); #endif // extra little .t is to get around borland quirk - if(BOOST_ARCHIVE_VERSION() < input_library_version) + if(AUTOBOOST_ARCHIVE_VERSION() < input_library_version) autoboost::serialization::throw_exception( archive_exception(archive_exception::unsupported_version) ); diff --git a/contrib/autoboost/boost/archive/impl/basic_text_iprimitive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_text_iprimitive.ipp similarity index 79% rename from contrib/autoboost/boost/archive/impl/basic_text_iprimitive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_text_iprimitive.ipp index 439114c0b..1f08b9a98 100644 --- a/contrib/autoboost/boost/archive/impl/basic_text_iprimitive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_text_iprimitive.ipp @@ -11,24 +11,24 @@ #include // size_t #include // NULL -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { namespace archive { @@ -42,7 +42,7 @@ namespace detail { return 0 != std::isspace(t); } - #ifndef BOOST_NO_CWCHAR + #ifndef AUTOBOOST_NO_CWCHAR template<> inline bool is_whitespace(wchar_t t){ return 0 != std::iswspace(t); @@ -53,7 +53,7 @@ namespace detail { // translate base64 text into binary and copy into buffer // until buffer is full. template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_text_iprimitive::load_binary( void *address, std::size_t count @@ -63,7 +63,7 @@ basic_text_iprimitive::load_binary( if(0 == count) return; - BOOST_ASSERT( + AUTOBOOST_ASSERT( static_cast((std::numeric_limits::max)()) > (count + sizeof(CharType) - 1)/sizeof(CharType) ); @@ -88,7 +88,7 @@ basic_text_iprimitive::load_binary( binary; binary i = binary( - BOOST_MAKE_PFTO_WRAPPER( + AUTOBOOST_MAKE_PFTO_WRAPPER( iterators::istream_iterator(is) ) ); @@ -112,12 +112,12 @@ basic_text_iprimitive::load_binary( } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_text_iprimitive::basic_text_iprimitive( IStream &is_, bool no_codecvt ) : -#ifndef BOOST_NO_STD_LOCALE +#ifndef AUTOBOOST_NO_STD_LOCALE is(is_), flags_saver(is_), precision_saver(is_), @@ -143,7 +143,7 @@ basic_text_iprimitive::basic_text_iprimitive( #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_text_iprimitive::~basic_text_iprimitive(){ is.sync(); } diff --git a/contrib/autoboost/boost/archive/impl/basic_text_oarchive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_text_oarchive.ipp similarity index 76% rename from contrib/autoboost/boost/archive/impl/basic_text_oarchive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_text_oarchive.ipp index 378b9e6b6..966cc8c23 100644 --- a/contrib/autoboost/boost/archive/impl/basic_text_oarchive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_text_oarchive.ipp @@ -8,17 +8,17 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include +#include #include -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; } #endif -#include +#include namespace autoboost { namespace archive { @@ -27,12 +27,12 @@ namespace archive { // implementation of basic_text_oarchive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_text_oarchive::newtoken() { switch(delimiter){ default: - BOOST_ASSERT(false); + AUTOBOOST_ASSERT(false); break; case eol: this->This()->put('\n'); @@ -48,13 +48,13 @@ basic_text_oarchive::newtoken() } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_text_oarchive::init(){ // write signature in an archive version independent manner - const std::string file_signature(BOOST_ARCHIVE_SIGNATURE()); + const std::string file_signature(AUTOBOOST_ARCHIVE_SIGNATURE()); * this->This() << file_signature; // write library version - const library_version_type v(BOOST_ARCHIVE_VERSION()); + const library_version_type v(AUTOBOOST_ARCHIVE_VERSION()); * this->This() << v; } diff --git a/contrib/autoboost/boost/archive/impl/basic_text_oprimitive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_text_oprimitive.ipp similarity index 75% rename from contrib/autoboost/boost/archive/impl/basic_text_oprimitive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_text_oprimitive.ipp index 7a4f0d3da..5ef1c166b 100644 --- a/contrib/autoboost/boost/archive/impl/basic_text_oprimitive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_text_oprimitive.ipp @@ -10,23 +10,23 @@ #include // NULL #include // std::copy -#include +#include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { namespace archive { // translate to base64 and copy in to buffer. template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_text_oprimitive::save_binary( const void *address, std::size_t count @@ -59,9 +59,9 @@ basic_text_oprimitive::save_binary( autoboost::archive::iterators::ostream_iterator oi(os); std::copy( - base64_text(BOOST_MAKE_PFTO_WRAPPER(static_cast(address))), + base64_text(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast(address))), base64_text( - BOOST_MAKE_PFTO_WRAPPER(static_cast(address) + count) + AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast(address) + count) ), oi ); @@ -75,12 +75,12 @@ basic_text_oprimitive::save_binary( } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_text_oprimitive::basic_text_oprimitive( OStream & os_, bool no_codecvt ) : -#ifndef BOOST_NO_STD_LOCALE +#ifndef AUTOBOOST_NO_STD_LOCALE os(os_), flags_saver(os_), precision_saver(os_), @@ -106,7 +106,7 @@ basic_text_oprimitive::basic_text_oprimitive( #endif template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_text_oprimitive::~basic_text_oprimitive(){ os << std::endl; } diff --git a/contrib/autoboost/boost/archive/impl/basic_xml_grammar.hpp b/contrib/autoboost/autoboost/archive/impl/basic_xml_grammar.hpp similarity index 80% rename from contrib/autoboost/boost/archive/impl/basic_xml_grammar.hpp rename to contrib/autoboost/autoboost/archive/impl/basic_xml_grammar.hpp index 754717b3e..e493cf0ed 100644 --- a/contrib/autoboost/boost/archive/impl/basic_xml_grammar.hpp +++ b/contrib/autoboost/autoboost/archive/impl/basic_xml_grammar.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP -#define BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP +#ifndef AUTOBOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP +#define AUTOBOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -47,15 +47,15 @@ =============================================================================*/ #include -#include -#include +#include +#include -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include namespace autoboost { namespace archive { @@ -72,14 +72,14 @@ class basic_xml_grammar { friend struct return_values; private: - typedef BOOST_DEDUCED_TYPENAME std::basic_istream IStream; - typedef BOOST_DEDUCED_TYPENAME std::basic_string StringType; - typedef BOOST_DEDUCED_TYPENAME autoboost::spirit::classic::chset chset_t; - typedef BOOST_DEDUCED_TYPENAME autoboost::spirit::classic::chlit chlit_t; - typedef BOOST_DEDUCED_TYPENAME autoboost::spirit::classic::scanner< - BOOST_DEDUCED_TYPENAME std::basic_string::iterator + typedef AUTOBOOST_DEDUCED_TYPENAME std::basic_istream IStream; + typedef AUTOBOOST_DEDUCED_TYPENAME std::basic_string StringType; + typedef AUTOBOOST_DEDUCED_TYPENAME autoboost::spirit::classic::chset chset_t; + typedef AUTOBOOST_DEDUCED_TYPENAME autoboost::spirit::classic::chlit chlit_t; + typedef AUTOBOOST_DEDUCED_TYPENAME autoboost::spirit::classic::scanner< + AUTOBOOST_DEDUCED_TYPENAME std::basic_string::iterator > scanner_t; - typedef BOOST_DEDUCED_TYPENAME autoboost::spirit::classic::rule rule_t; + typedef AUTOBOOST_DEDUCED_TYPENAME autoboost::spirit::classic::rule rule_t; // Start grammar definition rule_t Reference, @@ -170,4 +170,4 @@ class basic_xml_grammar { } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP +#endif // AUTOBOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP diff --git a/contrib/autoboost/boost/archive/impl/basic_xml_iarchive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_xml_iarchive.ipp similarity index 83% rename from contrib/autoboost/boost/archive/impl/basic_xml_iarchive.ipp rename to contrib/autoboost/autoboost/archive/impl/basic_xml_iarchive.ipp index 9949cf167..cb794fd0d 100644 --- a/contrib/autoboost/boost/archive/impl/basic_xml_iarchive.ipp +++ b/contrib/autoboost/autoboost/archive/impl/basic_xml_iarchive.ipp @@ -8,14 +8,14 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include // NULL #include -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { namespace archive { @@ -24,7 +24,7 @@ namespace archive { // implementation of xml_text_archive template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_xml_iarchive::load_start(const char *name){ // if there's no name if(NULL == name) @@ -41,7 +41,7 @@ basic_xml_iarchive::load_start(const char *name){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_xml_iarchive::load_end(const char *name){ // if there's no name if(NULL == name) @@ -77,37 +77,37 @@ basic_xml_iarchive::load_end(const char *name){ } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_xml_iarchive::load_override(object_id_type & t, int){ t = object_id_type(this->This()->gimpl->rv.object_id); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_xml_iarchive::load_override(version_type & t, int){ t = version_type(this->This()->gimpl->rv.version); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_xml_iarchive::load_override(class_id_type & t, int){ t = class_id_type(this->This()->gimpl->rv.class_id); } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) basic_xml_iarchive::load_override(tracking_type & t, int){ t = this->This()->gimpl->rv.tracking_level; } template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_xml_iarchive::basic_xml_iarchive(unsigned int flags) : detail::common_iarchive(flags), depth(0) {} template -BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_xml_iarchive::~basic_xml_iarchive(){} } // namespace archive diff --git a/contrib/autoboost/autoboost/archive/impl/basic_xml_oarchive.ipp b/contrib/autoboost/autoboost/archive/impl/basic_xml_oarchive.ipp new file mode 100644 index 000000000..7c7c94bcb --- /dev/null +++ b/contrib/autoboost/autoboost/archive/impl/basic_xml_oarchive.ipp @@ -0,0 +1,275 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_oarchive.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// 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 updates, documentation, and revision history. + +#include +#include // NULL +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__) +namespace std{ + using ::strlen; +} // namespace std +#endif + +#include +#include +#include +#include + +namespace autoboost { +namespace archive { + +namespace detail { +template +struct XML_name { + void operator()(CharType t) const{ + const unsigned char lookup_table[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0, // -. + 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, // 0-9 + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // A- + 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, // -Z _ + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // a- + 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, // -z + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + }; + if((unsigned)t > 127) + return; + if(0 == lookup_table[(unsigned)t]) + autoboost::serialization::throw_exception( + xml_archive_exception( + xml_archive_exception::xml_archive_tag_name_error + ) + ); + } +}; + +} // namespace detail + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions common to both types of xml output + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::write_attribute( + const char *attribute_name, + int t, + const char *conjunction +){ + this->This()->put(' '); + this->This()->put(attribute_name); + this->This()->put(conjunction); + this->This()->save(t); + this->This()->put('"'); +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::write_attribute( + const char *attribute_name, + const char *key +){ + this->This()->put(' '); + this->This()->put(attribute_name); + this->This()->put("=\""); + this->This()->save(key); + this->This()->put('"'); +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::indent(){ + int i; + for(i = depth; i-- > 0;) + this->This()->put('\t'); +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_start(const char *name) +{ + if(NULL == name) + return; + + // be sure name has no invalid characters + std::for_each(name, name + std::strlen(name), detail::XML_name()); + + end_preamble(); + if(depth > 0){ + this->This()->put('\n'); + indent(); + } + ++depth; + this->This()->put('<'); + this->This()->save(name); + pending_preamble = true; + indent_next = false; +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_end(const char *name) +{ + if(NULL == name) + return; + + // be sure name has no invalid characters + std::for_each(name, name + std::strlen(name), detail::XML_name()); + + end_preamble(); + --depth; + if(indent_next){ + this->This()->put('\n'); + indent(); + } + indent_next = true; + this->This()->put("This()->save(name); + this->This()->put('>'); + if(0 == depth) + this->This()->put('\n'); +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::end_preamble(){ + if(pending_preamble){ + this->This()->put('>'); + pending_preamble = false; + } +} +#if 0 +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const object_id_type & t, int) +{ + int i = t.t; // extra .t is for borland + write_attribute(AUTOBOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_"); +} +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override( + const object_reference_type & t, + int +){ + int i = t.t; // extra .t is for borland + write_attribute(AUTOBOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_"); +} +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const version_type & t, int) +{ + int i = t.t; // extra .t is for borland + write_attribute(AUTOBOOST_ARCHIVE_XML_VERSION(), i); +} +#endif + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const object_id_type & t, int) +{ + // borland doesn't do conversion of STRONG_TYPEDEFs very well + const unsigned int i = t; + write_attribute(AUTOBOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_"); +} +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override( + const object_reference_type & t, + int +){ + const unsigned int i = t; + write_attribute(AUTOBOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_"); +} +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const version_type & t, int) +{ + const unsigned int i = t; + write_attribute(AUTOBOOST_ARCHIVE_XML_VERSION(), i); +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const class_id_type & t, int) +{ + write_attribute(AUTOBOOST_ARCHIVE_XML_CLASS_ID(), t); +} +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override( + const class_id_reference_type & t, + int +){ + write_attribute(AUTOBOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(), t); +} +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override( + const class_id_optional_type & t, + int +){ + write_attribute(AUTOBOOST_ARCHIVE_XML_CLASS_ID(), t); +} +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const class_name_type & t, int) +{ + const char * key = t; + if(NULL == key) + return; + write_attribute(AUTOBOOST_ARCHIVE_XML_CLASS_NAME(), key); +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const tracking_type & t, int) +{ + write_attribute(AUTOBOOST_ARCHIVE_XML_TRACKING(), t.t); +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::init(){ + // xml header + this->This()->put("\n"); + this->This()->put("\n"); + // xml document wrapper - outer root + this->This()->put("This()->put(">\n"); +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) +basic_xml_oarchive::basic_xml_oarchive(unsigned int flags) : + detail::common_oarchive(flags), + depth(0), + indent_next(false), + pending_preamble(false) +{ +} + +template +AUTOBOOST_ARCHIVE_OR_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) +basic_xml_oarchive::~basic_xml_oarchive(){ + if(0 == (this->get_flags() & no_header)){ + AUTOBOOST_TRY{ + this->This()->put("\n"); + } + AUTOBOOST_CATCH(...){} + AUTOBOOST_CATCH_END + } +} + +} // namespace archive +} // namespace autoboost diff --git a/contrib/autoboost/boost/archive/impl/text_iarchive_impl.ipp b/contrib/autoboost/autoboost/archive/impl/text_iarchive_impl.ipp similarity index 76% rename from contrib/autoboost/boost/archive/impl/text_iarchive_impl.ipp rename to contrib/autoboost/autoboost/archive/impl/text_iarchive_impl.ipp index bba087034..6ff786c83 100644 --- a/contrib/autoboost/boost/archive/impl/text_iarchive_impl.ipp +++ b/contrib/autoboost/autoboost/archive/impl/text_iarchive_impl.ipp @@ -13,22 +13,22 @@ // of template parameters used to implement a text_iprimitive #include // size_t, NULL -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif -#include // RogueWave +#include // RogueWave -#include +#include namespace autoboost { namespace archive { template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_iarchive_impl::load(char *s) { std::size_t size; @@ -41,7 +41,7 @@ text_iarchive_impl::load(char *s) } template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_iarchive_impl::load(std::string &s) { std::size_t size; @@ -49,7 +49,7 @@ text_iarchive_impl::load(std::string &s) // skip separating space is.get(); // borland de-allocator fixup - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) if(NULL != s.data()) #endif s.resize(size); @@ -57,10 +57,10 @@ text_iarchive_impl::load(std::string &s) is.read(&(*s.begin()), size); } -#ifndef BOOST_NO_CWCHAR -#ifndef BOOST_NO_INTRINSIC_WCHAR_T +#ifndef AUTOBOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_iarchive_impl::load(wchar_t *ws) { std::size_t size; @@ -70,17 +70,17 @@ text_iarchive_impl::load(wchar_t *ws) is.read((char *)ws, size * sizeof(wchar_t)/sizeof(char)); ws[size] = L'\0'; } -#endif // BOOST_NO_INTRINSIC_WCHAR_T +#endif // AUTOBOOST_NO_INTRINSIC_WCHAR_T -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_iarchive_impl::load(std::wstring &ws) { std::size_t size; * this->This() >> size; // borland de-allocator fixup - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) if(NULL != ws.data()) #endif ws.resize(size); @@ -89,23 +89,23 @@ text_iarchive_impl::load(std::wstring &ws) is.read((char *)ws.data(), size * sizeof(wchar_t)/sizeof(char)); } -#endif // BOOST_NO_STD_WSTRING -#endif // BOOST_NO_CWCHAR +#endif // AUTOBOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_CWCHAR template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_iarchive_impl::load_override(class_name_type & t, int){ basic_text_iarchive::load_override(t, 0); } template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_iarchive_impl::init(){ basic_text_iarchive::init(); } template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) text_iarchive_impl::text_iarchive_impl( std::istream & is, unsigned int flags @@ -117,7 +117,7 @@ text_iarchive_impl::text_iarchive_impl( basic_text_iarchive(flags) { if(0 == (flags & no_header)) - #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + #if AUTOBOOST_WORKAROUND(__MWERKS__, AUTOBOOST_TESTED_AT(0x3205)) this->init(); #else this->basic_text_iarchive::init(); diff --git a/contrib/autoboost/boost/archive/impl/text_oarchive_impl.ipp b/contrib/autoboost/autoboost/archive/impl/text_oarchive_impl.ipp similarity index 79% rename from contrib/autoboost/boost/archive/impl/text_oarchive_impl.ipp rename to contrib/autoboost/autoboost/archive/impl/text_oarchive_impl.ipp index b48cf8ea4..31b636582 100644 --- a/contrib/autoboost/boost/archive/impl/text_oarchive_impl.ipp +++ b/contrib/autoboost/autoboost/archive/impl/text_oarchive_impl.ipp @@ -9,26 +9,26 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include +#include #include #include // size_t -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif -#ifndef BOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_CWCHAR #include -#ifdef BOOST_NO_STDC_NAMESPACE +#ifdef AUTOBOOST_NO_STDC_NAMESPACE namespace std{ using ::wcslen; } #endif #endif -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -38,7 +38,7 @@ namespace archive { // of template parameters used to create a text_oprimitive template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_oarchive_impl::save(const char * s) { const std::size_t len = std::ostream::traits_type::length(s); @@ -48,7 +48,7 @@ text_oarchive_impl::save(const char * s) } template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_oarchive_impl::save(const std::string &s) { const std::size_t size = s.size(); @@ -57,10 +57,10 @@ text_oarchive_impl::save(const std::string &s) os << s; } -#ifndef BOOST_NO_CWCHAR -#ifndef BOOST_NO_INTRINSIC_WCHAR_T +#ifndef AUTOBOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_oarchive_impl::save(const wchar_t * ws) { const std::size_t l = std::wcslen(ws); @@ -70,9 +70,9 @@ text_oarchive_impl::save(const wchar_t * ws) } #endif -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_oarchive_impl::save(const std::wstring &ws) { const std::size_t l = ws.size(); @@ -81,10 +81,10 @@ text_oarchive_impl::save(const std::wstring &ws) os.write((const char *)(ws.data()), l * sizeof(wchar_t)/sizeof(char)); } #endif -#endif // BOOST_NO_CWCHAR +#endif // AUTOBOOST_NO_CWCHAR template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) text_oarchive_impl::text_oarchive_impl( std::ostream & os, unsigned int flags @@ -96,7 +96,7 @@ text_oarchive_impl::text_oarchive_impl( basic_text_oarchive(flags) { if(0 == (flags & no_header)) - #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + #if AUTOBOOST_WORKAROUND(__MWERKS__, AUTOBOOST_TESTED_AT(0x3205)) this->init(); #else this->basic_text_oarchive::init(); @@ -104,7 +104,7 @@ text_oarchive_impl::text_oarchive_impl( } template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) text_oarchive_impl::save_binary(const void *address, std::size_t count){ put('\n'); this->end_preamble(); diff --git a/contrib/autoboost/boost/archive/impl/text_wiarchive_impl.ipp b/contrib/autoboost/autoboost/archive/impl/text_wiarchive_impl.ipp similarity index 78% rename from contrib/autoboost/boost/archive/impl/text_wiarchive_impl.ipp rename to contrib/autoboost/autoboost/archive/impl/text_wiarchive_impl.ipp index fa77f8a88..929c6a696 100644 --- a/contrib/autoboost/boost/archive/impl/text_wiarchive_impl.ipp +++ b/contrib/autoboost/autoboost/archive/impl/text_wiarchive_impl.ipp @@ -10,17 +10,17 @@ #include // size_t, NULL -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif -#include // fixup for RogueWave +#include // fixup for RogueWave -#ifndef BOOST_NO_STD_WSTREAMBUF -#include +#ifndef AUTOBOOST_NO_STD_WSTREAMBUF +#include namespace autoboost { namespace archive { @@ -29,7 +29,7 @@ namespace archive { // implementation of wiprimtives functions // template -BOOST_WARCHIVE_DECL(void) +AUTOBOOST_WARCHIVE_DECL(void) text_wiarchive_impl::load(char *s) { std::size_t size; @@ -43,14 +43,14 @@ text_wiarchive_impl::load(char *s) } template -BOOST_WARCHIVE_DECL(void) +AUTOBOOST_WARCHIVE_DECL(void) text_wiarchive_impl::load(std::string &s) { std::size_t size; * this->This() >> size; // skip separating space is.get(); - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) if(NULL != s.data()) #endif s.resize(0); @@ -61,9 +61,9 @@ text_wiarchive_impl::load(std::string &s) } } -#ifndef BOOST_NO_INTRINSIC_WCHAR_T +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T template -BOOST_WARCHIVE_DECL(void) +AUTOBOOST_WARCHIVE_DECL(void) text_wiarchive_impl::load(wchar_t *s) { std::size_t size; @@ -76,9 +76,9 @@ text_wiarchive_impl::load(wchar_t *s) } #endif -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING template -BOOST_WARCHIVE_DECL(void) +AUTOBOOST_WARCHIVE_DECL(void) text_wiarchive_impl::load(std::wstring &ws) { std::size_t size; @@ -87,7 +87,7 @@ text_wiarchive_impl::load(std::wstring &ws) is.get(); // borland complains about resize // borland de-allocator fixup - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) if(NULL != ws.data()) #endif ws.resize(size); @@ -97,7 +97,7 @@ text_wiarchive_impl::load(std::wstring &ws) #endif template -BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) text_wiarchive_impl::text_wiarchive_impl( std::wistream & is, unsigned int flags @@ -115,4 +115,4 @@ text_wiarchive_impl::text_wiarchive_impl( } // archive } // boost -#endif // BOOST_NO_STD_WSTREAMBUF +#endif // AUTOBOOST_NO_STD_WSTREAMBUF diff --git a/contrib/autoboost/boost/archive/impl/text_woarchive_impl.ipp b/contrib/autoboost/autoboost/archive/impl/text_woarchive_impl.ipp similarity index 83% rename from contrib/autoboost/boost/archive/impl/text_woarchive_impl.ipp rename to contrib/autoboost/autoboost/archive/impl/text_woarchive_impl.ipp index fadce910b..abd8fa196 100644 --- a/contrib/autoboost/boost/archive/impl/text_woarchive_impl.ipp +++ b/contrib/autoboost/autoboost/archive/impl/text_woarchive_impl.ipp @@ -8,12 +8,12 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include -#ifndef BOOST_NO_STD_WSTREAMBUF +#include +#ifndef AUTOBOOST_NO_STD_WSTREAMBUF #include #include // size_t -#if defined(BOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__) namespace std{ using ::strlen; using ::size_t; @@ -22,7 +22,7 @@ namespace std{ #include -#include +#include namespace autoboost { namespace archive { @@ -31,7 +31,7 @@ namespace archive { // implementation of woarchive functions // template -BOOST_WARCHIVE_DECL(void) +AUTOBOOST_WARCHIVE_DECL(void) text_woarchive_impl::save(const char *s) { // note: superfluous local variable fixes borland warning @@ -43,7 +43,7 @@ text_woarchive_impl::save(const char *s) } template -BOOST_WARCHIVE_DECL(void) +AUTOBOOST_WARCHIVE_DECL(void) text_woarchive_impl::save(const std::string &s) { const std::size_t size = s.size(); @@ -54,9 +54,9 @@ text_woarchive_impl::save(const std::string &s) os.put(os.widen(*cptr++)); } -#ifndef BOOST_NO_INTRINSIC_WCHAR_T +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T template -BOOST_WARCHIVE_DECL(void) +AUTOBOOST_WARCHIVE_DECL(void) text_woarchive_impl::save(const wchar_t *ws) { const std::size_t size = std::wostream::traits_type::length(ws); @@ -66,9 +66,9 @@ text_woarchive_impl::save(const wchar_t *ws) } #endif -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING template -BOOST_WARCHIVE_DECL(void) +AUTOBOOST_WARCHIVE_DECL(void) text_woarchive_impl::save(const std::wstring &ws) { const std::size_t size = ws.length(); diff --git a/contrib/autoboost/boost/archive/impl/xml_iarchive_impl.ipp b/contrib/autoboost/autoboost/archive/impl/xml_iarchive_impl.ipp similarity index 75% rename from contrib/autoboost/boost/archive/impl/xml_iarchive_impl.ipp rename to contrib/autoboost/autoboost/archive/impl/xml_iarchive_impl.ipp index bec6cf568..485330c6a 100644 --- a/contrib/autoboost/boost/archive/impl/xml_iarchive_impl.ipp +++ b/contrib/autoboost/autoboost/archive/impl/xml_iarchive_impl.ipp @@ -8,35 +8,35 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include // memcpy #include // NULL -#if defined(BOOST_NO_STDC_NAMESPACE) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; } // namespace std #endif -#ifndef BOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_CWCHAR #include // mbtowc -#if defined(BOOST_NO_STDC_NAMESPACE) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::mbtowc; } // namespace std #endif -#endif // BOOST_NO_CWCHAR +#endif // AUTOBOOST_NO_CWCHAR -#include // RogueWave and Dinkumware -#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) -#include +#include // RogueWave and Dinkumware +#if AUTOBOOST_WORKAROUND(AUTOBOOST_DINKUMWARE_STDLIB, == 1) +#include #endif -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include "basic_xml_grammar.hpp" @@ -48,10 +48,10 @@ namespace archive { // wide char stuff used by char archives -#ifndef BOOST_NO_CWCHAR -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_STD_WSTRING template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) xml_iarchive_impl::load(std::wstring &ws){ std::string s; bool result = gimpl->parse_string(is, s); @@ -60,7 +60,7 @@ xml_iarchive_impl::load(std::wstring &ws){ xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) ); - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) if(NULL != ws.data()) #endif ws.resize(0); @@ -81,11 +81,11 @@ xml_iarchive_impl::load(std::wstring &ws){ ); } } -#endif // BOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_STD_WSTRING -#ifndef BOOST_NO_INTRINSIC_WCHAR_T +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) xml_iarchive_impl::load(wchar_t * ws){ std::string s; bool result = gimpl->parse_string(is, s); @@ -112,12 +112,12 @@ xml_iarchive_impl::load(wchar_t * ws){ } *ws = L'\0'; } -#endif // BOOST_NO_INTRINSIC_WCHAR_T +#endif // AUTOBOOST_NO_INTRINSIC_WCHAR_T -#endif // BOOST_NO_CWCHAR +#endif // AUTOBOOST_NO_CWCHAR template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) xml_iarchive_impl::load(std::string &s){ bool result = gimpl->parse_string(is, s); if(! result) @@ -127,7 +127,7 @@ xml_iarchive_impl::load(std::string &s){ } template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) xml_iarchive_impl::load(char * s){ std::string tstring; bool result = gimpl->parse_string(is, tstring); @@ -140,10 +140,10 @@ xml_iarchive_impl::load(char * s){ } template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) xml_iarchive_impl::load_override(class_name_type & t, int){ const std::string & s = gimpl->rv.class_name; - if(s.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1) + if(s.size() > AUTOBOOST_SERIALIZATION_MAX_KEY_SIZE - 1) autoboost::serialization::throw_exception( archive_exception(archive_exception::invalid_class_name) ); @@ -153,7 +153,7 @@ xml_iarchive_impl::load_override(class_name_type & t, int){ } template -BOOST_ARCHIVE_DECL(void) +AUTOBOOST_ARCHIVE_DECL(void) xml_iarchive_impl::init(){ gimpl->init(is); this->set_library_version( @@ -162,7 +162,7 @@ xml_iarchive_impl::init(){ } template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) xml_iarchive_impl::xml_iarchive_impl( std::istream &is_, unsigned int flags @@ -175,28 +175,28 @@ xml_iarchive_impl::xml_iarchive_impl( gimpl(new xml_grammar()) { if(0 == (flags & no_header)){ - BOOST_TRY{ + AUTOBOOST_TRY{ init(); } - BOOST_CATCH(...){ + AUTOBOOST_CATCH(...){ delete gimpl; - #ifndef BOOST_NO_EXCEPTIONS + #ifndef AUTOBOOST_NO_EXCEPTIONS throw; // re-throw #endif } - BOOST_CATCH_END + AUTOBOOST_CATCH_END } } template -BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) xml_iarchive_impl::~xml_iarchive_impl(){ if(0 == (this->get_flags() & no_header)){ - BOOST_TRY{ + AUTOBOOST_TRY{ gimpl->windup(is); } - BOOST_CATCH(...){} - BOOST_CATCH_END + AUTOBOOST_CATCH(...){} + AUTOBOOST_CATCH_END } delete gimpl; } diff --git a/contrib/autoboost/autoboost/archive/impl/xml_oarchive_impl.ipp b/contrib/autoboost/autoboost/archive/impl/xml_oarchive_impl.ipp new file mode 100644 index 000000000..fb7245174 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/impl/xml_oarchive_impl.ipp @@ -0,0 +1,117 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_oarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// 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) + +#include +#include +#include // std::copy +#include + +#include // strlen +#include // msvc 6.0 needs this to suppress warnings +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::strlen; +} // namespace std +#endif + +#include +#include + +#ifndef AUTOBOOST_NO_CWCHAR +#include +#include +#endif + +namespace autoboost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions specific to char archives + +// wide char stuff used by char archives +#ifndef AUTOBOOST_NO_CWCHAR +// copy chars to output escaping to xml and translating wide chars to mb chars +template +void save_iterator(std::ostream &os, InputIterator begin, InputIterator end){ + typedef autoboost::archive::iterators::mb_from_wchar< + autoboost::archive::iterators::xml_escape + > translator; + std::copy( + translator(AUTOBOOST_MAKE_PFTO_WRAPPER(begin)), + translator(AUTOBOOST_MAKE_PFTO_WRAPPER(end)), + autoboost::archive::iterators::ostream_iterator(os) + ); +} + +#ifndef AUTOBOOST_NO_STD_WSTRING +template +AUTOBOOST_ARCHIVE_DECL(void) +xml_oarchive_impl::save(const std::wstring & ws){ +// at least one library doesn't typedef value_type for strings +// so rather than using string directly make a pointer iterator out of it +// save_iterator(os, ws.data(), ws.data() + std::wcslen(ws.data())); + save_iterator(os, ws.data(), ws.data() + ws.size()); +} +#endif + +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T +template +AUTOBOOST_ARCHIVE_DECL(void) +xml_oarchive_impl::save(const wchar_t * ws){ + save_iterator(os, ws, ws + std::wcslen(ws)); +} +#endif + +#endif // AUTOBOOST_NO_CWCHAR + +template +AUTOBOOST_ARCHIVE_DECL(void) +xml_oarchive_impl::save(const std::string & s){ +// at least one library doesn't typedef value_type for strings +// so rather than using string directly make a pointer iterator out of it + typedef autoboost::archive::iterators::xml_escape< + const char * + > xml_escape_translator; + std::copy( + xml_escape_translator(AUTOBOOST_MAKE_PFTO_WRAPPER(s.data())), + xml_escape_translator(AUTOBOOST_MAKE_PFTO_WRAPPER(s.data()+ s.size())), + autoboost::archive::iterators::ostream_iterator(os) + ); +} + +template +AUTOBOOST_ARCHIVE_DECL(void) +xml_oarchive_impl::save(const char * s){ + typedef autoboost::archive::iterators::xml_escape< + const char * + > xml_escape_translator; + std::copy( + xml_escape_translator(AUTOBOOST_MAKE_PFTO_WRAPPER(s)), + xml_escape_translator(AUTOBOOST_MAKE_PFTO_WRAPPER(s + std::strlen(s))), + autoboost::archive::iterators::ostream_iterator(os) + ); +} + +template +AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) +xml_oarchive_impl::xml_oarchive_impl( + std::ostream & os_, + unsigned int flags +) : + basic_text_oprimitive( + os_, + 0 != (flags & no_codecvt) + ), + basic_xml_oarchive(flags) +{ + if(0 == (flags & no_header)) + this->init(); +} + +} // namespace archive +} // namespace autoboost diff --git a/contrib/autoboost/autoboost/archive/impl/xml_wiarchive_impl.ipp b/contrib/autoboost/autoboost/archive/impl/xml_wiarchive_impl.ipp new file mode 100644 index 000000000..201aec65a --- /dev/null +++ b/contrib/autoboost/autoboost/archive/impl/xml_wiarchive_impl.ipp @@ -0,0 +1,211 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_wiarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// 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 updates, documentation, and revision history. + +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; +} //std +#endif + +#include // msvc 6.0 needs this to suppress warnings +#ifndef AUTOBOOST_NO_STD_WSTREAMBUF + +#include +#include // std::copy + +#include // Dinkumware and RogueWave +#if AUTOBOOST_WORKAROUND(AUTOBOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include +#include +#include + +#include +#include +#ifndef AUTOBOOST_NO_CXX11_HDR_CODECVT + #include + namespace autoboost { namespace archive { namespace detail { + typedef std::codecvt_utf8 utf8_codecvt_facet; + } } } +#else + #include +#endif + +#include +#include + +#include +#include + +#include "basic_xml_grammar.hpp" + +namespace autoboost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions specific to wide char archives + +namespace { // anonymous + +void copy_to_ptr(char * s, const std::wstring & ws){ + std::copy( + iterators::mb_from_wchar( + AUTOBOOST_MAKE_PFTO_WRAPPER(ws.begin()) + ), + iterators::mb_from_wchar( + AUTOBOOST_MAKE_PFTO_WRAPPER(ws.end()) + ), + s + ); + s[ws.size()] = 0; +} + +} // anonymous + +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load(std::string & s){ + std::wstring ws; + bool result = gimpl->parse_string(is, ws); + if(! result) + autoboost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + #if AUTOBOOST_WORKAROUND(_RWSTD_VER, AUTOBOOST_TESTED_AT(20101)) + if(NULL != s.data()) + #endif + s.resize(0); + s.reserve(ws.size()); + std::copy( + iterators::mb_from_wchar( + AUTOBOOST_MAKE_PFTO_WRAPPER(ws.begin()) + ), + iterators::mb_from_wchar( + AUTOBOOST_MAKE_PFTO_WRAPPER(ws.end()) + ), + std::back_inserter(s) + ); +} + +#ifndef AUTOBOOST_NO_STD_WSTRING +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load(std::wstring & ws){ + bool result = gimpl->parse_string(is, ws); + if(! result) + autoboost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); +} +#endif + +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load(char * s){ + std::wstring ws; + bool result = gimpl->parse_string(is, ws); + if(! result) + autoboost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + copy_to_ptr(s, ws); +} + +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load(wchar_t * ws){ + std::wstring twstring; + bool result = gimpl->parse_string(is, twstring); + if(! result) + autoboost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + std::memcpy(ws, twstring.c_str(), twstring.size()); + ws[twstring.size()] = L'\0'; +} +#endif + +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load_override(class_name_type & t, int){ + const std::wstring & ws = gimpl->rv.class_name; + if(ws.size() > AUTOBOOST_SERIALIZATION_MAX_KEY_SIZE - 1) + autoboost::serialization::throw_exception( + archive_exception(archive_exception::invalid_class_name) + ); + copy_to_ptr(t, ws); +} + +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::init(){ + gimpl->init(is); + this->set_library_version( + library_version_type(gimpl->rv.version) + ); +} + +template +AUTOBOOST_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) +xml_wiarchive_impl::xml_wiarchive_impl( + std::wistream &is_, + unsigned int flags +) : + basic_text_iprimitive( + is_, + true // don't change the codecvt - use the one below + ), + basic_xml_iarchive(flags), + gimpl(new xml_wgrammar()) +{ + if(0 == (flags & no_codecvt)){ + archive_locale.reset( + add_facet( + is_.getloc(), + new autoboost::archive::detail::utf8_codecvt_facet + ) + ); + is.imbue(* archive_locale); + } + if(0 == (flags & no_header)){ + AUTOBOOST_TRY{ + this->init(); + } + AUTOBOOST_CATCH(...){ + delete gimpl; + #ifndef AUTOBOOST_NO_EXCEPTIONS + throw; // re-throw + #endif + } + AUTOBOOST_CATCH_END + } +} + +template +AUTOBOOST_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) +xml_wiarchive_impl::~xml_wiarchive_impl(){ + if(0 == (this->get_flags() & no_header)){ + AUTOBOOST_TRY{ + gimpl->windup(is); + } + AUTOBOOST_CATCH(...){} + AUTOBOOST_CATCH_END + } + delete gimpl; +} + +} // namespace archive +} // namespace autoboost + +#endif // AUTOBOOST_NO_STD_WSTREAMBUF diff --git a/contrib/autoboost/autoboost/archive/impl/xml_woarchive_impl.ipp b/contrib/autoboost/autoboost/archive/impl/xml_woarchive_impl.ipp new file mode 100644 index 000000000..5263ae060 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/impl/xml_woarchive_impl.ipp @@ -0,0 +1,167 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_woarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// 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) + +#include +#ifndef AUTOBOOST_NO_STD_WSTREAMBUF + +#include +#include +#include // std::copy +#include + +#include // strlen +#include // mbtowc +#include // wcslen + +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::strlen; + #if ! defined(AUTOBOOST_NO_INTRINSIC_WCHAR_T) + using ::mbtowc; + using ::wcslen; + #endif +} // namespace std +#endif + +#include +#include + +#include +#include +#include +#include + +#include +#ifndef AUTOBOOST_NO_CXX11_HDR_CODECVT + #include + namespace autoboost { namespace archive { namespace detail { + typedef std::codecvt_utf8 utf8_codecvt_facet; + } } } +#else + #include +#endif + +namespace autoboost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions specific to wide char archives + +// copy chars to output escaping to xml and widening characters as we go +template +void save_iterator(std::wostream &os, InputIterator begin, InputIterator end){ + typedef iterators::wchar_from_mb< + iterators::xml_escape + > xmbtows; + std::copy( + xmbtows(AUTOBOOST_MAKE_PFTO_WRAPPER(begin)), + xmbtows(AUTOBOOST_MAKE_PFTO_WRAPPER(end)), + autoboost::archive::iterators::ostream_iterator(os) + ); +} + +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_woarchive_impl::save(const std::string & s){ + // note: we don't use s.begin() and s.end() because dinkumware + // doesn't have string::value_type defined. So use a wrapper + // around these values to implement the definitions. + const char * begin = s.data(); + const char * end = begin + s.size(); + save_iterator(os, begin, end); +} + +#ifndef AUTOBOOST_NO_STD_WSTRING +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_woarchive_impl::save(const std::wstring & ws){ +#if 0 + typedef iterators::xml_escape xmbtows; + std::copy( + xmbtows(AUTOBOOST_MAKE_PFTO_WRAPPER(ws.begin())), + xmbtows(AUTOBOOST_MAKE_PFTO_WRAPPER(ws.end())), + autoboost::archive::iterators::ostream_iterator(os) + ); +#endif + typedef iterators::xml_escape xmbtows; + std::copy( + xmbtows(AUTOBOOST_MAKE_PFTO_WRAPPER(ws.data())), + xmbtows(AUTOBOOST_MAKE_PFTO_WRAPPER(ws.data() + ws.size())), + autoboost::archive::iterators::ostream_iterator(os) + ); +} +#endif //AUTOBOOST_NO_STD_WSTRING + +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_woarchive_impl::save(const char * s){ + save_iterator(os, s, s + std::strlen(s)); +} + +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T +template +AUTOBOOST_WARCHIVE_DECL(void) +xml_woarchive_impl::save(const wchar_t * ws){ + os << ws; + typedef iterators::xml_escape xmbtows; + std::copy( + xmbtows(AUTOBOOST_MAKE_PFTO_WRAPPER(ws)), + xmbtows(AUTOBOOST_MAKE_PFTO_WRAPPER(ws + std::wcslen(ws))), + autoboost::archive::iterators::ostream_iterator(os) + ); +} +#endif + +template +AUTOBOOST_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) +xml_woarchive_impl::xml_woarchive_impl( + std::wostream & os_, + unsigned int flags +) : + basic_text_oprimitive( + os_, + true // don't change the codecvt - use the one below + ), + basic_xml_oarchive(flags) +{ + // Standard behavior is that imbue can be called + // a) before output is invoked or + // b) after flush has been called. This prevents one-to-many + // transforms (such as one to many transforms from getting + // mixed up. + if(0 == (flags & no_codecvt)){ + autoboost::archive::detail::utf8_codecvt_facet *pfacet; + #if defined(__SGI_STL_PORT) + // Unfortunately, STLPort doesn't respect b) above + // so the restoration of the original archive locale done by + // the locale_saver doesn't get processed, + // before the current one is destroyed. + // so the codecvt doesn't get replaced with the orginal + // so closing the stream invokes codecvt::do_unshift + // so it crashes because the corresponding locale that contained + // the codecvt isn't around any more. + // we can hack around this by using a static codecvt that never + // gets destroyed. + static autoboost::archive::detail::utf8_codecvt_facet + facet(static_cast(1)); + pfacet = & facet; + #else + pfacet = new autoboost::archive::detail::utf8_codecvt_facet; + #endif + archive_locale.reset(add_facet(os_.getloc(), pfacet)); + os.imbue(* archive_locale); + } + if(0 == (flags & no_header)) + this->init(); +} + +} // namespace archive +} // namespace autoboost + +#endif //AUTOBOOST_NO_STD_WSTREAMBUF diff --git a/contrib/autoboost/boost/archive/iterators/base64_from_binary.hpp b/contrib/autoboost/autoboost/archive/iterators/base64_from_binary.hpp similarity index 82% rename from contrib/autoboost/boost/archive/iterators/base64_from_binary.hpp rename to contrib/autoboost/autoboost/archive/iterators/base64_from_binary.hpp index 08a811935..50a752ac9 100644 --- a/contrib/autoboost/boost/archive/iterators/base64_from_binary.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/base64_from_binary.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP -#define BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,19 +16,19 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include // size_t -#if defined(BOOST_NO_STDC_NAMESPACE) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif -#include +#include -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -48,7 +48,7 @@ struct from_6_bit { "abcdefghijklmnopqrstuvwxyz" "0123456789" "+/"; - BOOST_ASSERT(t < 64); + AUTOBOOST_ASSERT(t < 64); return lookup_table[static_cast(t)]; } }; @@ -88,9 +88,9 @@ class base64_from_binary : public: // make composible buy using templated constructor template - base64_from_binary(BOOST_PFTO_WRAPPER(T) start) : + base64_from_binary(AUTOBOOST_PFTO_WRAPPER(T) start) : super_t( - Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), + Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), detail::from_6_bit() ) {} @@ -108,4 +108,4 @@ class base64_from_binary : } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP diff --git a/contrib/autoboost/boost/archive/iterators/binary_from_base64.hpp b/contrib/autoboost/autoboost/archive/iterators/binary_from_base64.hpp similarity index 83% rename from contrib/autoboost/boost/archive/iterators/binary_from_base64.hpp rename to contrib/autoboost/autoboost/archive/iterators/binary_from_base64.hpp index 65ba893fe..19c81a522 100644 --- a/contrib/autoboost/boost/archive/iterators/binary_from_base64.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/binary_from_base64.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP -#define BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,14 +16,14 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -50,7 +50,7 @@ struct to_6_bit { }; // metrowerks trips this assertion - how come? #if ! defined(__MWERKS__) - BOOST_STATIC_ASSERT(128 == sizeof(lookup_table)); + AUTOBOOST_STATIC_ASSERT(128 == sizeof(lookup_table)); #endif signed char value = -1; if((unsigned)t <= 127) @@ -96,9 +96,9 @@ class binary_from_base64 : public public: // make composible buy using templated constructor template - binary_from_base64(BOOST_PFTO_WRAPPER(T) start) : + binary_from_base64(AUTOBOOST_PFTO_WRAPPER(T) start) : super_t( - Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), + Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), detail::to_6_bit() ) {} @@ -116,4 +116,4 @@ class binary_from_base64 : public } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP diff --git a/contrib/autoboost/boost/archive/iterators/dataflow_exception.hpp b/contrib/autoboost/autoboost/archive/iterators/dataflow_exception.hpp similarity index 85% rename from contrib/autoboost/boost/archive/iterators/dataflow_exception.hpp rename to contrib/autoboost/autoboost/archive/iterators/dataflow_exception.hpp index 640578aeb..4a26e8890 100644 --- a/contrib/autoboost/boost/archive/iterators/dataflow_exception.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/dataflow_exception.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP -#define BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,12 +16,12 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include -#ifndef BOOST_NO_EXCEPTIONS +#include +#ifndef AUTOBOOST_NO_EXCEPTIONS #include -#endif //BOOST_NO_EXCEPTIONS +#endif //AUTOBOOST_NO_EXCEPTIONS -#include +#include namespace autoboost { namespace archive { @@ -66,7 +66,7 @@ class dataflow_exception : public std::exception msg = "invalid multbyte/wide char conversion"; break; default: - BOOST_ASSERT(false); + AUTOBOOST_ASSERT(false); break; } return msg; @@ -77,4 +77,4 @@ class dataflow_exception : public std::exception } // namespace archive } // namespace autoboost -#endif //BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP +#endif //AUTOBOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP diff --git a/contrib/autoboost/boost/archive/iterators/escape.hpp b/contrib/autoboost/autoboost/archive/iterators/escape.hpp similarity index 91% rename from contrib/autoboost/boost/archive/iterators/escape.hpp rename to contrib/autoboost/autoboost/archive/iterators/escape.hpp index cb68aee3c..2a2e0ffa0 100644 --- a/contrib/autoboost/boost/archive/iterators/escape.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/escape.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP -#define BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_ESCAPE_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_ESCAPE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,11 +16,11 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include // NULL -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -111,4 +111,4 @@ class escape : } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_ESCAPE_HPP diff --git a/contrib/autoboost/boost/archive/iterators/insert_linebreaks.hpp b/contrib/autoboost/autoboost/archive/iterators/insert_linebreaks.hpp similarity index 80% rename from contrib/autoboost/boost/archive/iterators/insert_linebreaks.hpp rename to contrib/autoboost/autoboost/archive/iterators/insert_linebreaks.hpp index 0a2b06691..721abb8b2 100644 --- a/contrib/autoboost/boost/archive/iterators/insert_linebreaks.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/insert_linebreaks.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP -#define BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,17 +16,17 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; } #endif -#include +#include -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -83,8 +83,8 @@ class insert_linebreaks : public: // make composible buy using templated constructor template - insert_linebreaks(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + insert_linebreaks(AUTOBOOST_PFTO_WRAPPER(T) start) : + super_t(Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), m_count(0) {} // intel 7.1 doesn't like default copy constructor @@ -98,4 +98,4 @@ class insert_linebreaks : } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP diff --git a/contrib/autoboost/boost/archive/iterators/istream_iterator.hpp b/contrib/autoboost/autoboost/archive/iterators/istream_iterator.hpp similarity index 92% rename from contrib/autoboost/boost/archive/iterators/istream_iterator.hpp rename to contrib/autoboost/autoboost/archive/iterators/istream_iterator.hpp index 877effe85..7c47c49f5 100644 --- a/contrib/autoboost/boost/archive/iterators/istream_iterator.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/istream_iterator.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP -#define BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -23,7 +23,7 @@ #include // NULL #include -#include +#include namespace autoboost { namespace archive { @@ -104,4 +104,4 @@ class istream_iterator : } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP diff --git a/contrib/autoboost/boost/archive/iterators/mb_from_wchar.hpp b/contrib/autoboost/autoboost/archive/iterators/mb_from_wchar.hpp similarity index 83% rename from contrib/autoboost/boost/archive/iterators/mb_from_wchar.hpp rename to contrib/autoboost/autoboost/archive/iterators/mb_from_wchar.hpp index d7e04ba96..1857d9326 100644 --- a/contrib/autoboost/boost/archive/iterators/mb_from_wchar.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/mb_from_wchar.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP -#define BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,20 +16,20 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include // size_t #include // for wctomb() -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; using ::wctomb; } // namespace std #endif -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -90,9 +90,9 @@ class mb_from_wchar #else m_bend = std::wctomb(m_buffer, value); #endif - BOOST_ASSERT(-1 != m_bend); - BOOST_ASSERT((std::size_t)m_bend <= sizeof(m_buffer)); - BOOST_ASSERT(m_bend > 0); + AUTOBOOST_ASSERT(-1 != m_bend); + AUTOBOOST_ASSERT((std::size_t)m_bend <= sizeof(m_buffer)); + AUTOBOOST_ASSERT(m_bend > 0); m_bnext = 0; } @@ -114,8 +114,8 @@ class mb_from_wchar public: // make composible buy using templated constructor template - mb_from_wchar(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + mb_from_wchar(AUTOBOOST_PFTO_WRAPPER(T) start) : + super_t(Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), m_bend(0), m_bnext(0), m_full(false) @@ -133,4 +133,4 @@ class mb_from_wchar } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP diff --git a/contrib/autoboost/boost/archive/iterators/ostream_iterator.hpp b/contrib/autoboost/autoboost/archive/iterators/ostream_iterator.hpp similarity index 90% rename from contrib/autoboost/boost/archive/iterators/ostream_iterator.hpp rename to contrib/autoboost/autoboost/archive/iterators/ostream_iterator.hpp index 1c724a493..8b3ed3909 100644 --- a/contrib/autoboost/boost/archive/iterators/ostream_iterator.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/ostream_iterator.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP -#define BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -22,7 +22,7 @@ // type but rather a synonym for some integer type. #include -#include +#include namespace autoboost { namespace archive { @@ -80,4 +80,4 @@ class ostream_iterator : } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP diff --git a/contrib/autoboost/boost/archive/iterators/remove_whitespace.hpp b/contrib/autoboost/autoboost/archive/iterators/remove_whitespace.hpp similarity index 85% rename from contrib/autoboost/boost/archive/iterators/remove_whitespace.hpp rename to contrib/autoboost/autoboost/archive/iterators/remove_whitespace.hpp index 333d432f1..1b0417b56 100644 --- a/contrib/autoboost/boost/archive/iterators/remove_whitespace.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/remove_whitespace.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP -#define BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,13 +16,13 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include -#include +#include -#include -#include -#include +#include +#include +#include // here is the default standard implementation of the functor used // by the filter iterator to remove spaces. Unfortunately usage @@ -30,15 +30,15 @@ // VC 6.5. The only way I can find to work around it is to // implement a special non-standard version for this platform -#ifndef BOOST_NO_CWCTYPE +#ifndef AUTOBOOST_NO_CWCTYPE #include // iswspace -#if defined(BOOST_NO_STDC_NAMESPACE) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::iswspace; } #endif #endif #include // isspace -#if defined(BOOST_NO_STDC_NAMESPACE) +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::isspace; } #endif @@ -61,7 +61,7 @@ struct remove_whitespace_predicate } }; -#ifndef BOOST_NO_CWCHAR +#ifndef AUTOBOOST_NO_CWCHAR template<> struct remove_whitespace_predicate { @@ -153,8 +153,8 @@ class remove_whitespace : // remove_whitespace(){} // why is this needed? // make composible buy using templated constructor template - remove_whitespace(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + remove_whitespace(AUTOBOOST_PFTO_WRAPPER(T) start) : + super_t(Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) {} // intel 7.1 doesn't like default copy constructor remove_whitespace(const remove_whitespace & rhs) : @@ -166,4 +166,4 @@ class remove_whitespace : } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP diff --git a/contrib/autoboost/boost/archive/iterators/transform_width.hpp b/contrib/autoboost/autoboost/archive/iterators/transform_width.hpp similarity index 92% rename from contrib/autoboost/boost/archive/iterators/transform_width.hpp rename to contrib/autoboost/autoboost/archive/iterators/transform_width.hpp index bd125a326..80d4d278b 100644 --- a/contrib/autoboost/boost/archive/iterators/transform_width.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/transform_width.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP -#define BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -24,10 +24,10 @@ // character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters // or 3 8 bit characters -#include +#include -#include -#include +#include +#include #include // std::min @@ -110,8 +110,8 @@ class transform_width : public: // make composible buy using templated constructor template - transform_width(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + transform_width(AUTOBOOST_PFTO_WRAPPER(T) start) : + super_t(Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), m_buffer_out_full(false), // To disable GCC warning, but not truly necessary //(m_buffer_in will be initialized later before being @@ -174,4 +174,4 @@ void transform_width::fill() { } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP diff --git a/contrib/autoboost/boost/archive/iterators/unescape.hpp b/contrib/autoboost/autoboost/archive/iterators/unescape.hpp similarity index 88% rename from contrib/autoboost/boost/archive/iterators/unescape.hpp rename to contrib/autoboost/autoboost/archive/iterators/unescape.hpp index d4d0fa9a7..7a6d22396 100644 --- a/contrib/autoboost/boost/archive/iterators/unescape.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/unescape.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP -#define BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,10 +16,10 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -86,4 +86,4 @@ class unescape } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP diff --git a/contrib/autoboost/boost/archive/iterators/wchar_from_mb.hpp b/contrib/autoboost/autoboost/archive/iterators/wchar_from_mb.hpp similarity index 82% rename from contrib/autoboost/boost/archive/iterators/wchar_from_mb.hpp rename to contrib/autoboost/autoboost/archive/iterators/wchar_from_mb.hpp index 1b710ac43..cc88415ff 100644 --- a/contrib/autoboost/boost/archive/iterators/wchar_from_mb.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/wchar_from_mb.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP -#define BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,24 +16,24 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include #include // size_t #include // mblen -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::mblen; using ::mbtowc; } // namespace std #endif -#include -#include +#include +#include -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -89,8 +89,8 @@ class wchar_from_mb public: // make composible buy using templated constructor template - wchar_from_mb(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + wchar_from_mb(AUTOBOOST_PFTO_WRAPPER(T) start) : + super_t(Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), m_full(false) {} // intel 7.1 doesn't like default copy constructor @@ -126,4 +126,4 @@ wchar_t wchar_from_mb::drain(){ } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP diff --git a/contrib/autoboost/boost/archive/iterators/xml_escape.hpp b/contrib/autoboost/autoboost/archive/iterators/xml_escape.hpp similarity index 86% rename from contrib/autoboost/boost/archive/iterators/xml_escape.hpp rename to contrib/autoboost/autoboost/archive/iterators/xml_escape.hpp index d87f745bd..2b2805207 100644 --- a/contrib/autoboost/boost/archive/iterators/xml_escape.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/xml_escape.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP -#define BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,9 +16,9 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include -#include -#include +#include +#include +#include namespace autoboost { namespace archive { @@ -40,8 +40,8 @@ class xml_escape wchar_t fill(const wchar_t * & bstart, const wchar_t * & bend); template - xml_escape(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + xml_escape(AUTOBOOST_PFTO_WRAPPER(T) start) : + super_t(Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) {} // intel 7.1 doesn't like default copy constructor xml_escape(const xml_escape & rhs) : @@ -119,4 +119,4 @@ wchar_t xml_escape::fill( } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP diff --git a/contrib/autoboost/boost/archive/iterators/xml_unescape.hpp b/contrib/autoboost/autoboost/archive/iterators/xml_unescape.hpp similarity index 84% rename from contrib/autoboost/boost/archive/iterators/xml_unescape.hpp rename to contrib/autoboost/autoboost/archive/iterators/xml_unescape.hpp index 574fab26d..dd36cdbf6 100644 --- a/contrib/autoboost/boost/archive/iterators/xml_unescape.hpp +++ b/contrib/autoboost/autoboost/archive/iterators/xml_unescape.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP -#define BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP +#ifndef AUTOBOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP +#define AUTOBOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -16,13 +16,13 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include -#include -#include +#include +#include -#include -#include +#include +#include namespace autoboost { namespace archive { @@ -44,7 +44,7 @@ class xml_unescape } public: // workaround msvc 7.1 ICU crash - #if defined(BOOST_MSVC) + #if defined(AUTOBOOST_MSVC) typedef int value_type; #else typedef typename this_t::value_type value_type; @@ -54,8 +54,8 @@ class xml_unescape value_type drain(); template - xml_unescape(BOOST_PFTO_WRAPPER(T) start) : - super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + xml_unescape(AUTOBOOST_PFTO_WRAPPER(T) start) : + super_t(Base(AUTOBOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) {} // intel 7.1 doesn't like default copy constructor xml_unescape(const xml_unescape & rhs) : @@ -123,4 +123,4 @@ xml_unescape::drain(){ } // namespace archive } // namespace autoboost -#endif // BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP +#endif // AUTOBOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP diff --git a/contrib/autoboost/boost/archive/polymorphic_iarchive.hpp b/contrib/autoboost/autoboost/archive/polymorphic_iarchive.hpp similarity index 76% rename from contrib/autoboost/boost/archive/polymorphic_iarchive.hpp rename to contrib/autoboost/autoboost/archive/polymorphic_iarchive.hpp index 63308070a..56f5b71dc 100644 --- a/contrib/autoboost/boost/archive/polymorphic_iarchive.hpp +++ b/contrib/autoboost/autoboost/archive/polymorphic_iarchive.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP -#define BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP +#ifndef AUTOBOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) @@ -20,23 +20,23 @@ #include // ULONG_MAX #include -#include -#if defined(BOOST_NO_STDC_NAMESPACE) +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include // must be the last header +#include +#include // must be the last header namespace autoboost { namespace serialization { @@ -44,8 +44,8 @@ namespace serialization { } // namespace serialization namespace archive { namespace detail { - class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; - class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; + class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_iarchive; + class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_iarchive; } class polymorphic_iarchive; @@ -53,7 +53,7 @@ class polymorphic_iarchive; class polymorphic_iarchive_impl : public detail::interface_iarchive { -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else friend class detail::interface_iarchive; @@ -65,8 +65,8 @@ class polymorphic_iarchive_impl : virtual void load(char & t) = 0; virtual void load(signed char & t) = 0; virtual void load(unsigned char & t) = 0; - #ifndef BOOST_NO_CWCHAR - #ifndef BOOST_NO_INTRINSIC_WCHAR_T + #ifndef AUTOBOOST_NO_CWCHAR + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T virtual void load(wchar_t & t) = 0; #endif #endif @@ -77,10 +77,10 @@ class polymorphic_iarchive_impl : virtual void load(long & t) = 0; virtual void load(unsigned long & t) = 0; - #if defined(BOOST_HAS_LONG_LONG) + #if defined(AUTOBOOST_HAS_LONG_LONG) virtual void load(autoboost::long_long_type & t) = 0; virtual void load(autoboost::ulong_long_type & t) = 0; - #elif defined(BOOST_HAS_MS_INT64) + #elif defined(AUTOBOOST_HAS_MS_INT64) virtual void load(__int64 & t) = 0; virtual void load(unsigned __int64 & t) = 0; #endif @@ -90,7 +90,7 @@ class polymorphic_iarchive_impl : // string types are treated as primitives virtual void load(std::string & t) = 0; - #ifndef BOOST_NO_STD_WSTRING + #ifndef AUTOBOOST_NO_STD_WSTRING virtual void load(std::wstring & t) = 0; #endif @@ -102,14 +102,14 @@ class polymorphic_iarchive_impl : // msvc and borland won't automatically pass these to the base class so // make it explicit here template - void load_override(T & t, BOOST_PFTO int) + void load_override(T & t, AUTOBOOST_PFTO int) { archive::load(* this->This(), t); } // special treatment for name-value pairs. template void load_override( - #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + #ifndef AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING const #endif autoboost::serialization::nvp< T > & t, @@ -151,7 +151,7 @@ class polymorphic_iarchive_impl : } // namespace archive } // namespace autoboost -#include // pops abi_suffix.hpp pragmas +#include // pops abi_suffix.hpp pragmas namespace autoboost { namespace archive { @@ -167,6 +167,6 @@ class polymorphic_iarchive : } // namespace autoboost // required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::polymorphic_iarchive) +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::polymorphic_iarchive) -#endif // BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP +#endif // AUTOBOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/polymorphic_oarchive.hpp b/contrib/autoboost/autoboost/archive/polymorphic_oarchive.hpp new file mode 100644 index 000000000..2b6999fb5 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/polymorphic_oarchive.hpp @@ -0,0 +1,157 @@ +#ifndef AUTOBOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_oarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include // size_t +#include // ULONG_MAX +#include + +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include // must be the last header + +namespace autoboost { +namespace serialization { + class extended_type_info; +} // namespace serialization +namespace archive { +namespace detail { + class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_oarchive; + class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) basic_oserializer; +} + +class polymorphic_oarchive; + +class polymorphic_oarchive_impl : + public detail::interface_oarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_oarchive; + friend class save_access; +#endif + // primitive types the only ones permitted by polymorphic archives + virtual void save(const bool t) = 0; + + virtual void save(const char t) = 0; + virtual void save(const signed char t) = 0; + virtual void save(const unsigned char t) = 0; + #ifndef AUTOBOOST_NO_CWCHAR + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + virtual void save(const wchar_t t) = 0; + #endif + #endif + virtual void save(const short t) = 0; + virtual void save(const unsigned short t) = 0; + virtual void save(const int t) = 0; + virtual void save(const unsigned int t) = 0; + virtual void save(const long t) = 0; + virtual void save(const unsigned long t) = 0; + + #if defined(AUTOBOOST_HAS_LONG_LONG) + virtual void save(const autoboost::long_long_type t) = 0; + virtual void save(const autoboost::ulong_long_type t) = 0; + #elif defined(AUTOBOOST_HAS_MS_INT64) + virtual void save(const __int64 t) = 0; + virtual void save(const unsigned __int64 t) = 0; + #endif + + virtual void save(const float t) = 0; + virtual void save(const double t) = 0; + + // string types are treated as primitives + virtual void save(const std::string & t) = 0; + #ifndef AUTOBOOST_NO_STD_WSTRING + virtual void save(const std::wstring & t) = 0; + #endif + + virtual void save_null_pointer() = 0; + // used for xml and other tagged formats + virtual void save_start(const char * name) = 0; + virtual void save_end(const char * name) = 0; + virtual void register_basic_serializer(const detail::basic_oserializer & bos) = 0; + + virtual void end_preamble() = 0; + + // msvc and borland won't automatically pass these to the base class so + // make it explicit here + template + void save_override(T & t, AUTOBOOST_PFTO int) + { + archive::save(* this->This(), t); + } + // special treatment for name-value pairs. + template + void save_override( + #ifndef AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + ::autoboost::serialization::nvp< T > & t, int + ){ + save_start(t.name()); + archive::save(* this->This(), t.const_value()); + save_end(t.name()); + } +protected: + virtual ~polymorphic_oarchive_impl(){}; +public: + // utility functions implemented by all legal archives + virtual unsigned int get_flags() const = 0; + virtual library_version_type get_library_version() const = 0; + virtual void save_binary(const void * t, std::size_t size) = 0; + + virtual void save_object( + const void *x, + const detail::basic_oserializer & bos + ) = 0; + virtual void save_pointer( + const void * t, + const detail::basic_pointer_oserializer * bpos_ptr + ) = 0; +}; + +// note: preserve naming symmetry +class polymorphic_oarchive : + public polymorphic_oarchive_impl +{ +public: + virtual ~polymorphic_oarchive(){}; +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::polymorphic_oarchive) + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/text_iarchive.hpp b/contrib/autoboost/autoboost/archive/text_iarchive.hpp new file mode 100644 index 000000000..a83edea6b --- /dev/null +++ b/contrib/autoboost/autoboost/archive/text_iarchive.hpp @@ -0,0 +1,142 @@ +#ifndef AUTOBOOST_ARCHIVE_TEXT_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_TEXT_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_iarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include + +#include +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_iarchive; +} // namespace detail + +template +class text_iarchive_impl : + public basic_text_iprimitive, + public basic_text_iarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class load_access; + #endif +#endif + template + void load(T & t){ + basic_text_iprimitive::load(t); + } + void load(version_type & t){ + unsigned int v; + load(v); + t = version_type(v); + } + void load(autoboost::serialization::item_version_type & t){ + unsigned int v; + load(v); + t = autoboost::serialization::item_version_type(v); + } + AUTOBOOST_ARCHIVE_DECL(void) + load(char * t); + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + AUTOBOOST_ARCHIVE_DECL(void) + load(wchar_t * t); + #endif + AUTOBOOST_ARCHIVE_DECL(void) + load(std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_ARCHIVE_DECL(void) + load(std::wstring &ws); + #endif + // note: the following should not needed - but one compiler (vc 7.1) + // fails to compile one test (test_shared_ptr) without it !!! + // make this protected so it can be called from a derived archive + template + void load_override(T & t, AUTOBOOST_PFTO int){ + basic_text_iarchive::load_override(t, 0); + } + AUTOBOOST_ARCHIVE_DECL(void) + load_override(class_name_type & t, int); + AUTOBOOST_ARCHIVE_DECL(void) + init(); + AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + text_iarchive_impl(std::istream & is, unsigned int flags); + // don't import inline definitions! leave this as a reminder. + //AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~text_iarchive_impl(){}; +}; + +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +class text_iarchive : + public text_iarchive_impl{ +public: + text_iarchive(std::istream & is_, unsigned int flags = 0) : + // note: added _ to suppress useless gcc warning + text_iarchive_impl(is_, flags) + {} + ~text_iarchive(){} +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::text_iarchive) + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#endif // AUTOBOOST_ARCHIVE_TEXT_IARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/text_oarchive.hpp b/contrib/autoboost/autoboost/archive/text_oarchive.hpp new file mode 100644 index 000000000..46a9b4fbc --- /dev/null +++ b/contrib/autoboost/autoboost/archive/text_oarchive.hpp @@ -0,0 +1,129 @@ +#ifndef AUTOBOOST_ARCHIVE_TEXT_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_TEXT_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_oarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include +#include // std::size_t + +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_oarchive; +} // namespace detail + +template +class text_oarchive_impl : + /* protected ? */ public basic_text_oprimitive, + public basic_text_oarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_text_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_text_oarchive; + friend class save_access; + #endif +#endif + template + void save(const T & t){ + this->newtoken(); + basic_text_oprimitive::save(t); + } + void save(const version_type & t){ + save(static_cast(t)); + } + void save(const autoboost::serialization::item_version_type & t){ + save(static_cast(t)); + } + AUTOBOOST_ARCHIVE_DECL(void) + save(const char * t); + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + AUTOBOOST_ARCHIVE_DECL(void) + save(const wchar_t * t); + #endif + AUTOBOOST_ARCHIVE_DECL(void) + save(const std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_ARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + text_oarchive_impl(std::ostream & os, unsigned int flags); + // don't import inline definitions! leave this as a reminder. + //AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~text_oarchive_impl(){}; +public: + AUTOBOOST_ARCHIVE_DECL(void) + save_binary(const void *address, std::size_t count); +}; + +// do not derive from this class. If you want to extend this functionality +// via inhertance, derived from text_oarchive_impl instead. This will +// preserve correct static polymorphism. +class text_oarchive : + public text_oarchive_impl +{ +public: + text_oarchive(std::ostream & os_, unsigned int flags = 0) : + // note: added _ to suppress useless gcc warning + text_oarchive_impl(os_, flags) + {} + ~text_oarchive(){} +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::text_oarchive) + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_TEXT_OARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/text_wiarchive.hpp b/contrib/autoboost/autoboost/archive/text_wiarchive.hpp new file mode 100644 index 000000000..828cfb085 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/text_wiarchive.hpp @@ -0,0 +1,139 @@ +#ifndef AUTOBOOST_ARCHIVE_TEXT_WIARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_TEXT_WIARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_wiarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include +#ifdef AUTOBOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_iarchive; +} // namespace detail + +template +class text_wiarchive_impl : + public basic_text_iprimitive, + public basic_text_iarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class load_access; + #endif +#endif + template + void load(T & t){ + basic_text_iprimitive::load(t); + } + void load(version_type & t){ + unsigned int v; + load(v); + t = version_type(v); + } + void load(autoboost::serialization::item_version_type & t){ + unsigned int v; + load(v); + t = autoboost::serialization::item_version_type(v); + } + AUTOBOOST_WARCHIVE_DECL(void) + load(char * t); + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + AUTOBOOST_WARCHIVE_DECL(void) + load(wchar_t * t); + #endif + AUTOBOOST_WARCHIVE_DECL(void) + load(std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_WARCHIVE_DECL(void) + load(std::wstring &ws); + #endif + // note: the following should not needed - but one compiler (vc 7.1) + // fails to compile one test (test_shared_ptr) without it !!! + template + void load_override(T & t, AUTOBOOST_PFTO int){ + basic_text_iarchive::load_override(t, 0); + } + AUTOBOOST_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + text_wiarchive_impl(std::wistream & is, unsigned int flags); + ~text_wiarchive_impl(){}; +}; + +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +class text_wiarchive : + public text_wiarchive_impl{ +public: + text_wiarchive(std::wistream & is, unsigned int flags = 0) : + text_wiarchive_impl(is, flags) + {} + ~text_wiarchive(){} +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::text_wiarchive) + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#endif // AUTOBOOST_NO_STD_WSTREAMBUF +#endif // AUTOBOOST_ARCHIVE_TEXT_WIARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/text_woarchive.hpp b/contrib/autoboost/autoboost/archive/text_woarchive.hpp new file mode 100644 index 000000000..efee071f8 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/text_woarchive.hpp @@ -0,0 +1,155 @@ +#ifndef AUTOBOOST_ARCHIVE_TEXT_WOARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_TEXT_WOARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_woarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include + +#ifdef AUTOBOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include +#include // size_t + +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_oarchive; +} // namespace detail + +template +class text_woarchive_impl : + public basic_text_oprimitive, + public basic_text_oarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_text_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_text_oarchive; + friend class save_access; + #endif +#endif + template + void save(const T & t){ + this->newtoken(); + basic_text_oprimitive::save(t); + } + void save(const version_type & t){ + save(static_cast(t)); + } + void save(const autoboost::serialization::item_version_type & t){ + save(static_cast(t)); + } + AUTOBOOST_WARCHIVE_DECL(void) + save(const char * t); + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + AUTOBOOST_WARCHIVE_DECL(void) + save(const wchar_t * t); + #endif + AUTOBOOST_WARCHIVE_DECL(void) + save(const std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_WARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + text_woarchive_impl(std::wostream & os, unsigned int flags) : + basic_text_oprimitive( + os, + 0 != (flags & no_codecvt) + ), + basic_text_oarchive(flags) + { + if(0 == (flags & no_header)) + basic_text_oarchive::init(); + } +public: + void save_binary(const void *address, std::size_t count){ + put(static_cast('\n')); + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + put(static_cast('\n')); + this->delimiter = this->none; + } + +}; + +// we use the following because we can't use +// typedef text_oarchive_impl > text_oarchive; + +// do not derive from this class. If you want to extend this functionality +// via inhertance, derived from text_oarchive_impl instead. This will +// preserve correct static polymorphism. +class text_woarchive : + public text_woarchive_impl +{ +public: + text_woarchive(std::wostream & os, unsigned int flags = 0) : + text_woarchive_impl(os, flags) + {} + ~text_woarchive(){} +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::text_woarchive) + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_NO_STD_WSTREAMBUF +#endif // AUTOBOOST_ARCHIVE_TEXT_WOARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/wcslen.hpp b/contrib/autoboost/autoboost/archive/wcslen.hpp new file mode 100644 index 000000000..1200cf065 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/wcslen.hpp @@ -0,0 +1,56 @@ +#ifndef AUTOBOOST_ARCHIVE_WCSLEN_HPP +#define AUTOBOOST_ARCHIVE_WCSLEN_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// wcslen.hpp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include // size_t +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#ifndef AUTOBOOST_NO_CWCHAR + +// a couple of libraries which include wchar_t don't include +// wcslen + +#if defined(AUTOBOOST_DINKUMWARE_STDLIB) && AUTOBOOST_DINKUMWARE_STDLIB < 306 \ +|| defined(__LIBCOMO__) + +namespace std { +inline std::size_t wcslen(const wchar_t * ws) +{ + const wchar_t * eows = ws; + while(* eows != 0) + ++eows; + return eows - ws; +} +} // namespace std + +#else + +#include +#ifdef AUTOBOOST_NO_STDC_NAMESPACE +namespace std{ using ::wcslen; } +#endif + +#endif // wcslen + +#endif //AUTOBOOST_NO_CWCHAR + +#endif //AUTOBOOST_ARCHIVE_WCSLEN_HPP diff --git a/contrib/autoboost/autoboost/archive/xml_archive_exception.hpp b/contrib/autoboost/autoboost/archive/xml_archive_exception.hpp new file mode 100644 index 000000000..12c2b7cb8 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/xml_archive_exception.hpp @@ -0,0 +1,56 @@ +#ifndef AUTOBOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP +#define AUTOBOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_archive_exception.hpp: + +// (C) Copyright 2007 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include +#include + +#include +#include +#include +#include + +#include // must be the last header + +namespace autoboost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// exceptions thrown by xml archives +// +class AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) xml_archive_exception : + public virtual autoboost::archive::archive_exception +{ +public: + typedef enum { + xml_archive_parsing_error, // see save_register + xml_archive_tag_mismatch, + xml_archive_tag_name_error + } exception_code; + xml_archive_exception( + exception_code c, + const char * e1 = NULL, + const char * e2 = NULL + ); +}; + +}// namespace archive +}// namespace autoboost + +#include // pops abi_suffix.hpp pragmas + +#endif //AUTOBOOST_XML_ARCHIVE_ARCHIVE_EXCEPTION_HPP diff --git a/contrib/autoboost/autoboost/archive/xml_iarchive.hpp b/contrib/autoboost/autoboost/archive/xml_iarchive.hpp new file mode 100644 index 000000000..31669c1cb --- /dev/null +++ b/contrib/autoboost/autoboost/archive/xml_iarchive.hpp @@ -0,0 +1,152 @@ +#ifndef AUTOBOOST_ARCHIVE_XML_IARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_XML_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_iarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include + +//#include +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_iarchive; +} // namespace detail + +template +class basic_xml_grammar; +typedef basic_xml_grammar xml_grammar; + +template +class xml_iarchive_impl : + public basic_text_iprimitive, + public basic_xml_iarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend basic_xml_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class basic_xml_iarchive; + friend class load_access; + #endif +#endif + // instances of micro xml parser to parse start preambles + // scoped_ptr doesn't play nice with borland - so use a naked pointer + // scoped_ptr gimpl; + xml_grammar *gimpl; + + std::istream & get_is(){ + return is; + } + template + void load(T & t){ + basic_text_iprimitive::load(t); + } + void + load(version_type & t){ + unsigned int v; + load(v); + t = version_type(v); + } + void + load(autoboost::serialization::item_version_type & t){ + unsigned int v; + load(v); + t = autoboost::serialization::item_version_type(v); + } + AUTOBOOST_ARCHIVE_DECL(void) + load(char * t); + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + AUTOBOOST_ARCHIVE_DECL(void) + load(wchar_t * t); + #endif + AUTOBOOST_ARCHIVE_DECL(void) + load(std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_ARCHIVE_DECL(void) + load(std::wstring &ws); + #endif + template + void load_override(T & t, AUTOBOOST_PFTO int){ + basic_xml_iarchive::load_override(t, 0); + } + AUTOBOOST_ARCHIVE_DECL(void) + load_override(class_name_type & t, int); + AUTOBOOST_ARCHIVE_DECL(void) + init(); + AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + xml_iarchive_impl(std::istream & is, unsigned int flags); + AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~xml_iarchive_impl(); +}; + +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +class xml_iarchive : + public xml_iarchive_impl{ +public: + xml_iarchive(std::istream & is, unsigned int flags = 0) : + xml_iarchive_impl(is, flags) + {} + ~xml_iarchive(){}; +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::xml_iarchive) + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#endif // AUTOBOOST_ARCHIVE_XML_IARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/xml_oarchive.hpp b/contrib/autoboost/autoboost/archive/xml_oarchive.hpp new file mode 100644 index 000000000..bff28d7e4 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/xml_oarchive.hpp @@ -0,0 +1,143 @@ +#ifndef AUTOBOOST_ARCHIVE_XML_OARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_XML_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_oarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include + +#include // size_t +#include +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_oarchive; +} // namespace detail + +template +class xml_oarchive_impl : + public basic_text_oprimitive, + public basic_xml_oarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_xml_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_xml_oarchive; + friend class save_access; + #endif +#endif + //void end_preamble(){ + // basic_xml_oarchive::end_preamble(); + //} + template + void save(const T & t){ + basic_text_oprimitive::save(t); + } + void + save(const version_type & t){ + save(static_cast(t)); + } + void + save(const autoboost::serialization::item_version_type & t){ + save(static_cast(t)); + } + AUTOBOOST_ARCHIVE_DECL(void) + save(const char * t); + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + AUTOBOOST_ARCHIVE_DECL(void) + save(const wchar_t * t); + #endif + AUTOBOOST_ARCHIVE_DECL(void) + save(const std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_ARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + AUTOBOOST_ARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + xml_oarchive_impl(std::ostream & os, unsigned int flags); + ~xml_oarchive_impl(){} +public: + void save_binary(const void *address, std::size_t count){ + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + this->indent_next = true; + } +}; + +// we use the following because we can't use +// typedef xml_oarchive_impl > xml_oarchive; + +// do not derive from this class. If you want to extend this functionality +// via inhertance, derived from xml_oarchive_impl instead. This will +// preserve correct static polymorphism. +class xml_oarchive : + public xml_oarchive_impl +{ +public: + xml_oarchive(std::ostream & os, unsigned int flags = 0) : + xml_oarchive_impl(os, flags) + {} + ~xml_oarchive(){} +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::xml_oarchive) + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_ARCHIVE_XML_OARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/xml_wiarchive.hpp b/contrib/autoboost/autoboost/archive/xml_wiarchive.hpp new file mode 100644 index 000000000..7d6c0ed13 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/xml_wiarchive.hpp @@ -0,0 +1,159 @@ +#ifndef AUTOBOOST_ARCHIVE_XML_WIARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_XML_WIARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_wiarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include +#ifdef AUTOBOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include + +//#include +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_iarchive; +} // namespace detail + +template +class basic_xml_grammar; +typedef basic_xml_grammar xml_wgrammar; + +template +class xml_wiarchive_impl : + public basic_text_iprimitive, + public basic_xml_iarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; + friend basic_xml_iarchive; + friend load_access; + #else + friend class detail::interface_iarchive; + friend class basic_xml_iarchive; + friend class load_access; + #endif +#endif + // instances of micro xml parser to parse start preambles + // scoped_ptr doesn't play nice with borland - so use a naked pointer + // scoped_ptr gimpl; + xml_wgrammar *gimpl; + std::wistream & get_is(){ + return is; + } + template + void + load(T & t){ + basic_text_iprimitive::load(t); + } + void + load(version_type & t){ + unsigned int v; + load(v); + t = version_type(v); + } + void + load(autoboost::serialization::item_version_type & t){ + unsigned int v; + load(v); + t = autoboost::serialization::item_version_type(v); + } + AUTOBOOST_WARCHIVE_DECL(void) + load(char * t); + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + AUTOBOOST_WARCHIVE_DECL(void) + load(wchar_t * t); + #endif + AUTOBOOST_WARCHIVE_DECL(void) + load(std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_WARCHIVE_DECL(void) + load(std::wstring &ws); + #endif + template + void load_override(T & t, AUTOBOOST_PFTO int){ + basic_xml_iarchive::load_override(t, 0); + } + AUTOBOOST_WARCHIVE_DECL(void) + load_override(class_name_type & t, int); + AUTOBOOST_WARCHIVE_DECL(void) + init(); + AUTOBOOST_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + xml_wiarchive_impl(std::wistream & is, unsigned int flags) ; + AUTOBOOST_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + ~xml_wiarchive_impl(); +}; + +} // namespace archive +} // namespace autoboost + +#ifdef AUTOBOOST_MSVC +# pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +class xml_wiarchive : + public xml_wiarchive_impl{ +public: + xml_wiarchive(std::wistream & is, unsigned int flags = 0) : + xml_wiarchive_impl(is, flags) + {} + ~xml_wiarchive(){} +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::xml_wiarchive) + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#endif // AUTOBOOST_NO_STD_WSTREAMBUF +#endif // AUTOBOOST_ARCHIVE_XML_WIARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/archive/xml_woarchive.hpp b/contrib/autoboost/autoboost/archive/xml_woarchive.hpp new file mode 100644 index 000000000..8609724c7 --- /dev/null +++ b/contrib/autoboost/autoboost/archive/xml_woarchive.hpp @@ -0,0 +1,151 @@ +#ifndef AUTOBOOST_ARCHIVE_XML_WOARCHIVE_HPP +#define AUTOBOOST_ARCHIVE_XML_WOARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_woarchive.hpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to 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 updates, documentation, and revision history. + +#include +#ifdef AUTOBOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include // size_t +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace autoboost { +namespace archive { + +namespace detail { + template class interface_oarchive; +} // namespace detail + +template +class xml_woarchive_impl : + public basic_text_oprimitive, + public basic_xml_oarchive +{ +#ifdef AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else +protected: + #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1500) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend basic_xml_oarchive; + friend save_access; + #else + friend class detail::interface_oarchive; + friend class basic_xml_oarchive; + friend class save_access; + #endif +#endif + + //void end_preamble(){ + // basic_xml_oarchive::end_preamble(); + //} + template + void + save(const T & t){ + basic_text_oprimitive::save(t); + } + void + save(const version_type & t){ + save(static_cast(t)); + } + void + save(const autoboost::serialization::item_version_type & t){ + save(static_cast(t)); + } + AUTOBOOST_WARCHIVE_DECL(void) + save(const char * t); + #ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T + AUTOBOOST_WARCHIVE_DECL(void) + save(const wchar_t * t); + #endif + AUTOBOOST_WARCHIVE_DECL(void) + save(const std::string &s); + #ifndef AUTOBOOST_NO_STD_WSTRING + AUTOBOOST_WARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + AUTOBOOST_WARCHIVE_DECL(AUTOBOOST_PP_EMPTY()) + xml_woarchive_impl(std::wostream & os, unsigned int flags); + ~xml_woarchive_impl(){} +public: + void + save_binary(const void *address, std::size_t count){ + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + this->indent_next = true; + } +}; + +// we use the following because we can't use +// typedef xml_woarchive_impl > xml_woarchive; + +// do not derive from this class. If you want to extend this functionality +// via inhertance, derived from xml_woarchive_impl instead. This will +// preserve correct static polymorphism. +class xml_woarchive : + public xml_woarchive_impl +{ +public: + xml_woarchive(std::wostream & os, unsigned int flags = 0) : + xml_woarchive_impl(os, flags) + {} + ~xml_woarchive(){} +}; + +} // namespace archive +} // namespace autoboost + +// required by export +AUTOBOOST_SERIALIZATION_REGISTER_ARCHIVE(autoboost::archive::xml_woarchive) + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // AUTOBOOST_NO_STD_WSTREAMBUF +#endif // AUTOBOOST_ARCHIVE_XML_OARCHIVE_HPP diff --git a/contrib/autoboost/autoboost/array.hpp b/contrib/autoboost/autoboost/array.hpp new file mode 100644 index 000000000..ade1e4be1 --- /dev/null +++ b/contrib/autoboost/autoboost/array.hpp @@ -0,0 +1,446 @@ +/* The following code declares class array, + * an STL container (as wrapper) for arrays of constant size. + * + * See + * http://www.boost.org/libs/array/ + * for documentation. + * + * The original author site is at: http://www.josuttis.com/ + * + * (C) Copyright Nicolai M. Josuttis 2001. + * + * 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) + * + * 14 Apr 2012 - (mtc) Added support for autoboost::hash + * 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility. + * 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group. + * See or Trac issue #3168 + * Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow) + * 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow) + * 29 Jan 2004 - c_array() added, AUTOBOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis) + * 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries. + * 05 Aug 2001 - minor update (Nico Josuttis) + * 20 Jan 2001 - STLport fix (Beman Dawes) + * 29 Sep 2000 - Initial Revision (Nico Josuttis) + * + * Jan 29, 2004 + */ +#ifndef AUTOBOOST_ARRAY_HPP +#define AUTOBOOST_ARRAY_HPP + +#include + +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, >= 1400) +# pragma warning(push) +# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe +# pragma warning(disable:4510) // autoboost::array' : default constructor could not be generated +# pragma warning(disable:4610) // warning C4610: class 'autoboost::array' can never be instantiated - user defined constructor required +#endif + +#include +#include +#include +#include + +// Handles broken standard libraries better than +#include +#include +#include +#include + +// FIXES for broken compilers +#include + + +namespace autoboost { + + template + class array { + public: + T elems[N]; // fixed-size array of elements of type T + + public: + // type definitions + typedef T value_type; + typedef T* iterator; + typedef const T* const_iterator; + typedef T& reference; + typedef const T& const_reference; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + // iterator support + iterator begin() { return elems; } + const_iterator begin() const { return elems; } + const_iterator cbegin() const { return elems; } + + iterator end() { return elems+N; } + const_iterator end() const { return elems+N; } + const_iterator cend() const { return elems+N; } + + // reverse iterator support +#if !defined(AUTOBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(AUTOBOOST_MSVC_STD_ITERATOR) && !defined(AUTOBOOST_NO_STD_ITERATOR_TRAITS) + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; +#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(AUTOBOOST_DINKUMWARE_STDLIB) && (AUTOBOOST_DINKUMWARE_STDLIB == 310) + // workaround for broken reverse_iterator in VC7 + typedef std::reverse_iterator > reverse_iterator; + typedef std::reverse_iterator > const_reverse_iterator; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; +#else + // workaround for broken reverse_iterator implementations + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; +#endif + + reverse_iterator rbegin() { return reverse_iterator(end()); } + const_reverse_iterator rbegin() const { + return const_reverse_iterator(end()); + } + const_reverse_iterator crbegin() const { + return const_reverse_iterator(end()); + } + + reverse_iterator rend() { return reverse_iterator(begin()); } + const_reverse_iterator rend() const { + return const_reverse_iterator(begin()); + } + const_reverse_iterator crend() const { + return const_reverse_iterator(begin()); + } + + // operator[] + reference operator[](size_type i) + { + AUTOBOOST_ASSERT_MSG( i < N, "out of range" ); + return elems[i]; + } + + const_reference operator[](size_type i) const + { + AUTOBOOST_ASSERT_MSG( i < N, "out of range" ); + return elems[i]; + } + + // at() with range check + reference at(size_type i) { rangecheck(i); return elems[i]; } + const_reference at(size_type i) const { rangecheck(i); return elems[i]; } + + // front() and back() + reference front() + { + return elems[0]; + } + + const_reference front() const + { + return elems[0]; + } + + reference back() + { + return elems[N-1]; + } + + const_reference back() const + { + return elems[N-1]; + } + + // size is constant + static size_type size() { return N; } + static bool empty() { return false; } + static size_type max_size() { return N; } + enum { static_size = N }; + + // swap (note: linear complexity) + void swap (array& y) { + for (size_type i = 0; i < N; ++i) + autoboost::swap(elems[i],y.elems[i]); + } + + // direct access to data (read-only) + const T* data() const { return elems; } + T* data() { return elems; } + + // use array as C array (direct read/write access to data) + T* c_array() { return elems; } + + // assignment with type conversion + template + array& operator= (const array& rhs) { + std::copy(rhs.begin(),rhs.end(), begin()); + return *this; + } + + // assign one value to all elements + void assign (const T& value) { fill ( value ); } // A synonym for fill + void fill (const T& value) + { + std::fill_n(begin(),size(),value); + } + + // check range (may be private because it is static) + static void rangecheck (size_type i) { + if (i >= size()) { + std::out_of_range e("array<>: index out of range"); + autoboost::throw_exception(e); + } + } + + }; + +#if !defined(AUTOBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + template< class T > + class array< T, 0 > { + + public: + // type definitions + typedef T value_type; + typedef T* iterator; + typedef const T* const_iterator; + typedef T& reference; + typedef const T& const_reference; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + // iterator support + iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); } + const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); } + const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); } + + iterator end() { return begin(); } + const_iterator end() const { return begin(); } + const_iterator cend() const { return cbegin(); } + + // reverse iterator support +#if !defined(AUTOBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(AUTOBOOST_MSVC_STD_ITERATOR) && !defined(AUTOBOOST_NO_STD_ITERATOR_TRAITS) + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; +#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(AUTOBOOST_DINKUMWARE_STDLIB) && (AUTOBOOST_DINKUMWARE_STDLIB == 310) + // workaround for broken reverse_iterator in VC7 + typedef std::reverse_iterator > reverse_iterator; + typedef std::reverse_iterator > const_reverse_iterator; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; +#else + // workaround for broken reverse_iterator implementations + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; +#endif + + reverse_iterator rbegin() { return reverse_iterator(end()); } + const_reverse_iterator rbegin() const { + return const_reverse_iterator(end()); + } + const_reverse_iterator crbegin() const { + return const_reverse_iterator(end()); + } + + reverse_iterator rend() { return reverse_iterator(begin()); } + const_reverse_iterator rend() const { + return const_reverse_iterator(begin()); + } + const_reverse_iterator crend() const { + return const_reverse_iterator(begin()); + } + + // operator[] + reference operator[](size_type /*i*/) + { + return failed_rangecheck(); + } + + const_reference operator[](size_type /*i*/) const + { + return failed_rangecheck(); + } + + // at() with range check + reference at(size_type /*i*/) { return failed_rangecheck(); } + const_reference at(size_type /*i*/) const { return failed_rangecheck(); } + + // front() and back() + reference front() + { + return failed_rangecheck(); + } + + const_reference front() const + { + return failed_rangecheck(); + } + + reference back() + { + return failed_rangecheck(); + } + + const_reference back() const + { + return failed_rangecheck(); + } + + // size is constant + static size_type size() { return 0; } + static bool empty() { return true; } + static size_type max_size() { return 0; } + enum { static_size = 0 }; + + void swap (array& /*y*/) { + } + + // direct access to data (read-only) + const T* data() const { return 0; } + T* data() { return 0; } + + // use array as C array (direct read/write access to data) + T* c_array() { return 0; } + + // assignment with type conversion + template + array& operator= (const array& ) { + return *this; + } + + // assign one value to all elements + void assign (const T& value) { fill ( value ); } + void fill (const T& ) {} + + // check range (may be private because it is static) + static reference failed_rangecheck () { + std::out_of_range e("attempt to access element of an empty array"); + autoboost::throw_exception(e); +#if defined(AUTOBOOST_NO_EXCEPTIONS) || (!defined(AUTOBOOST_MSVC) && !defined(__PATHSCALE__)) + // + // We need to return something here to keep + // some compilers happy: however we will never + // actually get here.... + // + static T placeholder; + return placeholder; +#endif + } + }; +#endif + + // comparisons + template + bool operator== (const array& x, const array& y) { + return std::equal(x.begin(), x.end(), y.begin()); + } + template + bool operator< (const array& x, const array& y) { + return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end()); + } + template + bool operator!= (const array& x, const array& y) { + return !(x==y); + } + template + bool operator> (const array& x, const array& y) { + return y + bool operator<= (const array& x, const array& y) { + return !(y + bool operator>= (const array& x, const array& y) { + return !(x + inline void swap (array& x, array& y) { + x.swap(y); + } + +#if defined(__SUNPRO_CC) +// Trac ticket #4757; the Sun Solaris compiler can't handle +// syntax like 'T(&get_c_array(autoboost::array& arg))[N]' +// +// We can't just use this for all compilers, because the +// borland compilers can't handle this form. + namespace detail { + template struct c_array + { + typedef T type[N]; + }; + } + + // Specific for autoboost::array: simply returns its elems data member. + template + typename detail::c_array::type& get_c_array(autoboost::array& arg) + { + return arg.elems; + } + + // Specific for autoboost::array: simply returns its elems data member. + template + typename const detail::c_array::type& get_c_array(const autoboost::array& arg) + { + return arg.elems; + } +#else +// Specific for autoboost::array: simply returns its elems data member. + template + T(&get_c_array(autoboost::array& arg))[N] + { + return arg.elems; + } + + // Const version. + template + const T(&get_c_array(const autoboost::array& arg))[N] + { + return arg.elems; + } +#endif + +#if 0 + // Overload for std::array, assuming that std::array will have + // explicit conversion functions as discussed at the WG21 meeting + // in Summit, March 2009. + template + T(&get_c_array(std::array& arg))[N] + { + return static_cast(arg); + } + + // Const version. + template + const T(&get_c_array(const std::array& arg))[N] + { + return static_cast(arg); + } +#endif + + + template + std::size_t hash_value(const array& arr) + { + return autoboost::hash_range(arr.begin(), arr.end()); + } + +} /* namespace autoboost */ + + +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, >= 1400) +# pragma warning(pop) +#endif + +#endif /*AUTOBOOST_ARRAY_HPP*/ diff --git a/contrib/autoboost/autoboost/asio.hpp b/contrib/autoboost/autoboost/asio.hpp new file mode 100644 index 000000000..3afcf6831 --- /dev/null +++ b/contrib/autoboost/autoboost/asio.hpp @@ -0,0 +1,121 @@ +// +// asio.hpp +// ~~~~~~~~ +// +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// 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 www.boost.org/libs/asio for documentation. +// + +#ifndef AUTOBOOST_ASIO_HPP +#define AUTOBOOST_ASIO_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // AUTOBOOST_ASIO_HPP diff --git a/contrib/autoboost/boost/asio/async_result.hpp b/contrib/autoboost/autoboost/asio/async_result.hpp similarity index 77% rename from contrib/autoboost/boost/asio/async_result.hpp rename to contrib/autoboost/autoboost/asio/async_result.hpp index 08d8f6ac7..bd14b0f01 100644 --- a/contrib/autoboost/boost/asio/async_result.hpp +++ b/contrib/autoboost/autoboost/asio/async_result.hpp @@ -8,17 +8,17 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_ASYNC_RESULT_HPP -#define BOOST_ASIO_ASYNC_RESULT_HPP +#ifndef AUTOBOOST_ASIO_ASYNC_RESULT_HPP +#define AUTOBOOST_ASIO_ASYNC_RESULT_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include -#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -57,8 +57,8 @@ namespace detail { template struct async_result_init { - explicit async_result_init(BOOST_ASIO_MOVE_ARG(Handler) orig_handler) - : handler(BOOST_ASIO_MOVE_CAST(Handler)(orig_handler)), + explicit async_result_init(AUTOBOOST_ASIO_MOVE_ARG(Handler) orig_handler) + : handler(AUTOBOOST_ASIO_MOVE_CAST(Handler)(orig_handler)), result(handler) { } @@ -79,18 +79,18 @@ struct async_result_type_helper } // namespace asio } // namespace autoboost -#include +#include #if defined(GENERATING_DOCUMENTATION) -# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ +# define AUTOBOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ void_or_deduced #elif defined(_MSC_VER) && (_MSC_VER < 1500) -# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ +# define AUTOBOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ typename ::autoboost::asio::detail::async_result_type_helper::type #else -# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ +# define AUTOBOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \ typename ::autoboost::asio::async_result< \ typename ::autoboost::asio::handler_type::type>::type #endif -#endif // BOOST_ASIO_ASYNC_RESULT_HPP +#endif // AUTOBOOST_ASIO_ASYNC_RESULT_HPP diff --git a/contrib/autoboost/boost/asio/basic_datagram_socket.hpp b/contrib/autoboost/autoboost/asio/basic_datagram_socket.hpp similarity index 92% rename from contrib/autoboost/boost/asio/basic_datagram_socket.hpp rename to contrib/autoboost/autoboost/asio/basic_datagram_socket.hpp index 00295cda5..2b3edb575 100644 --- a/contrib/autoboost/boost/asio/basic_datagram_socket.hpp +++ b/contrib/autoboost/autoboost/asio/basic_datagram_socket.hpp @@ -8,23 +8,23 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP -#define BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP +#ifndef AUTOBOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP +#define AUTOBOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -133,7 +133,7 @@ class basic_datagram_socket { } -#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#if defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move-construct a basic_datagram_socket from another. /** * This constructor moves a datagram socket from one object to another. @@ -146,7 +146,7 @@ class basic_datagram_socket */ basic_datagram_socket(basic_datagram_socket&& other) : basic_socket( - BOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other)) + AUTOBOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other)) { } @@ -164,7 +164,7 @@ class basic_datagram_socket basic_datagram_socket& operator=(basic_datagram_socket&& other) { basic_socket::operator=( - BOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other)); + AUTOBOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other)); return *this; } @@ -184,7 +184,7 @@ class basic_datagram_socket basic_datagram_socket&& other, typename enable_if::value>::type* = 0) : basic_socket( - BOOST_ASIO_MOVE_CAST2(basic_datagram_socket< + AUTOBOOST_ASIO_MOVE_CAST2(basic_datagram_socket< Protocol1, DatagramSocketService1>)(other)) { } @@ -207,11 +207,11 @@ class basic_datagram_socket basic_datagram_socket&& other) { basic_socket::operator=( - BOOST_ASIO_MOVE_CAST2(basic_datagram_socket< + AUTOBOOST_ASIO_MOVE_CAST2(basic_datagram_socket< Protocol1, DatagramSocketService1>)(other)); return *this; } -#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#endif // defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Send some data on a connected socket. /** @@ -334,17 +334,17 @@ class basic_datagram_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send(const ConstBufferSequence& buffers, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send(this->get_implementation(), - buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + buffers, 0, AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Start an asynchronous send on a connected socket. @@ -376,18 +376,18 @@ class basic_datagram_socket * socket. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send(const ConstBufferSequence& buffers, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send(this->get_implementation(), - buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + buffers, flags, AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Send a datagram to the specified endpoint. @@ -516,19 +516,19 @@ class basic_datagram_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send_to( this->get_implementation(), buffers, destination, 0, - BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Start an asynchronous send. @@ -559,19 +559,19 @@ class basic_datagram_socket * autoboost::asio::io_service::post(). */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send_to( this->get_implementation(), buffers, destination, flags, - BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Receive some data on a connected socket. @@ -700,17 +700,17 @@ class basic_datagram_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive(const MutableBufferSequence& buffers, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive(this->get_implementation(), - buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + buffers, 0, AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Start an asynchronous receive on a connected socket. @@ -742,18 +742,18 @@ class basic_datagram_socket * datagram socket. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive(this->get_implementation(), - buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + buffers, flags, AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Receive a datagram with the endpoint of the sender. @@ -882,19 +882,19 @@ class basic_datagram_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, 0, - BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Start an asynchronous receive. @@ -927,25 +927,25 @@ class basic_datagram_socket * autoboost::asio::io_service::post(). */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, flags, - BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } }; } // namespace asio } // namespace autoboost -#include +#include -#endif // BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP +#endif // AUTOBOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP diff --git a/contrib/autoboost/boost/asio/basic_deadline_timer.hpp b/contrib/autoboost/autoboost/asio/basic_deadline_timer.hpp similarity index 95% rename from contrib/autoboost/boost/asio/basic_deadline_timer.hpp rename to contrib/autoboost/autoboost/asio/basic_deadline_timer.hpp index adee2bfc5..c6a737580 100644 --- a/contrib/autoboost/boost/asio/basic_deadline_timer.hpp +++ b/contrib/autoboost/autoboost/asio/basic_deadline_timer.hpp @@ -8,26 +8,26 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP -#define BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP +#ifndef AUTOBOOST_ASIO_BASIC_DEADLINE_TIMER_HPP +#define AUTOBOOST_ASIO_BASIC_DEADLINE_TIMER_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include +#include -#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \ +#if defined(AUTOBOOST_ASIO_HAS_AUTOBOOST_DATE_TIME) \ || defined(GENERATING_DOCUMENTATION) #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -496,25 +496,25 @@ class basic_deadline_timer * autoboost::asio::io_service::post(). */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler, void (autoboost::system::error_code)) - async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler) + async_wait(AUTOBOOST_ASIO_MOVE_ARG(WaitHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WaitHandler. - BOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; + AUTOBOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; return this->service.async_wait(this->implementation, - BOOST_ASIO_MOVE_CAST(WaitHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(WaitHandler)(handler)); } }; } // namespace asio } // namespace autoboost -#include +#include -#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) +#endif // defined(AUTOBOOST_ASIO_HAS_AUTOBOOST_DATE_TIME) // || defined(GENERATING_DOCUMENTATION) -#endif // BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP +#endif // AUTOBOOST_ASIO_BASIC_DEADLINE_TIMER_HPP diff --git a/contrib/autoboost/boost/asio/basic_io_object.hpp b/contrib/autoboost/autoboost/asio/basic_io_object.hpp similarity index 91% rename from contrib/autoboost/boost/asio/basic_io_object.hpp rename to contrib/autoboost/autoboost/asio/basic_io_object.hpp index 236446850..405ae360c 100644 --- a/contrib/autoboost/boost/asio/basic_io_object.hpp +++ b/contrib/autoboost/autoboost/asio/basic_io_object.hpp @@ -8,22 +8,22 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_IO_OBJECT_HPP -#define BOOST_ASIO_BASIC_IO_OBJECT_HPP +#ifndef AUTOBOOST_ASIO_BASIC_IO_OBJECT_HPP +#define AUTOBOOST_ASIO_BASIC_IO_OBJECT_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include -#include +#include +#include -#include +#include namespace autoboost { namespace asio { -#if defined(BOOST_ASIO_HAS_MOVE) +#if defined(AUTOBOOST_ASIO_HAS_MOVE) namespace detail { // Type trait used to determine whether a service supports move. @@ -45,14 +45,14 @@ namespace detail static_cast(0))) == 1; }; } -#endif // defined(BOOST_ASIO_HAS_MOVE) +#endif // defined(AUTOBOOST_ASIO_HAS_MOVE) /// Base class for all I/O objects. /** * @note All I/O objects are non-copyable. However, when using C++0x, certain * I/O objects do support move construction and move assignment. */ -#if !defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#if !defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) template #else template class basic_io_object @@ -232,11 +232,11 @@ class basic_io_object IoObjectService* service_; }; -#endif // defined(BOOST_ASIO_HAS_MOVE) +#endif // defined(AUTOBOOST_ASIO_HAS_MOVE) } // namespace asio } // namespace autoboost -#include +#include -#endif // BOOST_ASIO_BASIC_IO_OBJECT_HPP +#endif // AUTOBOOST_ASIO_BASIC_IO_OBJECT_HPP diff --git a/contrib/autoboost/boost/asio/basic_raw_socket.hpp b/contrib/autoboost/autoboost/asio/basic_raw_socket.hpp similarity index 92% rename from contrib/autoboost/boost/asio/basic_raw_socket.hpp rename to contrib/autoboost/autoboost/asio/basic_raw_socket.hpp index 73cddf834..14d5a5019 100644 --- a/contrib/autoboost/boost/asio/basic_raw_socket.hpp +++ b/contrib/autoboost/autoboost/asio/basic_raw_socket.hpp @@ -8,23 +8,23 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_RAW_SOCKET_HPP -#define BOOST_ASIO_BASIC_RAW_SOCKET_HPP +#ifndef AUTOBOOST_ASIO_BASIC_RAW_SOCKET_HPP +#define AUTOBOOST_ASIO_BASIC_RAW_SOCKET_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -133,7 +133,7 @@ class basic_raw_socket { } -#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#if defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move-construct a basic_raw_socket from another. /** * This constructor moves a raw socket from one object to another. @@ -146,7 +146,7 @@ class basic_raw_socket */ basic_raw_socket(basic_raw_socket&& other) : basic_socket( - BOOST_ASIO_MOVE_CAST(basic_raw_socket)(other)) + AUTOBOOST_ASIO_MOVE_CAST(basic_raw_socket)(other)) { } @@ -163,7 +163,7 @@ class basic_raw_socket basic_raw_socket& operator=(basic_raw_socket&& other) { basic_socket::operator=( - BOOST_ASIO_MOVE_CAST(basic_raw_socket)(other)); + AUTOBOOST_ASIO_MOVE_CAST(basic_raw_socket)(other)); return *this; } @@ -181,7 +181,7 @@ class basic_raw_socket basic_raw_socket(basic_raw_socket&& other, typename enable_if::value>::type* = 0) : basic_socket( - BOOST_ASIO_MOVE_CAST2(basic_raw_socket< + AUTOBOOST_ASIO_MOVE_CAST2(basic_raw_socket< Protocol1, RawSocketService1>)(other)) { } @@ -202,11 +202,11 @@ class basic_raw_socket basic_raw_socket&& other) { basic_socket::operator=( - BOOST_ASIO_MOVE_CAST2(basic_raw_socket< + AUTOBOOST_ASIO_MOVE_CAST2(basic_raw_socket< Protocol1, RawSocketService1>)(other)); return *this; } -#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#endif // defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Send some data on a connected socket. /** @@ -326,17 +326,17 @@ class basic_raw_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send(const ConstBufferSequence& buffers, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send(this->get_implementation(), - buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + buffers, 0, AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Start an asynchronous send on a connected socket. @@ -368,18 +368,18 @@ class basic_raw_socket * socket. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send(const ConstBufferSequence& buffers, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send(this->get_implementation(), - buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + buffers, flags, AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Send raw data to the specified endpoint. @@ -508,18 +508,18 @@ class basic_raw_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send_to(this->get_implementation(), - buffers, destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + buffers, destination, 0, AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Start an asynchronous send. @@ -550,19 +550,19 @@ class basic_raw_socket * autoboost::asio::io_service::post(). */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send_to( this->get_implementation(), buffers, destination, flags, - BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Receive some data on a connected socket. @@ -691,17 +691,17 @@ class basic_raw_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive(const MutableBufferSequence& buffers, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive(this->get_implementation(), - buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + buffers, 0, AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Start an asynchronous receive on a connected socket. @@ -733,18 +733,18 @@ class basic_raw_socket * raw socket. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive(this->get_implementation(), - buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + buffers, flags, AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Receive raw data with the endpoint of the sender. @@ -873,19 +873,19 @@ class basic_raw_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, 0, - BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Start an asynchronous receive. @@ -918,25 +918,25 @@ class basic_raw_socket * autoboost::asio::io_service::post(). */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, flags, - BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } }; } // namespace asio } // namespace autoboost -#include +#include -#endif // BOOST_ASIO_BASIC_RAW_SOCKET_HPP +#endif // AUTOBOOST_ASIO_BASIC_RAW_SOCKET_HPP diff --git a/contrib/autoboost/boost/asio/basic_seq_packet_socket.hpp b/contrib/autoboost/autoboost/asio/basic_seq_packet_socket.hpp similarity index 92% rename from contrib/autoboost/boost/asio/basic_seq_packet_socket.hpp rename to contrib/autoboost/autoboost/asio/basic_seq_packet_socket.hpp index 99cc18ac1..8518a4e25 100644 --- a/contrib/autoboost/boost/asio/basic_seq_packet_socket.hpp +++ b/contrib/autoboost/autoboost/asio/basic_seq_packet_socket.hpp @@ -8,22 +8,22 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP -#define BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP +#ifndef AUTOBOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP +#define AUTOBOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -136,7 +136,7 @@ class basic_seq_packet_socket { } -#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#if defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move-construct a basic_seq_packet_socket from another. /** * This constructor moves a sequenced packet socket from one object to @@ -150,7 +150,7 @@ class basic_seq_packet_socket */ basic_seq_packet_socket(basic_seq_packet_socket&& other) : basic_socket( - BOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other)) + AUTOBOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other)) { } @@ -168,7 +168,7 @@ class basic_seq_packet_socket basic_seq_packet_socket& operator=(basic_seq_packet_socket&& other) { basic_socket::operator=( - BOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other)); + AUTOBOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other)); return *this; } @@ -189,7 +189,7 @@ class basic_seq_packet_socket basic_seq_packet_socket&& other, typename enable_if::value>::type* = 0) : basic_socket( - BOOST_ASIO_MOVE_CAST2(basic_seq_packet_socket< + AUTOBOOST_ASIO_MOVE_CAST2(basic_seq_packet_socket< Protocol1, SeqPacketSocketService1>)(other)) { } @@ -212,11 +212,11 @@ class basic_seq_packet_socket basic_seq_packet_socket&& other) { basic_socket::operator=( - BOOST_ASIO_MOVE_CAST2(basic_seq_packet_socket< + AUTOBOOST_ASIO_MOVE_CAST2(basic_seq_packet_socket< Protocol1, SeqPacketSocketService1>)(other)); return *this; } -#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#endif // defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Send some data on the socket. /** @@ -312,18 +312,18 @@ class basic_seq_packet_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_send(const ConstBufferSequence& buffers, socket_base::message_flags flags, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_send(this->get_implementation(), - buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + buffers, flags, AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Receive some data on the socket. @@ -484,19 +484,19 @@ class basic_seq_packet_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive(const MutableBufferSequence& buffers, socket_base::message_flags& out_flags, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive( this->get_implementation(), buffers, 0, out_flags, - BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Start an asynchronous receive. @@ -542,26 +542,26 @@ class basic_seq_packet_socket * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_receive(const MutableBufferSequence& buffers, socket_base::message_flags in_flags, socket_base::message_flags& out_flags, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_receive( this->get_implementation(), buffers, in_flags, out_flags, - BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } }; } // namespace asio } // namespace autoboost -#include +#include -#endif // BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP +#endif // AUTOBOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP diff --git a/contrib/autoboost/boost/asio/basic_serial_port.hpp b/contrib/autoboost/autoboost/asio/basic_serial_port.hpp similarity index 94% rename from contrib/autoboost/boost/asio/basic_serial_port.hpp rename to contrib/autoboost/autoboost/asio/basic_serial_port.hpp index 9ae1f20b1..bba756f26 100644 --- a/contrib/autoboost/boost/asio/basic_serial_port.hpp +++ b/contrib/autoboost/autoboost/asio/basic_serial_port.hpp @@ -9,27 +9,27 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_SERIAL_PORT_HPP -#define BOOST_ASIO_BASIC_SERIAL_PORT_HPP +#ifndef AUTOBOOST_ASIO_BASIC_SERIAL_PORT_HPP +#define AUTOBOOST_ASIO_BASIC_SERIAL_PORT_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include +#include -#if defined(BOOST_ASIO_HAS_SERIAL_PORT) \ +#if defined(AUTOBOOST_ASIO_HAS_SERIAL_PORT) \ || defined(GENERATING_DOCUMENTATION) #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -133,7 +133,7 @@ class basic_serial_port autoboost::asio::detail::throw_error(ec, "assign"); } -#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#if defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move-construct a basic_serial_port from another. /** * This constructor moves a serial port from one object to another. @@ -146,7 +146,7 @@ class basic_serial_port */ basic_serial_port(basic_serial_port&& other) : basic_io_object( - BOOST_ASIO_MOVE_CAST(basic_serial_port)(other)) + AUTOBOOST_ASIO_MOVE_CAST(basic_serial_port)(other)) { } @@ -163,10 +163,10 @@ class basic_serial_port basic_serial_port& operator=(basic_serial_port&& other) { basic_io_object::operator=( - BOOST_ASIO_MOVE_CAST(basic_serial_port)(other)); + AUTOBOOST_ASIO_MOVE_CAST(basic_serial_port)(other)); return *this; } -#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#endif // defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Get a reference to the lowest layer. /** @@ -559,17 +559,17 @@ class basic_serial_port * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (autoboost::system::error_code, std::size_t)) async_write_some(const ConstBufferSequence& buffers, - BOOST_ASIO_MOVE_ARG(WriteHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + AUTOBOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; return this->get_service().async_write_some(this->get_implementation(), - buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); + buffers, AUTOBOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Read some data from the serial port. @@ -672,26 +672,26 @@ class basic_serial_port * std::vector. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (autoboost::system::error_code, std::size_t)) async_read_some(const MutableBufferSequence& buffers, - BOOST_ASIO_MOVE_ARG(ReadHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + AUTOBOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; return this->get_service().async_read_some(this->get_implementation(), - buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); + buffers, AUTOBOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } }; } // namespace asio } // namespace autoboost -#include +#include -#endif // defined(BOOST_ASIO_HAS_SERIAL_PORT) +#endif // defined(AUTOBOOST_ASIO_HAS_SERIAL_PORT) // || defined(GENERATING_DOCUMENTATION) -#endif // BOOST_ASIO_BASIC_SERIAL_PORT_HPP +#endif // AUTOBOOST_ASIO_BASIC_SERIAL_PORT_HPP diff --git a/contrib/autoboost/boost/asio/basic_signal_set.hpp b/contrib/autoboost/autoboost/asio/basic_signal_set.hpp similarity index 94% rename from contrib/autoboost/boost/asio/basic_signal_set.hpp rename to contrib/autoboost/autoboost/asio/basic_signal_set.hpp index d220caa5b..904bf50ed 100644 --- a/contrib/autoboost/boost/asio/basic_signal_set.hpp +++ b/contrib/autoboost/autoboost/asio/basic_signal_set.hpp @@ -8,22 +8,22 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_SIGNAL_SET_HPP -#define BOOST_ASIO_BASIC_SIGNAL_SET_HPP +#ifndef AUTOBOOST_ASIO_BASIC_SIGNAL_SET_HPP +#define AUTOBOOST_ASIO_BASIC_SIGNAL_SET_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -365,22 +365,22 @@ class basic_signal_set * autoboost::asio::io_service::post(). */ template - BOOST_ASIO_INITFN_RESULT_TYPE(SignalHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(SignalHandler, void (autoboost::system::error_code, int)) - async_wait(BOOST_ASIO_MOVE_ARG(SignalHandler) handler) + async_wait(AUTOBOOST_ASIO_MOVE_ARG(SignalHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a SignalHandler. - BOOST_ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check; + AUTOBOOST_ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check; return this->service.async_wait(this->implementation, - BOOST_ASIO_MOVE_CAST(SignalHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(SignalHandler)(handler)); } }; } // namespace asio } // namespace autoboost -#include +#include -#endif // BOOST_ASIO_BASIC_SIGNAL_SET_HPP +#endif // AUTOBOOST_ASIO_BASIC_SIGNAL_SET_HPP diff --git a/contrib/autoboost/boost/asio/basic_socket.hpp b/contrib/autoboost/autoboost/asio/basic_socket.hpp similarity index 96% rename from contrib/autoboost/boost/asio/basic_socket.hpp rename to contrib/autoboost/autoboost/asio/basic_socket.hpp index 1e23dea9a..2dbb2c5d0 100644 --- a/contrib/autoboost/boost/asio/basic_socket.hpp +++ b/contrib/autoboost/autoboost/asio/basic_socket.hpp @@ -8,23 +8,23 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_SOCKET_HPP -#define BOOST_ASIO_BASIC_SOCKET_HPP +#ifndef AUTOBOOST_ASIO_BASIC_SOCKET_HPP +#define AUTOBOOST_ASIO_BASIC_SOCKET_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -142,7 +142,7 @@ class basic_socket autoboost::asio::detail::throw_error(ec, "assign"); } -#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#if defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move-construct a basic_socket from another. /** * This constructor moves a socket from one object to another. @@ -155,7 +155,7 @@ class basic_socket */ basic_socket(basic_socket&& other) : basic_io_object( - BOOST_ASIO_MOVE_CAST(basic_socket)(other)) + AUTOBOOST_ASIO_MOVE_CAST(basic_socket)(other)) { } @@ -172,7 +172,7 @@ class basic_socket basic_socket& operator=(basic_socket&& other) { basic_io_object::operator=( - BOOST_ASIO_MOVE_CAST(basic_socket)(other)); + AUTOBOOST_ASIO_MOVE_CAST(basic_socket)(other)); return *this; } @@ -214,13 +214,13 @@ class basic_socket basic_socket>::type& operator=( basic_socket&& other) { - basic_socket tmp(BOOST_ASIO_MOVE_CAST2(basic_socket< + basic_socket tmp(AUTOBOOST_ASIO_MOVE_CAST2(basic_socket< Protocol1, SocketService1>)(other)); basic_io_object::operator=( - BOOST_ASIO_MOVE_CAST(basic_socket)(tmp)); + AUTOBOOST_ASIO_MOVE_CAST(basic_socket)(tmp)); return *this; } -#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#endif // defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Get a reference to the lowest layer. /** @@ -419,7 +419,7 @@ class basic_socket * @note Calls to cancel() will always fail with * autoboost::asio::error::operation_not_supported when run on Windows XP, Windows * Server 2003, and earlier versions of Windows, unless - * BOOST_ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has + * AUTOBOOST_ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has * two issues that should be considered before enabling its use: * * @li It will only cancel asynchronous operations that were initiated in the @@ -433,7 +433,7 @@ class basic_socket * alternatives: * * @li Disable asio's I/O completion port backend by defining - * BOOST_ASIO_DISABLE_IOCP. + * AUTOBOOST_ASIO_DISABLE_IOCP. * * @li Use the close() function to simultaneously cancel the outstanding * operations and close the socket. @@ -442,9 +442,9 @@ class basic_socket * CancelIoEx function is always used. This function does not have the * problems described above. */ -#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \ +#if defined(AUTOBOOST_ASIO_MSVC) && (AUTOBOOST_ASIO_MSVC >= 1400) \ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ - && !defined(BOOST_ASIO_ENABLE_CANCELIO) + && !defined(AUTOBOOST_ASIO_ENABLE_CANCELIO) __declspec(deprecated("By default, this function always fails with " "operation_not_supported when used on Windows XP, Windows Server 2003, " "or earlier. Consult documentation for details.")) @@ -467,7 +467,7 @@ class basic_socket * @note Calls to cancel() will always fail with * autoboost::asio::error::operation_not_supported when run on Windows XP, Windows * Server 2003, and earlier versions of Windows, unless - * BOOST_ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has + * AUTOBOOST_ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has * two issues that should be considered before enabling its use: * * @li It will only cancel asynchronous operations that were initiated in the @@ -481,7 +481,7 @@ class basic_socket * alternatives: * * @li Disable asio's I/O completion port backend by defining - * BOOST_ASIO_DISABLE_IOCP. + * AUTOBOOST_ASIO_DISABLE_IOCP. * * @li Use the close() function to simultaneously cancel the outstanding * operations and close the socket. @@ -490,9 +490,9 @@ class basic_socket * CancelIoEx function is always used. This function does not have the * problems described above. */ -#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \ +#if defined(AUTOBOOST_ASIO_MSVC) && (AUTOBOOST_ASIO_MSVC >= 1400) \ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ - && !defined(BOOST_ASIO_ENABLE_CANCELIO) + && !defined(AUTOBOOST_ASIO_ENABLE_CANCELIO) __declspec(deprecated("By default, this function always fails with " "operation_not_supported when used on Windows XP, Windows Server 2003, " "or earlier. Consult documentation for details.")) @@ -745,14 +745,14 @@ class basic_socket * @endcode */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler, void (autoboost::system::error_code)) async_connect(const endpoint_type& peer_endpoint, - BOOST_ASIO_MOVE_ARG(ConnectHandler) handler) + AUTOBOOST_ASIO_MOVE_ARG(ConnectHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ConnectHandler. - BOOST_ASIO_CONNECT_HANDLER_CHECK(ConnectHandler, handler) type_check; + AUTOBOOST_ASIO_CONNECT_HANDLER_CHECK(ConnectHandler, handler) type_check; if (!is_open()) { @@ -762,11 +762,11 @@ class basic_socket { detail::async_result_init< ConnectHandler, void (autoboost::system::error_code)> init( - BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(ConnectHandler)(handler)); this->get_io_service().post( autoboost::asio::detail::bind_handler( - BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE( + AUTOBOOST_ASIO_MOVE_CAST(AUTOBOOST_ASIO_HANDLER_TYPE( ConnectHandler, void (autoboost::system::error_code)))( init.handler), ec)); @@ -775,7 +775,7 @@ class basic_socket } return this->get_service().async_connect(this->get_implementation(), - peer_endpoint, BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler)); + peer_endpoint, AUTOBOOST_ASIO_MOVE_CAST(ConnectHandler)(handler)); } /// Set an option on the socket. @@ -1515,6 +1515,6 @@ class basic_socket } // namespace asio } // namespace autoboost -#include +#include -#endif // BOOST_ASIO_BASIC_SOCKET_HPP +#endif // AUTOBOOST_ASIO_BASIC_SOCKET_HPP diff --git a/contrib/autoboost/boost/asio/basic_socket_acceptor.hpp b/contrib/autoboost/autoboost/asio/basic_socket_acceptor.hpp similarity index 95% rename from contrib/autoboost/boost/asio/basic_socket_acceptor.hpp rename to contrib/autoboost/autoboost/asio/basic_socket_acceptor.hpp index b1f770b49..ab92512ed 100644 --- a/contrib/autoboost/boost/asio/basic_socket_acceptor.hpp +++ b/contrib/autoboost/autoboost/asio/basic_socket_acceptor.hpp @@ -8,24 +8,24 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_SOCKET_ACCEPTOR_HPP -#define BOOST_ASIO_BASIC_SOCKET_ACCEPTOR_HPP +#ifndef AUTOBOOST_ASIO_BASIC_SOCKET_ACCEPTOR_HPP +#define AUTOBOOST_ASIO_BASIC_SOCKET_ACCEPTOR_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include namespace autoboost { namespace asio { @@ -179,7 +179,7 @@ class basic_socket_acceptor autoboost::asio::detail::throw_error(ec, "assign"); } -#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#if defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move-construct a basic_socket_acceptor from another. /** * This constructor moves an acceptor from one object to another. @@ -192,7 +192,7 @@ class basic_socket_acceptor */ basic_socket_acceptor(basic_socket_acceptor&& other) : basic_io_object( - BOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(other)) + AUTOBOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(other)) { } @@ -209,7 +209,7 @@ class basic_socket_acceptor basic_socket_acceptor& operator=(basic_socket_acceptor&& other) { basic_io_object::operator=( - BOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(other)); + AUTOBOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(other)); return *this; } @@ -254,13 +254,13 @@ class basic_socket_acceptor basic_socket_acceptor>::type& operator=( basic_socket_acceptor&& other) { - basic_socket_acceptor tmp(BOOST_ASIO_MOVE_CAST2(basic_socket_acceptor< + basic_socket_acceptor tmp(AUTOBOOST_ASIO_MOVE_CAST2(basic_socket_acceptor< Protocol1, SocketAcceptorService1>)(other)); basic_io_object::operator=( - BOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(tmp)); + AUTOBOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(tmp)); return *this; } -#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +#endif // defined(AUTOBOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Open the acceptor using the specified protocol. /** @@ -1004,19 +1004,19 @@ class basic_socket_acceptor * @endcode */ template - BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler, void (autoboost::system::error_code)) async_accept(basic_socket& peer, - BOOST_ASIO_MOVE_ARG(AcceptHandler) handler, + AUTOBOOST_ASIO_MOVE_ARG(AcceptHandler) handler, typename enable_if::value>::type* = 0) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a AcceptHandler. - BOOST_ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; + AUTOBOOST_ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; return this->get_service().async_accept(this->get_implementation(), peer, static_cast(0), - BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)); + AUTOBOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)); } /// Accept a new connection and obtain the endpoint of the peer @@ -1116,23 +1116,23 @@ class basic_socket_acceptor * autoboost::asio::io_service::post(). */ template - BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler, + AUTOBOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler, void (autoboost::system::error_code)) async_accept(basic_socket& peer, - endpoint_type& peer_endpoint, BOOST_ASIO_MOVE_ARG(AcceptHandler) handler) + endpoint_type& peer_endpoint, AUTOBOOST_ASIO_MOVE_ARG(AcceptHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a AcceptHandler. - BOOST_ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; + AUTOBOOST_ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; return this->get_service().async_accept(this->get_implementation(), peer, - &peer_endpoint, BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)); + &peer_endpoint, AUTOBOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)); } }; } // namespace asio } // namespace autoboost -#include +#include -#endif // BOOST_ASIO_BASIC_SOCKET_ACCEPTOR_HPP +#endif // AUTOBOOST_ASIO_BASIC_SOCKET_ACCEPTOR_HPP diff --git a/contrib/autoboost/boost/asio/basic_socket_iostream.hpp b/contrib/autoboost/autoboost/asio/basic_socket_iostream.hpp similarity index 82% rename from contrib/autoboost/boost/asio/basic_socket_iostream.hpp rename to contrib/autoboost/autoboost/asio/basic_socket_iostream.hpp index 0265a186a..0f86ac2ed 100644 --- a/contrib/autoboost/boost/asio/basic_socket_iostream.hpp +++ b/contrib/autoboost/autoboost/asio/basic_socket_iostream.hpp @@ -8,25 +8,25 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_ASIO_BASIC_SOCKET_IOSTREAM_HPP -#define BOOST_ASIO_BASIC_SOCKET_IOSTREAM_HPP +#ifndef AUTOBOOST_ASIO_BASIC_SOCKET_IOSTREAM_HPP +#define AUTOBOOST_ASIO_BASIC_SOCKET_IOSTREAM_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) -#include +#include -#if !defined(BOOST_ASIO_NO_IOSTREAM) +#if !defined(AUTOBOOST_ASIO_NO_IOSTREAM) #include #include -#include -#include +#include +#include -#if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) +#if !defined(AUTOBOOST_ASIO_HAS_VARIADIC_TEMPLATES) -# include +# include // A macro that should expand to: // template @@ -41,16 +41,16 @@ // } // This macro should only persist within this file. -# define BOOST_ASIO_PRIVATE_CTR_DEF(n) \ - template \ - explicit basic_socket_iostream(BOOST_ASIO_VARIADIC_PARAMS(n)) \ +# define AUTOBOOST_ASIO_PRIVATE_CTR_DEF(n) \ + template \ + explicit basic_socket_iostream(AUTOBOOST_ASIO_VARIADIC_PARAMS(n)) \ : std::basic_iostream( \ &this->detail::socket_iostream_base< \ Protocol, StreamSocketService, Time, \ TimeTraits, TimerService>::streambuf_) \ { \ this->setf(std::ios_base::unitbuf); \ - if (rdbuf()->connect(BOOST_ASIO_VARIADIC_ARGS(n)) == 0) \ + if (rdbuf()->connect(AUTOBOOST_ASIO_VARIADIC_ARGS(n)) == 0) \ this->setstate(std::ios_base::failbit); \ } \ /**/ @@ -64,18 +64,18 @@ // } // This macro should only persist within this file. -# define BOOST_ASIO_PRIVATE_CONNECT_DEF(n) \ - template \ - void connect(BOOST_ASIO_VARIADIC_PARAMS(n)) \ +# define AUTOBOOST_ASIO_PRIVATE_CONNECT_DEF(n) \ + template \ + void connect(AUTOBOOST_ASIO_VARIADIC_PARAMS(n)) \ { \ - if (rdbuf()->connect(BOOST_ASIO_VARIADIC_ARGS(n)) == 0) \ + if (rdbuf()->connect(AUTOBOOST_ASIO_VARIADIC_ARGS(n)) == 0) \ this->setstate(std::ios_base::failbit); \ } \ /**/ -#endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) +#endif // !defined(AUTOBOOST_ASIO_HAS_VARIADIC_TEMPLATES) -#include +#include namespace autoboost { namespace asio { @@ -97,7 +97,7 @@ class socket_iostream_base /// Iostream interface for a socket. template , -#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \ +#if defined(AUTOBOOST_ASIO_HAS_AUTOBOOST_DATE_TIME) \ || defined(GENERATING_DOCUMENTATION) typename Time = autoboost::posix_time::ptime, typename TimeTraits = autoboost::asio::time_traits alloc_traits; \ typedef typename alloc_traits::size_type size_type; \ typedef typename alloc_traits::value_type value_type; \ \ - explicit BOOST_PP_CAT(insert_non_movable_emplace_proxy_arg, N) \ - ( BOOST_PP_ENUM(N, BOOST_CONTAINER_PP_PARAM_LIST, _) ) \ - BOOST_PP_EXPR_IF(N, :) BOOST_PP_ENUM(N, BOOST_CONTAINER_PP_PARAM_INIT, _) \ + explicit AUTOBOOST_PP_CAT(insert_non_movable_emplace_proxy_arg, N) \ + ( AUTOBOOST_PP_ENUM(N, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _) ) \ + AUTOBOOST_PP_EXPR_IF(N, :) AUTOBOOST_PP_ENUM(N, AUTOBOOST_CONTAINER_PP_PARAM_INIT, _) \ {} \ \ void uninitialized_copy_n_and_update(A &a, Iterator p, size_type n) \ { \ - BOOST_ASSERT(n == 1); (void)n; \ + AUTOBOOST_ASSERT(n == 1); (void)n; \ alloc_traits::construct \ ( a, iterator_to_raw_pointer(p) \ - BOOST_PP_ENUM_TRAILING(N, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) \ + AUTOBOOST_PP_ENUM_TRAILING(N, AUTOBOOST_CONTAINER_PP_MEMBER_FORWARD, _) \ ); \ } \ \ void copy_n_and_update(A &, Iterator, size_type) \ - { BOOST_ASSERT(false); } \ + { AUTOBOOST_ASSERT(false); } \ \ protected: \ - BOOST_PP_REPEAT(N, BOOST_CONTAINER_PP_PARAM_DEFINE, _) \ + AUTOBOOST_PP_REPEAT(N, AUTOBOOST_CONTAINER_PP_PARAM_DEFINE, _) \ }; \ \ -template \ -struct BOOST_PP_CAT(insert_emplace_proxy_arg, N) \ - : BOOST_PP_CAT(insert_non_movable_emplace_proxy_arg, N) \ - < A, Iterator BOOST_PP_ENUM_TRAILING_PARAMS(N, P) > \ +template \ +struct AUTOBOOST_PP_CAT(insert_emplace_proxy_arg, N) \ + : AUTOBOOST_PP_CAT(insert_non_movable_emplace_proxy_arg, N) \ + < A, Iterator AUTOBOOST_PP_ENUM_TRAILING_PARAMS(N, P) > \ { \ - typedef BOOST_PP_CAT(insert_non_movable_emplace_proxy_arg, N) \ - base_t; \ + typedef AUTOBOOST_PP_CAT(insert_non_movable_emplace_proxy_arg, N) \ + base_t; \ typedef typename base_t::value_type value_type; \ typedef typename base_t::size_type size_type; \ typedef autoboost::container::allocator_traits alloc_traits; \ \ - explicit BOOST_PP_CAT(insert_emplace_proxy_arg, N) \ - ( BOOST_PP_ENUM(N, BOOST_CONTAINER_PP_PARAM_LIST, _) ) \ - : base_t(BOOST_PP_ENUM(N, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ) \ + explicit AUTOBOOST_PP_CAT(insert_emplace_proxy_arg, N) \ + ( AUTOBOOST_PP_ENUM(N, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _) ) \ + : base_t(AUTOBOOST_PP_ENUM(N, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _) ) \ {} \ \ void copy_n_and_update(A &a, Iterator p, size_type n) \ { \ - BOOST_ASSERT(n == 1); (void)n; \ + AUTOBOOST_ASSERT(n == 1); (void)n; \ aligned_storage::value> v; \ value_type *vp = static_cast(static_cast(&v)); \ alloc_traits::construct(a, vp \ - BOOST_PP_ENUM_TRAILING(N, BOOST_CONTAINER_PP_MEMBER_FORWARD, _)); \ - BOOST_TRY{ \ + AUTOBOOST_PP_ENUM_TRAILING(N, AUTOBOOST_CONTAINER_PP_MEMBER_FORWARD, _)); \ + AUTOBOOST_TRY{ \ *p = ::autoboost::move(*vp); \ } \ - BOOST_CATCH(...){ \ + AUTOBOOST_CATCH(...){ \ alloc_traits::destroy(a, vp); \ - BOOST_RETHROW \ + AUTOBOOST_RETHROW \ } \ - BOOST_CATCH_END \ + AUTOBOOST_CATCH_END \ alloc_traits::destroy(a, vp); \ } \ }; \ //! -#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) -#include BOOST_PP_LOCAL_ITERATE() +#define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) +#include AUTOBOOST_PP_LOCAL_ITERATE() -#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#if defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) //Specializations to avoid an unneeded temporary when emplacing from a single argument o type value_type template @@ -433,7 +433,7 @@ struct insert_emplace_proxy_arg1 struct insert_emplace_proxy_arg1 +#include -#endif //#ifndef BOOST_CONTAINER_ADVANCED_INSERT_INT_HPP +#endif //#ifndef AUTOBOOST_CONTAINER_ADVANCED_INSERT_INT_HPP diff --git a/contrib/autoboost/boost/container/detail/algorithms.hpp b/contrib/autoboost/autoboost/container/detail/algorithms.hpp similarity index 77% rename from contrib/autoboost/boost/container/detail/algorithms.hpp rename to contrib/autoboost/autoboost/container/detail/algorithms.hpp index e894a94c6..81453673e 100644 --- a/contrib/autoboost/boost/container/detail/algorithms.hpp +++ b/contrib/autoboost/autoboost/container/detail/algorithms.hpp @@ -10,17 +10,17 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP -#define BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP +#ifndef AUTOBOOST_CONTAINER_DETAIL_ALGORITHMS_HPP +#define AUTOBOOST_CONTAINER_DETAIL_ALGORITHMS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { namespace container { @@ -56,7 +56,7 @@ inline void construct_in_place(A &a, T *dest, emplace_iterator ei) } //namespace container { } //namespace autoboost { -#include +#include -#endif //#ifndef BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_ALGORITHMS_HPP diff --git a/contrib/autoboost/boost/container/detail/allocation_type.hpp b/contrib/autoboost/autoboost/container/detail/allocation_type.hpp similarity index 79% rename from contrib/autoboost/boost/container/detail/allocation_type.hpp rename to contrib/autoboost/autoboost/container/detail/allocation_type.hpp index 5f7d57702..e780588ce 100644 --- a/contrib/autoboost/boost/container/detail/allocation_type.hpp +++ b/contrib/autoboost/autoboost/container/detail/allocation_type.hpp @@ -8,20 +8,20 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_CONTAINER_ALLOCATION_TYPE_HPP -#define BOOST_CONTAINER_ALLOCATION_TYPE_HPP +#ifndef AUTOBOOST_CONTAINER_ALLOCATION_TYPE_HPP +#define AUTOBOOST_CONTAINER_ALLOCATION_TYPE_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include +#include +#include namespace autoboost { namespace container { -#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED enum allocation_type_v { // constants for allocation commands @@ -37,7 +37,7 @@ enum allocation_type_v }; typedef int allocation_type; -#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED static const allocation_type allocate_new = (allocation_type)allocate_new_v; static const allocation_type expand_fwd = (allocation_type)expand_fwd_v; static const allocation_type expand_bwd = (allocation_type)expand_bwd_v; @@ -49,6 +49,6 @@ static const allocation_type zero_memory = (allocation_type)zero_memory_v } //namespace container { } //namespace autoboost { -#include +#include -#endif //BOOST_CONTAINER_ALLOCATION_TYPE_HPP +#endif //AUTOBOOST_CONTAINER_ALLOCATION_TYPE_HPP diff --git a/contrib/autoboost/boost/container/detail/allocator_version_traits.hpp b/contrib/autoboost/autoboost/container/detail/allocator_version_traits.hpp similarity index 81% rename from contrib/autoboost/boost/container/detail/allocator_version_traits.hpp rename to contrib/autoboost/autoboost/container/detail/allocator_version_traits.hpp index 932735f79..a9821652c 100644 --- a/contrib/autoboost/boost/container/detail/allocator_version_traits.hpp +++ b/contrib/autoboost/autoboost/container/detail/allocator_version_traits.hpp @@ -8,25 +8,25 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP -#define BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP +#ifndef AUTOBOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP +#define AUTOBOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include +#include +#include -#include //allocator_traits -#include -#include //multiallocation_chain -#include //version_type -#include //allocation_type -#include //integral_constant -#include //pointer_traits +#include //allocator_traits +#include +#include //multiallocation_chain +#include //version_type +#include //allocation_type +#include //integral_constant +#include //pointer_traits #include //pair -#include //BOOST_TRY +#include //AUTOBOOST_TRY namespace autoboost { namespace container { @@ -145,15 +145,15 @@ struct allocator_version_traits } else{ received_size = preferred_size; - BOOST_TRY{ + AUTOBOOST_TRY{ ret.first = a.allocate(received_size); } - BOOST_CATCH(...){ + AUTOBOOST_CATCH(...){ if(!(command & nothrow_allocation)){ - BOOST_RETHROW + AUTOBOOST_RETHROW } } - BOOST_CATCH_END + AUTOBOOST_CATCH_END } return ret; } @@ -163,6 +163,6 @@ struct allocator_version_traits } //namespace container { } //namespace autoboost { -#include +#include -#endif // ! defined(BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP) +#endif // ! defined(AUTOBOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP) diff --git a/contrib/autoboost/autoboost/container/detail/config_begin.hpp b/contrib/autoboost/autoboost/container/detail/config_begin.hpp new file mode 100644 index 000000000..407b7839f --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/config_begin.hpp @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#ifndef AUTOBOOST_CONTAINER_CONTAINER_DETAIL_CONFIG_INCLUDED +#define AUTOBOOST_CONTAINER_CONTAINER_DETAIL_CONFIG_INCLUDED +#ifndef AUTOBOOST_CONFIG_HPP +#include +#endif + +#endif //AUTOBOOST_CONTAINER_CONTAINER_DETAIL_CONFIG_INCLUDED + +#ifdef AUTOBOOST_MSVC + #pragma warning (push) + #pragma warning (disable : 4702) // unreachable code + #pragma warning (disable : 4706) // assignment within conditional expression + #pragma warning (disable : 4127) // conditional expression is constant + #pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned + #pragma warning (disable : 4284) // odd return type for operator-> + #pragma warning (disable : 4244) // possible loss of data + #pragma warning (disable : 4251) // "identifier" : class "type" needs to have dll-interface to be used by clients of class "type2" + #pragma warning (disable : 4267) // conversion from "X" to "Y", possible loss of data + #pragma warning (disable : 4275) // non DLL-interface classkey "identifier" used as base for DLL-interface classkey "identifier" + #pragma warning (disable : 4355) // "this" : used in base member initializer list + #pragma warning (disable : 4503) // "identifier" : decorated name length exceeded, name was truncated + #pragma warning (disable : 4511) // copy constructor could not be generated + #pragma warning (disable : 4512) // assignment operator could not be generated + #pragma warning (disable : 4514) // unreferenced inline removed + #pragma warning (disable : 4521) // Disable "multiple copy constructors specified" + #pragma warning (disable : 4522) // "class" : multiple assignment operators specified + #pragma warning (disable : 4675) // "method" should be declared "static" and have exactly one parameter + #pragma warning (disable : 4710) // function not inlined + #pragma warning (disable : 4711) // function selected for automatic inline expansion + #pragma warning (disable : 4786) // identifier truncated in debug info + #pragma warning (disable : 4996) // "function": was declared deprecated + #pragma warning (disable : 4197) // top-level volatile in cast is ignored + #pragma warning (disable : 4541) // 'typeid' used on polymorphic type 'autoboost::exception' + // with /GR-; unpredictable behavior may result + #pragma warning (disable : 4673) // throwing '' the following types will not be considered at the catch site + #pragma warning (disable : 4671) // the copy constructor is inaccessible + #pragma warning (disable : 4584) // X is already a base-class of Y + #pragma warning (disable : 4510) // default constructor could not be generated +#endif //AUTOBOOST_MSVC diff --git a/contrib/autoboost/autoboost/container/detail/config_end.hpp b/contrib/autoboost/autoboost/container/detail/config_end.hpp new file mode 100644 index 000000000..cd73c868b --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/config_end.hpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#if defined AUTOBOOST_MSVC + #pragma warning (pop) +#endif + diff --git a/contrib/autoboost/boost/container/detail/destroyers.hpp b/contrib/autoboost/autoboost/container/detail/destroyers.hpp similarity index 94% rename from contrib/autoboost/boost/container/detail/destroyers.hpp rename to contrib/autoboost/autoboost/container/detail/destroyers.hpp index 606fa1d82..6613473c4 100644 --- a/contrib/autoboost/boost/container/detail/destroyers.hpp +++ b/contrib/autoboost/autoboost/container/detail/destroyers.hpp @@ -10,19 +10,19 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_CONTAINER_DESTROYERS_HPP -#define BOOST_CONTAINER_DESTROYERS_HPP +#ifndef AUTOBOOST_CONTAINER_DESTROYERS_HPP +#define AUTOBOOST_CONTAINER_DESTROYERS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include namespace autoboost { namespace container { @@ -48,7 +48,7 @@ struct scoped_deallocator void priv_deallocate(allocator_v2) { m_alloc.deallocate_one(m_ptr); } - BOOST_MOVABLE_BUT_NOT_COPYABLE(scoped_deallocator) + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(scoped_deallocator) public: @@ -62,7 +62,7 @@ struct scoped_deallocator ~scoped_deallocator() { if (m_ptr)priv_deallocate(alloc_version()); } - scoped_deallocator(BOOST_RV_REF(scoped_deallocator) o) + scoped_deallocator(AUTOBOOST_RV_REF(scoped_deallocator) o) : m_ptr(o.m_ptr), m_alloc(o.m_alloc) { o.release(); } @@ -375,6 +375,6 @@ class allocator_multialloc_chain_node_deallocator } //namespace container { } //namespace autoboost { -#include +#include -#endif //#ifndef BOOST_CONTAINER_DESTROYERS_HPP +#endif //#ifndef AUTOBOOST_CONTAINER_DESTROYERS_HPP diff --git a/contrib/autoboost/boost/container/detail/iterators.hpp b/contrib/autoboost/autoboost/container/detail/iterators.hpp similarity index 89% rename from contrib/autoboost/boost/container/detail/iterators.hpp rename to contrib/autoboost/autoboost/container/detail/iterators.hpp index 545467f88..f2580e23a 100644 --- a/contrib/autoboost/boost/container/detail/iterators.hpp +++ b/contrib/autoboost/autoboost/container/detail/iterators.hpp @@ -11,25 +11,25 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_CONTAINER_DETAIL_ITERATORS_HPP -#define BOOST_CONTAINER_DETAIL_ITERATORS_HPP +#ifndef AUTOBOOST_CONTAINER_DETAIL_ITERATORS_HPP +#define AUTOBOOST_CONTAINER_DETAIL_ITERATORS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -#ifdef BOOST_CONTAINER_PERFECT_FORWARDING -#include +#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING +#include #else -#include +#include #endif #include @@ -597,7 +597,7 @@ class emplace_iterator { return difference_type(m_num - other.m_num); } }; -#ifdef BOOST_CONTAINER_PERFECT_FORWARDING +#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING template struct emplace_functor @@ -622,29 +622,29 @@ struct emplace_functor container_detail::tuple args_; }; -#else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING +#else //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING -#define BOOST_PP_LOCAL_MACRO(n) \ - BOOST_PP_EXPR_IF(n, template <) \ - BOOST_PP_ENUM_PARAMS(n, class P) \ - BOOST_PP_EXPR_IF(n, >) \ - struct BOOST_PP_CAT(BOOST_PP_CAT(emplace_functor, n), arg) \ +#define AUTOBOOST_PP_LOCAL_MACRO(n) \ + AUTOBOOST_PP_EXPR_IF(n, template <) \ + AUTOBOOST_PP_ENUM_PARAMS(n, class P) \ + AUTOBOOST_PP_EXPR_IF(n, >) \ + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(emplace_functor, n), arg) \ { \ - BOOST_PP_CAT(BOOST_PP_CAT(emplace_functor, n), arg) \ - ( BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _) ) \ - BOOST_PP_EXPR_IF(n, :) BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_INIT, _){} \ + AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(emplace_functor, n), arg) \ + ( AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _) ) \ + AUTOBOOST_PP_EXPR_IF(n, :) AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_INIT, _){} \ \ template \ void operator()(A &a, T *ptr) \ { \ allocator_traits::construct \ - (a, ptr BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) ); \ + (a, ptr AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_MEMBER_FORWARD, _) ); \ } \ - BOOST_PP_REPEAT(n, BOOST_CONTAINER_PP_PARAM_DEFINE, _) \ + AUTOBOOST_PP_REPEAT(n, AUTOBOOST_CONTAINER_PP_PARAM_DEFINE, _) \ }; \ //! -#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) -#include BOOST_PP_LOCAL_ITERATE() +#define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) +#include AUTOBOOST_PP_LOCAL_ITERATE() #endif @@ -759,51 +759,51 @@ class iterator iterator() {} - explicit iterator(IIterator iit) BOOST_CONTAINER_NOEXCEPT + explicit iterator(IIterator iit) AUTOBOOST_CONTAINER_NOEXCEPT : m_iit(iit) {} - iterator(iterator const& other) BOOST_CONTAINER_NOEXCEPT + iterator(iterator const& other) AUTOBOOST_CONTAINER_NOEXCEPT : m_iit(other.get()) {} - iterator& operator++() BOOST_CONTAINER_NOEXCEPT + iterator& operator++() AUTOBOOST_CONTAINER_NOEXCEPT { ++this->m_iit; return *this; } - iterator operator++(int) BOOST_CONTAINER_NOEXCEPT + iterator operator++(int) AUTOBOOST_CONTAINER_NOEXCEPT { iterator result (*this); ++this->m_iit; return result; } - iterator& operator--() BOOST_CONTAINER_NOEXCEPT + iterator& operator--() AUTOBOOST_CONTAINER_NOEXCEPT { //If the iterator is not a bidirectional iterator, operator-- should not exist - BOOST_STATIC_ASSERT((is_bidirectional_iterator::value)); + AUTOBOOST_STATIC_ASSERT((is_bidirectional_iterator::value)); --this->m_iit; return *this; } - iterator operator--(int) BOOST_CONTAINER_NOEXCEPT + iterator operator--(int) AUTOBOOST_CONTAINER_NOEXCEPT { iterator result (*this); --this->m_iit; return result; } - friend bool operator== (const iterator& l, const iterator& r) BOOST_CONTAINER_NOEXCEPT + friend bool operator== (const iterator& l, const iterator& r) AUTOBOOST_CONTAINER_NOEXCEPT { return l.m_iit == r.m_iit; } - friend bool operator!= (const iterator& l, const iterator& r) BOOST_CONTAINER_NOEXCEPT + friend bool operator!= (const iterator& l, const iterator& r) AUTOBOOST_CONTAINER_NOEXCEPT { return !(l == r); } - reference operator*() const BOOST_CONTAINER_NOEXCEPT + reference operator*() const AUTOBOOST_CONTAINER_NOEXCEPT { return (*this->m_iit).get_data(); } - pointer operator->() const BOOST_CONTAINER_NOEXCEPT + pointer operator->() const AUTOBOOST_CONTAINER_NOEXCEPT { return ::autoboost::intrusive::pointer_traits::pointer_to(this->operator*()); } - const IIterator &get() const BOOST_CONTAINER_NOEXCEPT + const IIterator &get() const AUTOBOOST_CONTAINER_NOEXCEPT { return this->m_iit; } private: @@ -816,6 +816,6 @@ using ::autoboost::intrusive::detail::reverse_iterator; } //namespace container { } //namespace autoboost { -#include +#include -#endif //#ifndef BOOST_CONTAINER_DETAIL_ITERATORS_HPP +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_ITERATORS_HPP diff --git a/contrib/autoboost/autoboost/container/detail/memory_util.hpp b/contrib/autoboost/autoboost/container/detail/memory_util.hpp new file mode 100644 index 000000000..6a4d41657 --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/memory_util.hpp @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2011-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_ALLOCATOR_MEMORY_UTIL_HPP +#define AUTOBOOST_CONTAINER_ALLOCATOR_MEMORY_UTIL_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include + + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME allocate +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace container { namespace container_detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (2, 2, )) +#include AUTOBOOST_PP_ITERATE() + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME destroy +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace container { namespace container_detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (1, 1, )) +#include AUTOBOOST_PP_ITERATE() + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME max_size +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace container { namespace container_detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, )) +#include AUTOBOOST_PP_ITERATE() + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME select_on_container_copy_construction +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace container { namespace container_detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, )) +#include AUTOBOOST_PP_ITERATE() + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME construct +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace container { namespace container_detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#ifdef AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_SINGLE_ITERATION +# define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (1, 1, )) +#else +# define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (1, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS+1, )) +#endif +#include AUTOBOOST_PP_ITERATE() + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME swap +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace container { namespace container_detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (1, 1, )) +#include AUTOBOOST_PP_ITERATE() + +namespace autoboost { +namespace container { +namespace container_detail { + +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(pointer) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(const_pointer) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(reference) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(const_reference) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(void_pointer) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(const_void_pointer) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(size_type) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(propagate_on_container_copy_assignment) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(propagate_on_container_move_assignment) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(propagate_on_container_swap) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(difference_type) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(value_compare) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(wrapped_value_compare) + +} //namespace container_detail { +} //namespace container { +} //namespace autoboost { + +#include + +#endif // ! defined(AUTOBOOST_CONTAINER_ALLOCATOR_MEMORY_UTIL_HPP) diff --git a/contrib/autoboost/autoboost/container/detail/mpl.hpp b/contrib/autoboost/autoboost/container/detail/mpl.hpp new file mode 100644 index 000000000..0e97fbb8d --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/mpl.hpp @@ -0,0 +1,183 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. +// +// 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP +#define AUTOBOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include + +namespace autoboost { +namespace container { +namespace container_detail { + +template +struct integral_constant +{ + static const T value = val; + typedef integral_constant type; +}; + +template< bool C_ > +struct bool_ : integral_constant +{ + static const bool value = C_; + operator bool() const { return bool_::value; } +}; + +typedef bool_ true_; +typedef bool_ false_; + +typedef true_ true_type; +typedef false_ false_type; + +typedef char yes_type; +struct no_type +{ + char padding[8]; +}; + +template +struct enable_if_c { + typedef T type; +}; + +template +struct enable_if_c {}; + +template +struct enable_if : public enable_if_c {}; + +template +struct disable_if : public enable_if_c {}; + +template +struct disable_if_c : public enable_if_c {}; + +#if defined(_MSC_VER) && (_MSC_VER >= 1400) + +template +struct is_convertible +{ + static const bool value = __is_convertible_to(T, U); +}; + +#else + +template +class is_convertible +{ + typedef char true_t; + class false_t { char dummy[2]; }; + //use any_conversion as first parameter since in MSVC + //overaligned types can't go through ellipsis + static false_t dispatch(...); + static true_t dispatch(U); + static T &trigger(); + public: + static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t); +}; + +#endif + +template< + bool C + , typename T1 + , typename T2 + > +struct if_c +{ + typedef T1 type; +}; + +template< + typename T1 + , typename T2 + > +struct if_c +{ + typedef T2 type; +}; + +template< + typename T1 + , typename T2 + , typename T3 + > +struct if_ +{ + typedef typename if_c<0 != T1::value, T2, T3>::type type; +}; + + +template +struct select1st +{ + typedef Pair argument_type; + typedef typename Pair::first_type result_type; + + template + const typename Pair::first_type& operator()(const OtherPair& x) const + { return x.first; } + + const typename Pair::first_type& operator()(const typename Pair::first_type& x) const + { return x; } +}; + +// identity is an extension: it is not part of the standard. +template +struct identity +{ + typedef T argument_type; + typedef T result_type; + + typedef T type; + const T& operator()(const T& x) const + { return x; } +}; + +template +struct ls_zeros +{ + static const std::size_t value = (S & std::size_t(1)) ? 0 : (1u + ls_zeros<(S >> 1u)>::value); +}; + +template<> +struct ls_zeros<0> +{ + static const std::size_t value = 0; +}; + +template<> +struct ls_zeros<1> +{ + static const std::size_t value = 0; +}; + +template struct unvoid { typedef T type; }; +template <> struct unvoid { struct type { }; }; +template <> struct unvoid { struct type { }; }; + +} //namespace container_detail { +} //namespace container { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP + diff --git a/contrib/autoboost/boost/container/detail/multiallocation_chain.hpp b/contrib/autoboost/autoboost/container/detail/multiallocation_chain.hpp similarity index 86% rename from contrib/autoboost/boost/container/detail/multiallocation_chain.hpp rename to contrib/autoboost/autoboost/container/detail/multiallocation_chain.hpp index 98cb23978..21d6c5217 100644 --- a/contrib/autoboost/boost/container/detail/multiallocation_chain.hpp +++ b/contrib/autoboost/autoboost/container/detail/multiallocation_chain.hpp @@ -8,24 +8,24 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP -#define BOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP +#ifndef AUTOBOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP +#define AUTOBOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace autoboost { namespace container { @@ -65,7 +65,7 @@ class basic_multiallocation_chain static node_ptr to_node_ptr(const VoidPointer &p) { return node_ptr_traits::static_cast_from(p); } - BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_multiallocation_chain) + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(basic_multiallocation_chain) public: @@ -81,11 +81,11 @@ class basic_multiallocation_chain : slist_impl_(to_node_ptr(b), to_node_ptr(before_e), n) {} - basic_multiallocation_chain(BOOST_RV_REF(basic_multiallocation_chain) other) + basic_multiallocation_chain(AUTOBOOST_RV_REF(basic_multiallocation_chain) other) : slist_impl_(::autoboost::move(other.slist_impl_)) {} - basic_multiallocation_chain& operator=(BOOST_RV_REF(basic_multiallocation_chain) other) + basic_multiallocation_chain& operator=(AUTOBOOST_RV_REF(basic_multiallocation_chain) other) { slist_impl_ = ::autoboost::move(other.slist_impl_); return *this; @@ -187,7 +187,7 @@ class transform_multiallocation_chain : public MultiallocationChain { private: - BOOST_MOVABLE_BUT_NOT_COPYABLE(transform_multiallocation_chain) + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(transform_multiallocation_chain) //transform_multiallocation_chain(const transform_multiallocation_chain &); //transform_multiallocation_chain & operator=(const transform_multiallocation_chain &); @@ -212,15 +212,15 @@ class transform_multiallocation_chain : MultiallocationChain() {} - transform_multiallocation_chain(BOOST_RV_REF(transform_multiallocation_chain) other) + transform_multiallocation_chain(AUTOBOOST_RV_REF(transform_multiallocation_chain) other) : MultiallocationChain(::autoboost::move(static_cast(other))) {} - transform_multiallocation_chain(BOOST_RV_REF(MultiallocationChain) other) + transform_multiallocation_chain(AUTOBOOST_RV_REF(MultiallocationChain) other) : MultiallocationChain(::autoboost::move(static_cast(other))) {} - transform_multiallocation_chain& operator=(BOOST_RV_REF(transform_multiallocation_chain) other) + transform_multiallocation_chain& operator=(AUTOBOOST_RV_REF(transform_multiallocation_chain) other) { return static_cast (this->MultiallocationChain::operator=(::autoboost::move(static_cast(other)))); @@ -287,6 +287,6 @@ class transform_multiallocation_chain // namespace container { // namespace autoboost { -#include +#include -#endif //BOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP +#endif //AUTOBOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP diff --git a/contrib/autoboost/autoboost/container/detail/node_alloc_holder.hpp b/contrib/autoboost/autoboost/container/detail/node_alloc_holder.hpp new file mode 100644 index 000000000..89f3e1bfa --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/node_alloc_holder.hpp @@ -0,0 +1,399 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_DETAIL_NODE_ALLOC_HPP_ +#define AUTOBOOST_CONTAINER_DETAIL_NODE_ALLOC_HPP_ + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AUTOBOOST_CONTAINER_PERFECT_FORWARDING +#include +#endif + +#include + + + +namespace autoboost { +namespace container { +namespace container_detail { + +template +struct node_compare + : private ValueCompare +{ + typedef ValueCompare wrapped_value_compare; + typedef typename wrapped_value_compare::key_type key_type; + typedef typename wrapped_value_compare::value_type value_type; + typedef typename wrapped_value_compare::key_of_value key_of_value; + + explicit node_compare(const wrapped_value_compare &pred) + : wrapped_value_compare(pred) + {} + + node_compare() + : wrapped_value_compare() + {} + + wrapped_value_compare &value_comp() + { return static_cast(*this); } + + wrapped_value_compare &value_comp() const + { return static_cast(*this); } + + bool operator()(const Node &a, const Node &b) const + { return wrapped_value_compare::operator()(a.get_data(), b.get_data()); } +}; + +template +struct node_alloc_holder +{ + //If the intrusive container is an associative container, obtain the predicate, which will + //be of type node_compare<>. If not an associative container value_compare will be a "nat" type. + typedef AUTOBOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(autoboost::container::container_detail::, ICont, + value_compare, container_detail::nat) intrusive_value_compare; + //In that case obtain the value predicate from the node predicate via wrapped_value_compare + //if intrusive_value_compare is node_compare<>, nat otherwise + typedef AUTOBOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(autoboost::container::container_detail::, ICont, + wrapped_value_compare, container_detail::nat) value_compare; + + typedef allocator_traits allocator_traits_type; + typedef typename allocator_traits_type::value_type value_type; + typedef ICont intrusive_container; + typedef typename ICont::value_type Node; + typedef typename allocator_traits_type::template + portable_rebind_alloc::type NodeAlloc; + typedef allocator_traits node_allocator_traits_type; + typedef container_detail::allocator_version_traits node_allocator_version_traits_type; + typedef A ValAlloc; + typedef typename node_allocator_traits_type::pointer NodePtr; + typedef container_detail::scoped_deallocator Deallocator; + typedef typename node_allocator_traits_type::size_type size_type; + typedef typename node_allocator_traits_type::difference_type difference_type; + typedef container_detail::integral_constant allocator_v1; + typedef container_detail::integral_constant allocator_v2; + typedef container_detail::integral_constant::value> alloc_version; + typedef typename ICont::iterator icont_iterator; + typedef typename ICont::const_iterator icont_citerator; + typedef allocator_destroyer Destroyer; + typedef allocator_traits NodeAllocTraits; + typedef allocator_version_traits AllocVersionTraits; + + private: + AUTOBOOST_COPYABLE_AND_MOVABLE(node_alloc_holder) + + public: + + //Constructors for sequence containers + node_alloc_holder() + : members_() + {} + + explicit node_alloc_holder(const ValAlloc &a) + : members_(a) + {} + + explicit node_alloc_holder(const node_alloc_holder &x) + : members_(NodeAllocTraits::select_on_container_copy_construction(x.node_alloc())) + {} + + explicit node_alloc_holder(AUTOBOOST_RV_REF(node_alloc_holder) x) + : members_(autoboost::move(x.node_alloc())) + { this->icont().swap(x.icont()); } + + //Constructors for associative containers + explicit node_alloc_holder(const ValAlloc &a, const value_compare &c) + : members_(a, c) + {} + + explicit node_alloc_holder(const node_alloc_holder &x, const value_compare &c) + : members_(NodeAllocTraits::select_on_container_copy_construction(x.node_alloc()), c) + {} + + explicit node_alloc_holder(const value_compare &c) + : members_(c) + {} + + //helpers for move assignments + explicit node_alloc_holder(AUTOBOOST_RV_REF(node_alloc_holder) x, const value_compare &c) + : members_(autoboost::move(x.node_alloc()), c) + { this->icont().swap(x.icont()); } + + void copy_assign_alloc(const node_alloc_holder &x) + { + container_detail::bool_ flag; + container_detail::assign_alloc( static_cast(this->members_) + , static_cast(x.members_), flag); + } + + void move_assign_alloc( node_alloc_holder &x) + { + container_detail::bool_ flag; + container_detail::move_alloc( static_cast(this->members_) + , static_cast(x.members_), flag); + } + + ~node_alloc_holder() + { this->clear(alloc_version()); } + + size_type max_size() const + { return allocator_traits_type::max_size(this->node_alloc()); } + + NodePtr allocate_one() + { return AllocVersionTraits::allocate_one(this->node_alloc()); } + + void deallocate_one(const NodePtr &p) + { AllocVersionTraits::deallocate_one(this->node_alloc(), p); } + + #ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + template + NodePtr create_node(Args &&...args) + { + NodePtr p = this->allocate_one(); + Deallocator node_deallocator(p, this->node_alloc()); + allocator_traits::construct + ( this->node_alloc() + , container_detail::addressof(p->m_data), autoboost::forward(args)...); + node_deallocator.release(); + //This does not throw + typedef typename Node::hook_type hook_type; + ::new(static_cast(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type; + return (p); + } + + #else //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + NodePtr create_node(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + NodePtr p = this->allocate_one(); \ + Deallocator node_deallocator(p, this->node_alloc()); \ + allocator_traits::construct \ + (this->node_alloc(), container_detail::addressof(p->m_data) \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ + node_deallocator.release(); \ + typedef typename Node::hook_type hook_type; \ + ::new(static_cast(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type; \ + return (p); \ + } \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + template + NodePtr create_node_from_it(const It &it) + { + NodePtr p = this->allocate_one(); + Deallocator node_deallocator(p, this->node_alloc()); + ::autoboost::container::construct_in_place(this->node_alloc(), container_detail::addressof(p->m_data), it); + node_deallocator.release(); + //This does not throw + typedef typename Node::hook_type hook_type; + ::new(static_cast(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type; + return (p); + } + + void destroy_node(const NodePtr &nodep) + { + allocator_traits::destroy(this->node_alloc(), container_detail::to_raw_pointer(nodep)); + this->deallocate_one(nodep); + } + + void swap(node_alloc_holder &x) + { + this->icont().swap(x.icont()); + container_detail::bool_ flag; + container_detail::swap_alloc(this->node_alloc(), x.node_alloc(), flag); + } + + template + void allocate_many_and_construct + (FwdIterator beg, difference_type n, Inserter inserter) + { + if(n){ + typedef typename node_allocator_version_traits_type::multiallocation_chain multiallocation_chain; + + //Try to allocate memory in a single block + typedef typename multiallocation_chain::iterator multialloc_iterator; + multiallocation_chain mem; + NodeAlloc &nalloc = this->node_alloc(); + node_allocator_version_traits_type::allocate_individual(nalloc, n, mem); + multialloc_iterator itbeg(mem.begin()), itlast(mem.last()); + mem.clear(); + Node *p = 0; + AUTOBOOST_TRY{ + Deallocator node_deallocator(NodePtr(), nalloc); + container_detail::scoped_destructor sdestructor(nalloc, 0); + while(n--){ + p = container_detail::to_raw_pointer(iterator_to_pointer(itbeg)); + node_deallocator.set(p); + ++itbeg; + //This can throw + autoboost::container::construct_in_place(nalloc, container_detail::addressof(p->m_data), beg); + sdestructor.set(p); + ++beg; + //This does not throw + typedef typename Node::hook_type hook_type; + ::new(static_cast(p), boost_container_new_t()) hook_type; + //This can throw in some containers (predicate might throw). + //(sdestructor will destruct the node and node_deallocator will deallocate it in case of exception) + inserter(*p); + sdestructor.set(0); + } + sdestructor.release(); + node_deallocator.release(); + } + AUTOBOOST_CATCH(...){ + mem.incorporate_after(mem.last(), &*itbeg, &*itlast, n); + node_allocator_version_traits_type::deallocate_individual(this->node_alloc(), mem); + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + } + } + + void clear(allocator_v1) + { this->icont().clear_and_dispose(Destroyer(this->node_alloc())); } + + void clear(allocator_v2) + { + typename NodeAlloc::multiallocation_chain chain; + allocator_destroyer_and_chain_builder builder(this->node_alloc(), chain); + this->icont().clear_and_dispose(builder); + //AUTOBOOST_STATIC_ASSERT((::autoboost::has_move_emulation_enabled::value == true)); + if(!chain.empty()) + this->node_alloc().deallocate_individual(chain); + } + + icont_iterator erase_range(const icont_iterator &first, const icont_iterator &last, allocator_v1) + { return this->icont().erase_and_dispose(first, last, Destroyer(this->node_alloc())); } + + icont_iterator erase_range(const icont_iterator &first, const icont_iterator &last, allocator_v2) + { + typedef typename NodeAlloc::multiallocation_chain multiallocation_chain; + NodeAlloc & nalloc = this->node_alloc(); + multiallocation_chain chain; + allocator_destroyer_and_chain_builder chain_builder(nalloc, chain); + icont_iterator ret_it = this->icont().erase_and_dispose(first, last, chain_builder); + nalloc.deallocate_individual(chain); + return ret_it; + } + + template + size_type erase_key(const Key& k, const Comparator &comp, allocator_v1) + { return this->icont().erase_and_dispose(k, comp, Destroyer(this->node_alloc())); } + + template + size_type erase_key(const Key& k, const Comparator &comp, allocator_v2) + { + allocator_multialloc_chain_node_deallocator chain_holder(this->node_alloc()); + return this->icont().erase_and_dispose(k, comp, chain_holder.get_chain_builder()); + } + + protected: + struct cloner + { + cloner(node_alloc_holder &holder) + : m_holder(holder) + {} + + NodePtr operator()(const Node &other) const + { return m_holder.create_node(other.get_data()); } + + node_alloc_holder &m_holder; + }; + + struct members_holder + : public NodeAlloc + { + private: + members_holder(const members_holder&); + members_holder & operator=(const members_holder&); + + public: + members_holder() + : NodeAlloc(), m_icont() + {} + + template + explicit members_holder(AUTOBOOST_FWD_REF(ConvertibleToAlloc) c2alloc) + : NodeAlloc(autoboost::forward(c2alloc)) + , m_icont() + {} + + template + members_holder(AUTOBOOST_FWD_REF(ConvertibleToAlloc) c2alloc, const value_compare &c) + : NodeAlloc(autoboost::forward(c2alloc)) + , m_icont(typename ICont::value_compare(c)) + {} + + explicit members_holder(const value_compare &c) + : NodeAlloc() + , m_icont(typename ICont::value_compare(c)) + {} + + //The intrusive container + ICont m_icont; + }; + + ICont &non_const_icont() const + { return const_cast(this->members_.m_icont); } + + ICont &icont() + { return this->members_.m_icont; } + + const ICont &icont() const + { return this->members_.m_icont; } + + NodeAlloc &node_alloc() + { return static_cast(this->members_); } + + const NodeAlloc &node_alloc() const + { return static_cast(this->members_); } + + members_holder members_; +}; + +} //namespace container_detail { +} //namespace container { +} //namespace autoboost { + +#include + +#endif // AUTOBOOST_CONTAINER_DETAIL_NODE_ALLOC_HPP_ diff --git a/contrib/autoboost/autoboost/container/detail/pair.hpp b/contrib/autoboost/autoboost/container/detail/pair.hpp new file mode 100644 index 000000000..d073d9a0c --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/pair.hpp @@ -0,0 +1,374 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. +// +// 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP +#define AUTOBOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include + +#include //std::pair +#include //std::swap + +#include + + +#ifndef AUTOBOOST_CONTAINER_PERFECT_FORWARDING +#include +#endif + +namespace autoboost { +namespace container { +namespace container_detail { + +template +struct pair; + +template +struct is_pair +{ + static const bool value = false; +}; + +template +struct is_pair< pair > +{ + static const bool value = true; +}; + +template +struct is_pair< std::pair > +{ + static const bool value = true; +}; + +struct pair_nat; + +struct piecewise_construct_t { }; +static const piecewise_construct_t piecewise_construct = piecewise_construct_t(); + +/* +template +struct pair +{ + template pair(pair&& p); + template + pair(piecewise_construct_t, tuple first_args, + tuple second_args); + + template pair& operator=(const pair& p); + pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable::value && + is_nothrow_move_assignable::value); + template pair& operator=(pair&& p); + + void swap(pair& p) noexcept(noexcept(swap(first, p.first)) && + noexcept(swap(second, p.second))); +}; + +template bool operator==(const pair&, const pair&); +template bool operator!=(const pair&, const pair&); +template bool operator< (const pair&, const pair&); +template bool operator> (const pair&, const pair&); +template bool operator>=(const pair&, const pair&); +template bool operator<=(const pair&, const pair&); +*/ + + +template +struct pair +{ + private: + AUTOBOOST_COPYABLE_AND_MOVABLE(pair) + + public: + typedef T1 first_type; + typedef T2 second_type; + + T1 first; + T2 second; + + //Default constructor + pair() + : first(), second() + {} + + //pair copy assignment + pair(const pair& x) + : first(x.first), second(x.second) + {} + + //pair move constructor + pair(AUTOBOOST_RV_REF(pair) p) + : first(::autoboost::move(p.first)), second(::autoboost::move(p.second)) + {} + + template + pair(const pair &p) + : first(p.first), second(p.second) + {} + + template + pair(AUTOBOOST_RV_REF_BEG pair AUTOBOOST_RV_REF_END p) + : first(::autoboost::move(p.first)), second(::autoboost::move(p.second)) + {} + + //pair from two values + pair(const T1 &t1, const T2 &t2) + : first(t1) + , second(t2) + {} + + template + pair(AUTOBOOST_FWD_REF(U) u, AUTOBOOST_FWD_REF(V) v) + : first(::autoboost::forward(u)) + , second(::autoboost::forward(v)) + {} + + //And now compatibility with std::pair + pair(const std::pair& x) + : first(x.first), second(x.second) + {} + + template + pair(const std::pair& p) + : first(p.first), second(p.second) + {} + + pair(AUTOBOOST_RV_REF_BEG std::pair AUTOBOOST_RV_REF_END p) + : first(::autoboost::move(p.first)), second(::autoboost::move(p.second)) + {} + + template + pair(AUTOBOOST_RV_REF_BEG std::pair AUTOBOOST_RV_REF_END p) + : first(::autoboost::move(p.first)), second(::autoboost::move(p.second)) + {} + + //piecewise_construct missing + //template pair(pair&& p); + //template + // pair(piecewise_construct_t, tuple first_args, + // tuple second_args); +/* + //Variadic versions + template + pair(AUTOBOOST_CONTAINER_PP_PARAM(U, u), typename container_detail::disable_if + < container_detail::is_pair< typename container_detail::remove_ref_const::type >, pair_nat>::type* = 0) + : first(::autoboost::forward(u)) + , second() + {} + + #ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + template + pair(U &&u, V &&v) + : first(::autoboost::forward(u)) + , second(::autoboost::forward(v), ::autoboost::forward(args)...) + {} + + #else + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + template \ + pair(AUTOBOOST_CONTAINER_PP_PARAM(U, u) \ + ,AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + : first(::autoboost::forward(u)) \ + , second(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)) \ + {} \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (1, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + #endif +*/ + //pair copy assignment + pair& operator=(AUTOBOOST_COPY_ASSIGN_REF(pair) p) + { + first = p.first; + second = p.second; + return *this; + } + + //pair move assignment + pair& operator=(AUTOBOOST_RV_REF(pair) p) + { + first = ::autoboost::move(p.first); + second = ::autoboost::move(p.second); + return *this; + } + + template + typename ::autoboost::container::container_detail::enable_if_c + < !(::autoboost::container::container_detail::is_same::value && + ::autoboost::container::container_detail::is_same::value) + , pair &>::type + operator=(const pair&p) + { + first = p.first; + second = p.second; + return *this; + } + + template + typename ::autoboost::container::container_detail::enable_if_c + < !(::autoboost::container::container_detail::is_same::value && + ::autoboost::container::container_detail::is_same::value) + , pair &>::type + operator=(AUTOBOOST_RV_REF_BEG pair AUTOBOOST_RV_REF_END p) + { + first = ::autoboost::move(p.first); + second = ::autoboost::move(p.second); + return *this; + } + + //std::pair copy assignment + pair& operator=(const std::pair &p) + { + first = p.first; + second = p.second; + return *this; + } + + template + pair& operator=(const std::pair &p) + { + first = ::autoboost::move(p.first); + second = ::autoboost::move(p.second); + return *this; + } + + //std::pair move assignment + pair& operator=(AUTOBOOST_RV_REF_BEG std::pair AUTOBOOST_RV_REF_END p) + { + first = ::autoboost::move(p.first); + second = ::autoboost::move(p.second); + return *this; + } + + template + pair& operator=(AUTOBOOST_RV_REF_BEG std::pair AUTOBOOST_RV_REF_END p) + { + first = ::autoboost::move(p.first); + second = ::autoboost::move(p.second); + return *this; + } + + //swap + void swap(pair& p) + { + using std::swap; + swap(this->first, p.first); + swap(this->second, p.second); + } +}; + +template +inline bool operator==(const pair& x, const pair& y) +{ return static_cast(x.first == y.first && x.second == y.second); } + +template +inline bool operator< (const pair& x, const pair& y) +{ return static_cast(x.first < y.first || + (!(y.first < x.first) && x.second < y.second)); } + +template +inline bool operator!=(const pair& x, const pair& y) +{ return static_cast(!(x == y)); } + +template +inline bool operator> (const pair& x, const pair& y) +{ return y < x; } + +template +inline bool operator>=(const pair& x, const pair& y) +{ return static_cast(!(x < y)); } + +template +inline bool operator<=(const pair& x, const pair& y) +{ return static_cast(!(y < x)); } + +template +inline pair make_pair(T1 x, T2 y) +{ return pair(x, y); } + +template +inline void swap(pair& x, pair& y) +{ + swap(x.first, y.first); + swap(x.second, y.second); +} + +} //namespace container_detail { +} //namespace container { + + +//Without this specialization recursive flat_(multi)map instantiation fails +//because is_enum needs to instantiate the recursive pair, leading to a compilation error). +//This breaks the cycle clearly stating that pair is not an enum avoiding any instantiation. +template +struct is_enum; + +template +struct is_enum< ::autoboost::container::container_detail::pair > +{ + static const bool value = false; +}; + +template +struct is_class; + +//This specialization is needed to avoid instantiation of pair in +//is_class, and allow recursive maps. +template +struct is_class< ::autoboost::container::container_detail::pair > +{ + static const bool value = true; +}; + +#ifdef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + +template +struct has_move_emulation_enabled< ::autoboost::container::container_detail::pair > +{ + static const bool value = true; +}; + +#endif + +namespace move_detail{ + +template +struct is_class_or_union; + +template +struct is_class_or_union< ::autoboost::container::container_detail::pair > +//This specialization is needed to avoid instantiation of pair in +//is_class, and allow recursive maps. +{ + static const bool value = true; +}; + + +} //namespace move_detail{ + +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_PAIR_HPP diff --git a/contrib/autoboost/boost/container/detail/placement_new.hpp b/contrib/autoboost/autoboost/container/detail/placement_new.hpp similarity index 80% rename from contrib/autoboost/boost/container/detail/placement_new.hpp rename to contrib/autoboost/autoboost/container/detail/placement_new.hpp index 2489d8a45..0c3a580f4 100644 --- a/contrib/autoboost/boost/container/detail/placement_new.hpp +++ b/contrib/autoboost/autoboost/container/detail/placement_new.hpp @@ -8,8 +8,8 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_CONTAINER_DETAIL_PLACEMENT_NEW_HPP -#define BOOST_CONTAINER_DETAIL_PLACEMENT_NEW_HPP +#ifndef AUTOBOOST_CONTAINER_DETAIL_PLACEMENT_NEW_HPP +#define AUTOBOOST_CONTAINER_DETAIL_PLACEMENT_NEW_HPP #if defined(_MSC_VER) # pragma once @@ -24,4 +24,4 @@ inline void *operator new(std::size_t, void *p, boost_container_new_t) inline void operator delete(void *, void *, boost_container_new_t) {} -#endif //BOOST_CONTAINER_DETAIL_PLACEMENT_NEW_HPP +#endif //AUTOBOOST_CONTAINER_DETAIL_PLACEMENT_NEW_HPP diff --git a/contrib/autoboost/autoboost/container/detail/preprocessor.hpp b/contrib/autoboost/autoboost/container/detail/preprocessor.hpp new file mode 100644 index 000000000..d7232c607 --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/preprocessor.hpp @@ -0,0 +1,228 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2008-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP +#define AUTOBOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include + +#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING +//#error "This file is not needed when perfect forwarding is available" +#endif //AUTOBOOST_CONTAINER_PERFECT_FORWARDING + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS 10 + +//Note: +//We define template parameters as const references to +//be able to bind temporaries. After that we will un-const them. +//This cast is ugly but it is necessary until "perfect forwarding" +//is achieved in C++0x. Meanwhile, if we want to be able to +//bind rvalues with non-const references, we have to be ugly +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + #define AUTOBOOST_CONTAINER_PP_PARAM_LIST(z, n, data) \ + AUTOBOOST_PP_CAT(P, n) && AUTOBOOST_PP_CAT(p, n) \ + //! +#else + #define AUTOBOOST_CONTAINER_PP_PARAM_LIST(z, n, data) \ + const AUTOBOOST_PP_CAT(P, n) & AUTOBOOST_PP_CAT(p, n) \ + //! +#endif //#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + +#define AUTOBOOST_CONTAINER_PP_CONST_REF_PARAM_LIST_Q(z, n, Data) \ +const AUTOBOOST_PP_CAT(Q, n) & AUTOBOOST_PP_CAT(q, n) \ +//! + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + #define AUTOBOOST_CONTAINER_PP_PARAM(U, u) \ + U && u \ + //! +#else + #define AUTOBOOST_CONTAINER_PP_PARAM(U, u) \ + const U & u \ + //! +#endif //#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + + #define AUTOBOOST_CONTAINER_PP_PARAM_INIT(z, n, data) \ + AUTOBOOST_PP_CAT(m_p, n) (::autoboost::forward< AUTOBOOST_PP_CAT(P, n) >( AUTOBOOST_PP_CAT(p, n) )) \ + //! + +#else //AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + + #define AUTOBOOST_CONTAINER_PP_PARAM_INIT(z, n, data) \ + AUTOBOOST_PP_CAT(m_p, n) (const_cast(AUTOBOOST_PP_CAT(p, n))) \ + //! +#endif //#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + + #if defined(AUTOBOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) + + namespace autoboost { + namespace container { + namespace container_detail { + template + struct ref_holder; + + template + struct ref_holder + { + explicit ref_holder(T &t) + : t_(t) + {} + T &t_; + T & get() { return t_; } + }; + + template + struct ref_holder + { + explicit ref_holder(const T &t) + : t_(t) + {} + const T &t_; + const T & get() { return t_; } + }; + + template + struct ref_holder + { + explicit ref_holder(const T &t) + : t_(t) + {} + const T &t_; + const T & get() { return t_; } + }; + + template + struct ref_holder + { + explicit ref_holder(T &&t) + : t_(t) + {} + T &t_; + T && get() { return ::autoboost::move(t_); } + }; + + template + struct ref_holder + { + explicit ref_holder(T &&t) + : t_(t) + {} + T &t_; + T && get() { return ::autoboost::move(t_); } + }; + + } //namespace container_detail { + } //namespace container { + } //namespace autoboost { + + #define AUTOBOOST_CONTAINER_PP_PARAM_DEFINE(z, n, data) \ + ::autoboost::container::container_detail::ref_holder AUTOBOOST_PP_CAT(m_p, n); \ + //! + + #else //AUTOBOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG + + #define AUTOBOOST_CONTAINER_PP_PARAM_DEFINE(z, n, data) \ + AUTOBOOST_PP_CAT(P, n) && AUTOBOOST_PP_CAT(m_p, n); \ + //! + + #endif //defined(AUTOBOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) + +#else //AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + + #define AUTOBOOST_CONTAINER_PP_PARAM_DEFINE(z, n, data) \ + AUTOBOOST_PP_CAT(P, n) & AUTOBOOST_PP_CAT(m_p, n); \ + //! +#endif //#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + +#if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) && defined(AUTOBOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) + + #define AUTOBOOST_CONTAINER_PP_MEMBER_FORWARD(z, n, data) AUTOBOOST_PP_CAT(this->m_p, n).get() \ + //! + +#else //!defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) && defined(AUTOBOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) + + #define AUTOBOOST_CONTAINER_PP_MEMBER_FORWARD(z, n, data) \ + ::autoboost::forward< AUTOBOOST_PP_CAT(P, n) >( AUTOBOOST_PP_CAT(this->m_p, n) ) \ + //! + +#endif //!defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) && defined(AUTOBOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG) + +#define AUTOBOOST_CONTAINER_PP_PARAM_INC(z, n, data) \ + AUTOBOOST_PP_CAT(++this->m_p, n) \ +//! + +#define AUTOBOOST_CONTAINER_PP_IDENTITY(z, n, data) data + + +#define AUTOBOOST_CONTAINER_PP_PARAM_FORWARD(z, n, data) \ +::autoboost::forward< AUTOBOOST_PP_CAT(P, n) >( AUTOBOOST_PP_CAT(p, n) ) \ +//! + +#define AUTOBOOST_CONTAINER_PP_DECLVAL(z, n, data) \ +::autoboost::move_detail::declval< AUTOBOOST_PP_CAT(P, n) >() \ +//! + +#define AUTOBOOST_CONTAINER_PP_MEMBER_IT_FORWARD(z, n, data) \ +AUTOBOOST_PP_CAT(*this->m_p, n) \ +//! + +#define AUTOBOOST_CONTAINER_PP_TEMPLATE_PARAM_VOID_DEFAULT(z, n, data) \ + AUTOBOOST_PP_CAT(class P, n) = void \ +//! + +#define AUTOBOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT(z, n, default_type) \ + AUTOBOOST_PP_CAT(class P, n) = default_type \ +//! + +#define AUTOBOOST_CONTAINER_PP_STATIC_PARAM_REF_DECLARE(z, n, data) \ + static AUTOBOOST_PP_CAT(P, n) & AUTOBOOST_PP_CAT(p, n); \ +//! + +#define AUTOBOOST_CONTAINER_PP_PARAM_PASS(z, n, data) \ + AUTOBOOST_PP_CAT(p, n) \ +//! + +#define AUTOBOOST_CONTAINER_PP_FWD_TYPE(z, n, data) \ + typename ::autoboost::move_detail::forward_type< AUTOBOOST_PP_CAT(P, n) >::type \ +//! + +#include + +//#else + +//#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING +//#error "This file is not needed when perfect forwarding is available" +//#endif //AUTOBOOST_CONTAINER_PERFECT_FORWARDING + +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP diff --git a/contrib/autoboost/autoboost/container/detail/std_fwd.hpp b/contrib/autoboost/autoboost/container/detail/std_fwd.hpp new file mode 100644 index 000000000..68329035f --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/std_fwd.hpp @@ -0,0 +1,59 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2014-2014. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_DETAIL_STD_FWD_HPP +#define AUTOBOOST_CONTAINER_DETAIL_STD_FWD_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +////////////////////////////////////////////////////////////////////////////// +// Standard predeclarations +////////////////////////////////////////////////////////////////////////////// + +#if defined(__clang__) && defined(_LIBCPP_VERSION) + #define AUTOBOOST_CONTAINER_CLANG_INLINE_STD_NS + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wc++11-extensions" + #define AUTOBOOST_CONTAINER_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD + #define AUTOBOOST_CONTAINER_STD_NS_END _LIBCPP_END_NAMESPACE_STD +#else + #define AUTOBOOST_CONTAINER_STD_NS_BEG namespace std{ + #define AUTOBOOST_CONTAINER_STD_NS_END } +#endif + +AUTOBOOST_CONTAINER_STD_NS_BEG + +template +class allocator; + +template +struct less; + +template +struct pair; + +template +struct char_traits; + +struct input_iterator_tag; +struct forward_iterator_tag; +struct bidirectional_iterator_tag; +struct random_access_iterator_tag; + +AUTOBOOST_CONTAINER_STD_NS_END + +#ifdef AUTOBOOST_CONTAINER_CLANG_INLINE_STD_NS + #pragma GCC diagnostic pop + #undef AUTOBOOST_CONTAINER_CLANG_INLINE_STD_NS +#endif //AUTOBOOST_CONTAINER_CLANG_INLINE_STD_NS + +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_STD_FWD_HPP diff --git a/contrib/autoboost/autoboost/container/detail/transform_iterator.hpp b/contrib/autoboost/autoboost/container/detail/transform_iterator.hpp new file mode 100644 index 000000000..8e463417e --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/transform_iterator.hpp @@ -0,0 +1,177 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. +// (C) Copyright Gennaro Prota 2003 - 2004. +// +// 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_DETAIL_TRANSFORM_ITERATORS_HPP +#define AUTOBOOST_CONTAINER_DETAIL_TRANSFORM_ITERATORS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include + +namespace autoboost { +namespace container { + +template +struct operator_arrow_proxy +{ + operator_arrow_proxy(const PseudoReference &px) + : m_value(px) + {} + + typedef PseudoReference element_type; + + PseudoReference* operator->() const { return &m_value; } + + mutable PseudoReference m_value; +}; + +template +struct operator_arrow_proxy +{ + operator_arrow_proxy(T &px) + : m_value(px) + {} + + typedef T element_type; + + T* operator->() const { return const_cast(&m_value); } + + T &m_value; +}; + +template +class transform_iterator + : public UnaryFunction + , public std::iterator + < typename Iterator::iterator_category + , typename container_detail::remove_reference::type + , typename Iterator::difference_type + , operator_arrow_proxy + , typename UnaryFunction::result_type> +{ + public: + explicit transform_iterator(const Iterator &it, const UnaryFunction &f = UnaryFunction()) + : UnaryFunction(f), m_it(it) + {} + + explicit transform_iterator() + : UnaryFunction(), m_it() + {} + + //Constructors + transform_iterator& operator++() + { increment(); return *this; } + + transform_iterator operator++(int) + { + transform_iterator result (*this); + increment(); + return result; + } + + friend bool operator== (const transform_iterator& i, const transform_iterator& i2) + { return i.equal(i2); } + + friend bool operator!= (const transform_iterator& i, const transform_iterator& i2) + { return !(i == i2); } + +/* + friend bool operator> (const transform_iterator& i, const transform_iterator& i2) + { return i2 < i; } + + friend bool operator<= (const transform_iterator& i, const transform_iterator& i2) + { return !(i > i2); } + + friend bool operator>= (const transform_iterator& i, const transform_iterator& i2) + { return !(i < i2); } +*/ + friend typename Iterator::difference_type operator- (const transform_iterator& i, const transform_iterator& i2) + { return i2.distance_to(i); } + + //Arithmetic + transform_iterator& operator+=(typename Iterator::difference_type off) + { this->advance(off); return *this; } + + transform_iterator operator+(typename Iterator::difference_type off) const + { + transform_iterator other(*this); + other.advance(off); + return other; + } + + friend transform_iterator operator+(typename Iterator::difference_type off, const transform_iterator& right) + { return right + off; } + + transform_iterator& operator-=(typename Iterator::difference_type off) + { this->advance(-off); return *this; } + + transform_iterator operator-(typename Iterator::difference_type off) const + { return *this + (-off); } + + typename UnaryFunction::result_type operator*() const + { return dereference(); } + + operator_arrow_proxy + operator->() const + { return operator_arrow_proxy(dereference()); } + + Iterator & base() + { return m_it; } + + const Iterator & base() const + { return m_it; } + + private: + Iterator m_it; + + void increment() + { ++m_it; } + + void decrement() + { --m_it; } + + bool equal(const transform_iterator &other) const + { return m_it == other.m_it; } + + bool less(const transform_iterator &other) const + { return other.m_it < m_it; } + + typename UnaryFunction::result_type dereference() const + { return UnaryFunction::operator()(*m_it); } + + void advance(typename Iterator::difference_type n) + { std::advance(m_it, n); } + + typename Iterator::difference_type distance_to(const transform_iterator &other)const + { return std::distance(other.m_it, m_it); } +}; + +template +transform_iterator +make_transform_iterator(Iterator it, UnaryFunc fun) +{ + return transform_iterator(it, fun); +} + +} //namespace container { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_TRANSFORM_ITERATORS_HPP diff --git a/contrib/autoboost/autoboost/container/detail/tree.hpp b/contrib/autoboost/autoboost/container/detail/tree.hpp new file mode 100644 index 000000000..c4982a4f5 --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/tree.hpp @@ -0,0 +1,1182 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_TREE_HPP +#define AUTOBOOST_CONTAINER_TREE_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +#include +#include +#include +#include +#include +// +#include +#include +#include +// +#ifndef AUTOBOOST_CONTAINER_PERFECT_FORWARDING +#include +#endif + +#include //std::pair +#include +#include + +namespace autoboost { +namespace container { +namespace container_detail { + +template +struct tree_value_compare + : public KeyCompare +{ + typedef Value value_type; + typedef KeyCompare key_compare; + typedef KeyOfValue key_of_value; + typedef Key key_type; + + explicit tree_value_compare(const key_compare &kcomp) + : KeyCompare(kcomp) + {} + + tree_value_compare() + : KeyCompare() + {} + + const key_compare &key_comp() const + { return static_cast(*this); } + + key_compare &key_comp() + { return static_cast(*this); } + + template + struct is_key + { + static const bool value = is_same::value; + }; + + template + typename enable_if_c::value, const key_type &>::type + key_forward(const T &key) const + { return key; } + + template + typename enable_if_c::value, const key_type &>::type + key_forward(const T &key) const + { return KeyOfValue()(key); } + + template + bool operator()(const KeyType &key1, const KeyType2 &key2) const + { return key_compare::operator()(this->key_forward(key1), this->key_forward(key2)); } +}; + +template +struct intrusive_tree_hook; + +template +struct intrusive_tree_hook +{ + typedef typename container_detail::bi::make_set_base_hook + < container_detail::bi::void_pointer + , container_detail::bi::link_mode + , container_detail::bi::optimize_size + >::type type; +}; + +template +struct intrusive_tree_hook +{ + typedef typename container_detail::bi::make_avl_set_base_hook + < container_detail::bi::void_pointer + , container_detail::bi::link_mode + , container_detail::bi::optimize_size + >::type type; +}; + +template +struct intrusive_tree_hook +{ + typedef typename container_detail::bi::make_bs_set_base_hook + < container_detail::bi::void_pointer + , container_detail::bi::link_mode + >::type type; +}; + +template +struct intrusive_tree_hook +{ + typedef typename container_detail::bi::make_bs_set_base_hook + < container_detail::bi::void_pointer + , container_detail::bi::link_mode + >::type type; +}; + +//This trait is used to type-pun std::pair because in C++03 +//compilers std::pair is useless for C++11 features +template +struct tree_internal_data_type +{ + typedef T type; +}; + +template +struct tree_internal_data_type< std::pair > +{ + typedef pair type; +}; + +//The node to be store in the tree +template +struct tree_node + : public intrusive_tree_hook::type +{ + private: + //AUTOBOOST_COPYABLE_AND_MOVABLE(tree_node) + tree_node(); + + public: + typedef typename intrusive_tree_hook + ::type hook_type; + typedef T value_type; + typedef typename tree_internal_data_type::type internal_type; + + typedef tree_node< T, VoidPointer + , tree_type_value, OptimizeSize> node_type; + + T &get_data() + { + T* ptr = reinterpret_cast(&this->m_data); + return *ptr; + } + + const T &get_data() const + { + const T* ptr = reinterpret_cast(&this->m_data); + return *ptr; + } + + internal_type m_data; + + template + void do_assign(const std::pair &p) + { + const_cast(m_data.first) = p.first; + m_data.second = p.second; + } + + template + void do_assign(const pair &p) + { + const_cast(m_data.first) = p.first; + m_data.second = p.second; + } + + template + void do_assign(const V &v) + { m_data = v; } + + template + void do_move_assign(std::pair &p) + { + const_cast(m_data.first) = ::autoboost::move(p.first); + m_data.second = ::autoboost::move(p.second); + } + + template + void do_move_assign(pair &p) + { + const_cast(m_data.first) = ::autoboost::move(p.first); + m_data.second = ::autoboost::move(p.second); + } + + template + void do_move_assign(V &v) + { m_data = ::autoboost::move(v); } +}; + +template +struct iiterator_node_value_type< tree_node > { + typedef T type; +}; + +template +class insert_equal_end_hint_functor +{ + Icont &icont_; + + public: + insert_equal_end_hint_functor(Icont &icont) + : icont_(icont) + {} + + void operator()(Node &n) + { this->icont_.insert_equal(this->icont_.cend(), n); } +}; + +template +class push_back_functor +{ + Icont &icont_; + + public: + push_back_functor(Icont &icont) + : icont_(icont) + {} + + void operator()(Node &n) + { this->icont_.push_back(n); } +}; + +}//namespace container_detail { + +namespace container_detail { + +template< class NodeType, class NodeCompareType + , class SizeType, class HookType + , autoboost::container::tree_type_enum tree_type_value> +struct intrusive_tree_dispatch; + +template +struct intrusive_tree_dispatch + +{ + typedef typename container_detail::bi::make_rbtree + + ,container_detail::bi::base_hook + ,container_detail::bi::constant_time_size + ,container_detail::bi::size_type + >::type type; +}; + +template +struct intrusive_tree_dispatch + +{ + typedef typename container_detail::bi::make_avltree + + ,container_detail::bi::base_hook + ,container_detail::bi::constant_time_size + ,container_detail::bi::size_type + >::type type; +}; + +template +struct intrusive_tree_dispatch + +{ + typedef typename container_detail::bi::make_sgtree + + ,container_detail::bi::base_hook + ,container_detail::bi::floating_point + ,container_detail::bi::size_type + >::type type; +}; + +template +struct intrusive_tree_dispatch + +{ + typedef typename container_detail::bi::make_splaytree + + ,container_detail::bi::base_hook + ,container_detail::bi::constant_time_size + ,container_detail::bi::size_type + >::type type; +}; + +template +struct intrusive_tree_type +{ + private: + typedef typename autoboost::container:: + allocator_traits::value_type value_type; + typedef typename autoboost::container:: + allocator_traits::void_pointer void_pointer; + typedef typename autoboost::container:: + allocator_traits::size_type size_type; + typedef typename container_detail::tree_node + < value_type, void_pointer + , tree_type_value, OptimizeSize> node_type; + typedef node_compare node_compare_type; + //Deducing the hook type from node_type (e.g. node_type::hook_type) would + //provoke an early instantiation of node_type that could ruin recursive + //tree definitions, so retype the complete type to avoid any problem. + typedef typename intrusive_tree_hook + ::type hook_type; + public: + typedef typename intrusive_tree_dispatch + < node_type, node_compare_type + , size_type, hook_type + , tree_type_value>::type type; +}; + +//Trait to detect manually rebalanceable tree types +template +struct is_manually_balanceable +{ static const bool value = true; }; + +template<> struct is_manually_balanceable +{ static const bool value = false; }; + +template<> struct is_manually_balanceable +{ static const bool value = false; }; + +//Proxy traits to implement different operations depending on the +//is_manually_balanceable<>::value +template< autoboost::container::tree_type_enum tree_type_value + , bool IsManuallyRebalanceable = is_manually_balanceable::value> +struct intrusive_tree_proxy +{ + template + static void rebalance(Icont &) {} +}; + +template +struct intrusive_tree_proxy +{ + template + static void rebalance(Icont &c) + { c.rebalance(); } +}; + +} //namespace container_detail { + +namespace container_detail { + +//This functor will be used with Intrusive clone functions to obtain +//already allocated nodes from a intrusive container instead of +//allocating new ones. When the intrusive container runs out of nodes +//the node holder is used instead. +template +class RecyclingCloner +{ + typedef typename AllocHolder::intrusive_container intrusive_container; + typedef typename AllocHolder::Node node_type; + typedef typename AllocHolder::NodePtr node_ptr_type; + + public: + RecyclingCloner(AllocHolder &holder, intrusive_container &itree) + : m_holder(holder), m_icont(itree) + {} + + static void do_assign(node_ptr_type &p, const node_type &other, bool_) + { p->do_assign(other.m_data); } + + static void do_assign(node_ptr_type &p, const node_type &other, bool_) + { p->do_move_assign(const_cast(other).m_data); } + + node_ptr_type operator()(const node_type &other) const + { + if(node_ptr_type p = m_icont.unlink_leftmost_without_rebalance()){ + //First recycle a node (this can't throw) + AUTOBOOST_TRY{ + //This can throw + this->do_assign(p, other, bool_()); + return p; + } + AUTOBOOST_CATCH(...){ + //If there is an exception destroy the whole source + m_holder.destroy_node(p); + while((p = m_icont.unlink_leftmost_without_rebalance())){ + m_holder.destroy_node(p); + } + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + } + else{ + return m_holder.create_node(other.m_data); + } + } + + AllocHolder &m_holder; + intrusive_container &m_icont; +}; + +template +//where KeyValueCompare is tree_value_compare +struct key_node_compare + : private KeyValueCompare +{ + explicit key_node_compare(const KeyValueCompare &comp) + : KeyValueCompare(comp) + {} + + template + struct is_node + { + static const bool value = is_same::value; + }; + + template + typename enable_if_c::value, const typename KeyValueCompare::value_type &>::type + key_forward(const T &node) const + { return node.get_data(); } + + template + typename enable_if_c::value, const T &>::type + key_forward(const T &key) const + { return key; } + + template + bool operator()(const KeyType &key1, const KeyType2 &key2) const + { return KeyValueCompare::operator()(this->key_forward(key1), this->key_forward(key2)); } +}; + +template +class tree + : protected container_detail::node_alloc_holder + < A + , typename container_detail::intrusive_tree_type + < A, tree_value_compare //ValComp + , Options::tree_type, Options::optimize_size>::type + > +{ + typedef tree_value_compare + ValComp; + typedef typename container_detail::intrusive_tree_type + < A, ValComp, Options::tree_type + , Options::optimize_size>::type Icont; + typedef container_detail::node_alloc_holder + AllocHolder; + typedef typename AllocHolder::NodePtr NodePtr; + typedef tree < Key, Value, KeyOfValue + , KeyCompare, A, Options> ThisType; + typedef typename AllocHolder::NodeAlloc NodeAlloc; + typedef typename AllocHolder::ValAlloc ValAlloc; + typedef typename AllocHolder::Node Node; + typedef typename Icont::iterator iiterator; + typedef typename Icont::const_iterator iconst_iterator; + typedef container_detail::allocator_destroyer Destroyer; + typedef typename AllocHolder::allocator_v1 allocator_v1; + typedef typename AllocHolder::allocator_v2 allocator_v2; + typedef typename AllocHolder::alloc_version alloc_version; + typedef intrusive_tree_proxy intrusive_tree_proxy_t; + + AUTOBOOST_COPYABLE_AND_MOVABLE(tree) + + public: + + typedef Key key_type; + typedef Value value_type; + typedef A allocator_type; + typedef KeyCompare key_compare; + typedef ValComp value_compare; + typedef typename autoboost::container:: + allocator_traits::pointer pointer; + typedef typename autoboost::container:: + allocator_traits::const_pointer const_pointer; + typedef typename autoboost::container:: + allocator_traits::reference reference; + typedef typename autoboost::container:: + allocator_traits::const_reference const_reference; + typedef typename autoboost::container:: + allocator_traits::size_type size_type; + typedef typename autoboost::container:: + allocator_traits::difference_type difference_type; + typedef difference_type tree_difference_type; + typedef pointer tree_pointer; + typedef const_pointer tree_const_pointer; + typedef reference tree_reference; + typedef const_reference tree_const_reference; + typedef NodeAlloc stored_allocator_type; + + private: + + typedef key_node_compare KeyNodeCompare; + + public: + typedef container_detail::iterator iterator; + typedef container_detail::iterator const_iterator; + typedef container_detail::reverse_iterator reverse_iterator; + typedef container_detail::reverse_iterator const_reverse_iterator; + + tree() + : AllocHolder(ValComp(key_compare())) + {} + + explicit tree(const key_compare& comp, const allocator_type& a = allocator_type()) + : AllocHolder(a, ValComp(comp)) + {} + + explicit tree(const allocator_type& a) + : AllocHolder(a) + {} + + template + tree(bool unique_insertion, InputIterator first, InputIterator last, const key_compare& comp, + const allocator_type& a + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < container_detail::is_input_iterator::value + || container_detail::is_same::value + >::type * = 0 + #endif + ) + : AllocHolder(a, value_compare(comp)) + { + //Use cend() as hint to achieve linear time for + //ordered ranges as required by the standard + //for the constructor + const const_iterator end_it(this->cend()); + if(unique_insertion){ + for ( ; first != last; ++first){ + this->insert_unique(end_it, *first); + } + } + else{ + for ( ; first != last; ++first){ + this->insert_equal(end_it, *first); + } + } + } + + template + tree(bool unique_insertion, InputIterator first, InputIterator last, const key_compare& comp, + const allocator_type& a + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < !(container_detail::is_input_iterator::value + || container_detail::is_same::value) + >::type * = 0 + #endif + ) + : AllocHolder(a, value_compare(comp)) + { + if(unique_insertion){ + //Use cend() as hint to achieve linear time for + //ordered ranges as required by the standard + //for the constructor + const const_iterator end_it(this->cend()); + for ( ; first != last; ++first){ + this->insert_unique(end_it, *first); + } + } + else{ + //Optimized allocation and construction + this->allocate_many_and_construct + ( first, std::distance(first, last) + , insert_equal_end_hint_functor(this->icont())); + } + } + + template + tree( ordered_range_t, InputIterator first, InputIterator last + , const key_compare& comp = key_compare(), const allocator_type& a = allocator_type() + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < container_detail::is_input_iterator::value + || container_detail::is_same::value + >::type * = 0 + #endif + ) + : AllocHolder(a, value_compare(comp)) + { + for ( ; first != last; ++first){ + this->push_back_impl(*first); + } + } + + template + tree( ordered_range_t, InputIterator first, InputIterator last + , const key_compare& comp = key_compare(), const allocator_type& a = allocator_type() + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < !(container_detail::is_input_iterator::value + || container_detail::is_same::value) + >::type * = 0 + #endif + ) + : AllocHolder(a, value_compare(comp)) + { + //Optimized allocation and construction + this->allocate_many_and_construct + ( first, std::distance(first, last) + , container_detail::push_back_functor(this->icont())); + } + + tree(const tree& x) + : AllocHolder(x, x.value_comp()) + { + this->icont().clone_from + (x.icont(), typename AllocHolder::cloner(*this), Destroyer(this->node_alloc())); + } + + tree(AUTOBOOST_RV_REF(tree) x) + : AllocHolder(::autoboost::move(static_cast(x)), x.value_comp()) + {} + + tree(const tree& x, const allocator_type &a) + : AllocHolder(a, x.value_comp()) + { + this->icont().clone_from + (x.icont(), typename AllocHolder::cloner(*this), Destroyer(this->node_alloc())); + } + + tree(AUTOBOOST_RV_REF(tree) x, const allocator_type &a) + : AllocHolder(a, x.value_comp()) + { + if(this->node_alloc() == x.node_alloc()){ + this->icont().swap(x.icont()); + } + else{ + this->icont().clone_from + (x.icont(), typename AllocHolder::cloner(*this), Destroyer(this->node_alloc())); + } + } + + ~tree() + {} //AllocHolder clears the tree + + tree& operator=(AUTOBOOST_COPY_ASSIGN_REF(tree) x) + { + if (&x != this){ + NodeAlloc &this_alloc = this->get_stored_allocator(); + const NodeAlloc &x_alloc = x.get_stored_allocator(); + container_detail::bool_:: + propagate_on_container_copy_assignment::value> flag; + if(flag && this_alloc != x_alloc){ + this->clear(); + } + this->AllocHolder::copy_assign_alloc(x); + //Transfer all the nodes to a temporary tree + //If anything goes wrong, all the nodes will be destroyed + //automatically + Icont other_tree(::autoboost::move(this->icont())); + + //Now recreate the source tree reusing nodes stored by other_tree + this->icont().clone_from + (x.icont() + , RecyclingCloner(*this, other_tree) + , Destroyer(this->node_alloc())); + + //If there are remaining nodes, destroy them + NodePtr p; + while((p = other_tree.unlink_leftmost_without_rebalance())){ + AllocHolder::destroy_node(p); + } + } + return *this; + } + + tree& operator=(AUTOBOOST_RV_REF(tree) x) + { + AUTOBOOST_ASSERT(this != &x); + NodeAlloc &this_alloc = this->node_alloc(); + NodeAlloc &x_alloc = x.node_alloc(); + const bool propagate_alloc = allocator_traits:: + propagate_on_container_move_assignment::value; + const bool allocators_equal = this_alloc == x_alloc; (void)allocators_equal; + //Resources can be transferred if both allocators are + //going to be equal after this function (either propagated or already equal) + if(propagate_alloc || allocators_equal){ + //Destroy + this->clear(); + //Move allocator if needed + this->AllocHolder::move_assign_alloc(x); + //Obtain resources + this->icont() = autoboost::move(x.icont()); + } + //Else do a one by one move + else{ + //Transfer all the nodes to a temporary tree + //If anything goes wrong, all the nodes will be destroyed + //automatically + Icont other_tree(::autoboost::move(this->icont())); + + //Now recreate the source tree reusing nodes stored by other_tree + this->icont().clone_from + (x.icont() + , RecyclingCloner(*this, other_tree) + , Destroyer(this->node_alloc())); + + //If there are remaining nodes, destroy them + NodePtr p; + while((p = other_tree.unlink_leftmost_without_rebalance())){ + AllocHolder::destroy_node(p); + } + } + return *this; + } + + public: + // accessors: + value_compare value_comp() const + { return this->icont().value_comp().value_comp(); } + + key_compare key_comp() const + { return this->icont().value_comp().value_comp().key_comp(); } + + allocator_type get_allocator() const + { return allocator_type(this->node_alloc()); } + + const stored_allocator_type &get_stored_allocator() const + { return this->node_alloc(); } + + stored_allocator_type &get_stored_allocator() + { return this->node_alloc(); } + + iterator begin() + { return iterator(this->icont().begin()); } + + const_iterator begin() const + { return this->cbegin(); } + + iterator end() + { return iterator(this->icont().end()); } + + const_iterator end() const + { return this->cend(); } + + reverse_iterator rbegin() + { return reverse_iterator(end()); } + + const_reverse_iterator rbegin() const + { return this->crbegin(); } + + reverse_iterator rend() + { return reverse_iterator(begin()); } + + const_reverse_iterator rend() const + { return this->crend(); } + + //! Effects: Returns a const_iterator to the first element contained in the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cbegin() const + { return const_iterator(this->non_const_icont().begin()); } + + //! Effects: Returns a const_iterator to the end of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cend() const + { return const_iterator(this->non_const_icont().end()); } + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crbegin() const + { return const_reverse_iterator(cend()); } + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crend() const + { return const_reverse_iterator(cbegin()); } + + bool empty() const + { return !this->size(); } + + size_type size() const + { return this->icont().size(); } + + size_type max_size() const + { return AllocHolder::max_size(); } + + void swap(ThisType& x) + { AllocHolder::swap(x); } + + public: + + typedef typename Icont::insert_commit_data insert_commit_data; + + // insert/erase + std::pair insert_unique_check + (const key_type& key, insert_commit_data &data) + { + std::pair ret = + this->icont().insert_unique_check(key, KeyNodeCompare(value_comp()), data); + return std::pair(iterator(ret.first), ret.second); + } + + std::pair insert_unique_check + (const_iterator hint, const key_type& key, insert_commit_data &data) + { + std::pair ret = + this->icont().insert_unique_check(hint.get(), key, KeyNodeCompare(value_comp()), data); + return std::pair(iterator(ret.first), ret.second); + } + + iterator insert_unique_commit(const value_type& v, insert_commit_data &data) + { + NodePtr tmp = AllocHolder::create_node(v); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_unique_commit(*tmp, data)); + destroy_deallocator.release(); + return ret; + } + + template + iterator insert_unique_commit + (AUTOBOOST_FWD_REF(MovableConvertible) mv, insert_commit_data &data) + { + NodePtr tmp = AllocHolder::create_node(autoboost::forward(mv)); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_unique_commit(*tmp, data)); + destroy_deallocator.release(); + return ret; + } + + std::pair insert_unique(const value_type& v) + { + insert_commit_data data; + std::pair ret = + this->insert_unique_check(KeyOfValue()(v), data); + if(ret.second){ + ret.first = this->insert_unique_commit(v, data); + } + return ret; + } + + template + std::pair insert_unique(AUTOBOOST_FWD_REF(MovableConvertible) mv) + { + insert_commit_data data; + std::pair ret = + this->insert_unique_check(KeyOfValue()(mv), data); + if(ret.second){ + ret.first = this->insert_unique_commit(autoboost::forward(mv), data); + } + return ret; + } + + private: + + template + void push_back_impl(AUTOBOOST_FWD_REF(MovableConvertible) mv) + { + NodePtr tmp(AllocHolder::create_node(autoboost::forward(mv))); + //push_back has no-throw guarantee so avoid any deallocator/destroyer + this->icont().push_back(*tmp); + } + + std::pair emplace_unique_impl(NodePtr p) + { + value_type &v = p->get_data(); + insert_commit_data data; + scoped_destroy_deallocator destroy_deallocator(p, this->node_alloc()); + std::pair ret = + this->insert_unique_check(KeyOfValue()(v), data); + if(!ret.second){ + return ret; + } + //No throw insertion part, release rollback + destroy_deallocator.release(); + return std::pair + ( iterator(iiterator(this->icont().insert_unique_commit(*p, data))) + , true ); + } + + iterator emplace_unique_hint_impl(const_iterator hint, NodePtr p) + { + value_type &v = p->get_data(); + insert_commit_data data; + std::pair ret = + this->insert_unique_check(hint, KeyOfValue()(v), data); + if(!ret.second){ + Destroyer(this->node_alloc())(p); + return ret.first; + } + return iterator(iiterator(this->icont().insert_unique_commit(*p, data))); + } + + public: + + #ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + template + std::pair emplace_unique(Args&&... args) + { return this->emplace_unique_impl(AllocHolder::create_node(autoboost::forward(args)...)); } + + template + iterator emplace_hint_unique(const_iterator hint, Args&&... args) + { return this->emplace_unique_hint_impl(hint, AllocHolder::create_node(autoboost::forward(args)...)); } + + template + iterator emplace_equal(Args&&... args) + { + NodePtr tmp(AllocHolder::create_node(autoboost::forward(args)...)); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_equal(this->icont().end(), *tmp)); + destroy_deallocator.release(); + return ret; + } + + template + iterator emplace_hint_equal(const_iterator hint, Args&&... args) + { + NodePtr tmp(AllocHolder::create_node(autoboost::forward(args)...)); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_equal(hint.get(), *tmp)); + destroy_deallocator.release(); + return ret; + } + + #else //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + std::pair emplace_unique(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + return this->emplace_unique_impl \ + (AllocHolder::create_node(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + } \ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + iterator emplace_hint_unique(const_iterator hint \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + return this->emplace_unique_hint_impl \ + (hint, AllocHolder::create_node(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + } \ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + iterator emplace_equal(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + NodePtr tmp(AllocHolder::create_node(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); \ + iterator ret(this->icont().insert_equal(this->icont().end(), *tmp)); \ + destroy_deallocator.release(); \ + return ret; \ + } \ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + iterator emplace_hint_equal(const_iterator hint \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + NodePtr tmp(AllocHolder::create_node(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); \ + iterator ret(this->icont().insert_equal(hint.get(), *tmp)); \ + destroy_deallocator.release(); \ + return ret; \ + } \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + iterator insert_unique(const_iterator hint, const value_type& v) + { + insert_commit_data data; + std::pair ret = + this->insert_unique_check(hint, KeyOfValue()(v), data); + if(!ret.second) + return ret.first; + return this->insert_unique_commit(v, data); + } + + template + iterator insert_unique(const_iterator hint, AUTOBOOST_FWD_REF(MovableConvertible) mv) + { + insert_commit_data data; + std::pair ret = + this->insert_unique_check(hint, KeyOfValue()(mv), data); + if(!ret.second) + return ret.first; + return this->insert_unique_commit(autoboost::forward(mv), data); + } + + template + void insert_unique(InputIterator first, InputIterator last) + { + for( ; first != last; ++first) + this->insert_unique(*first); + } + + iterator insert_equal(const value_type& v) + { + NodePtr tmp(AllocHolder::create_node(v)); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_equal(this->icont().end(), *tmp)); + destroy_deallocator.release(); + return ret; + } + + template + iterator insert_equal(AUTOBOOST_FWD_REF(MovableConvertible) mv) + { + NodePtr tmp(AllocHolder::create_node(autoboost::forward(mv))); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_equal(this->icont().end(), *tmp)); + destroy_deallocator.release(); + return ret; + } + + iterator insert_equal(const_iterator hint, const value_type& v) + { + NodePtr tmp(AllocHolder::create_node(v)); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_equal(hint.get(), *tmp)); + destroy_deallocator.release(); + return ret; + } + + template + iterator insert_equal(const_iterator hint, AUTOBOOST_FWD_REF(MovableConvertible) mv) + { + NodePtr tmp(AllocHolder::create_node(autoboost::forward(mv))); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_equal(hint.get(), *tmp)); + destroy_deallocator.release(); + return ret; + } + + template + void insert_equal(InputIterator first, InputIterator last) + { + for( ; first != last; ++first) + this->insert_equal(*first); + } + + iterator erase(const_iterator position) + { return iterator(this->icont().erase_and_dispose(position.get(), Destroyer(this->node_alloc()))); } + + size_type erase(const key_type& k) + { return AllocHolder::erase_key(k, KeyNodeCompare(value_comp()), alloc_version()); } + + iterator erase(const_iterator first, const_iterator last) + { return iterator(AllocHolder::erase_range(first.get(), last.get(), alloc_version())); } + + void clear() + { AllocHolder::clear(alloc_version()); } + + // search operations. Const and non-const overloads even if no iterator is returned + // so splay implementations can to their rebalancing when searching in non-const versions + iterator find(const key_type& k) + { return iterator(this->icont().find(k, KeyNodeCompare(value_comp()))); } + + const_iterator find(const key_type& k) const + { return const_iterator(this->non_const_icont().find(k, KeyNodeCompare(value_comp()))); } + + size_type count(const key_type& k) const + { return size_type(this->icont().count(k, KeyNodeCompare(value_comp()))); } + + iterator lower_bound(const key_type& k) + { return iterator(this->icont().lower_bound(k, KeyNodeCompare(value_comp()))); } + + const_iterator lower_bound(const key_type& k) const + { return const_iterator(this->non_const_icont().lower_bound(k, KeyNodeCompare(value_comp()))); } + + iterator upper_bound(const key_type& k) + { return iterator(this->icont().upper_bound(k, KeyNodeCompare(value_comp()))); } + + const_iterator upper_bound(const key_type& k) const + { return const_iterator(this->non_const_icont().upper_bound(k, KeyNodeCompare(value_comp()))); } + + std::pair equal_range(const key_type& k) + { + std::pair ret = + this->icont().equal_range(k, KeyNodeCompare(value_comp())); + return std::pair(iterator(ret.first), iterator(ret.second)); + } + + std::pair equal_range(const key_type& k) const + { + std::pair ret = + this->non_const_icont().equal_range(k, KeyNodeCompare(value_comp())); + return std::pair + (const_iterator(ret.first), const_iterator(ret.second)); + } + + std::pair lower_bound_range(const key_type& k) + { + std::pair ret = + this->icont().lower_bound_range(k, KeyNodeCompare(value_comp())); + return std::pair(iterator(ret.first), iterator(ret.second)); + } + + std::pair lower_bound_range(const key_type& k) const + { + std::pair ret = + this->non_const_icont().lower_bound_range(k, KeyNodeCompare(value_comp())); + return std::pair + (const_iterator(ret.first), const_iterator(ret.second)); + } + + void rebalance() + { intrusive_tree_proxy_t::rebalance(this->icont()); } + + friend bool operator==(const tree& x, const tree& y) + { return x.size() == y.size() && std::equal(x.begin(), x.end(), y.begin()); } + + friend bool operator<(const tree& x, const tree& y) + { return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); } + + friend bool operator!=(const tree& x, const tree& y) + { return !(x == y); } + + friend bool operator>(const tree& x, const tree& y) + { return y < x; } + + friend bool operator<=(const tree& x, const tree& y) + { return !(y < x); } + + friend bool operator>=(const tree& x, const tree& y) + { return !(x < y); } + + friend void swap(tree& x, tree& y) + { x.swap(y); } +}; + +} //namespace container_detail { +} //namespace container { +/* +//!has_trivial_destructor_after_move<> == true_type +//!specialization for optimizations +template +struct has_trivial_destructor_after_move + > +{ + static const bool value = has_trivial_destructor_after_move::value && has_trivial_destructor_after_move::value; +}; +*/ +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_CONTAINER_TREE_HPP diff --git a/contrib/autoboost/autoboost/container/detail/type_traits.hpp b/contrib/autoboost/autoboost/container/detail/type_traits.hpp new file mode 100644 index 000000000..6619e470d --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/type_traits.hpp @@ -0,0 +1,237 @@ +////////////////////////////////////////////////////////////////////////////// +// (C) Copyright John Maddock 2000. +// (C) Copyright Ion Gaztanaga 2005-2013. +// +// 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/libs/container for documentation. +// +// The alignment_of implementation comes from John Maddock's autoboost::alignment_of code +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_CONTAINER_DETAIL_TYPE_TRAITS_HPP +#define AUTOBOOST_CONTAINER_CONTAINER_DETAIL_TYPE_TRAITS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +namespace autoboost { +namespace container { +namespace container_detail { + +struct nat{}; + +template +struct LowPriorityConversion +{ + // Convertible from T with user-defined-conversion rank. + LowPriorityConversion(const U&) { } +}; + +//autoboost::alignment_of yields to 10K lines of preprocessed code, so we +//need an alternative +template struct alignment_of; + +template +struct alignment_of_hack +{ + char c; + T t; + alignment_of_hack(); +}; + +template +struct alignment_logic +{ + enum{ value = A < S ? A : S }; +}; + +template< typename T > +struct alignment_of +{ + enum{ value = alignment_logic + < sizeof(alignment_of_hack) - sizeof(T) + , sizeof(T)>::value }; +}; + +//This is not standard, but should work with all compilers +union max_align +{ + char char_; + short short_; + int int_; + long long_; + #ifdef AUTOBOOST_HAS_LONG_LONG + long long long_long_; + #endif + float float_; + double double_; + long double long_double_; + void * void_ptr_; +}; + +template +struct remove_reference +{ + typedef T type; +}; + +template +struct remove_reference +{ + typedef T type; +}; + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + +template +struct remove_reference +{ + typedef T type; +}; + +#else + +} // namespace container_detail { +} //namespace container { + +template +class rv; + +namespace container { +namespace container_detail { + +template +struct remove_reference< ::autoboost::rv > +{ + typedef T type; +}; + +#endif + +template +struct is_reference +{ + enum { value = false }; +}; + +template +struct is_reference +{ + enum { value = true }; +}; + +template +struct is_pointer +{ + enum { value = false }; +}; + +template +struct is_pointer +{ + enum { value = true }; +}; + +template +struct add_reference +{ + typedef T& type; +}; + +template +struct add_reference +{ + typedef T& type; +}; + +template<> +struct add_reference +{ + typedef nat &type; +}; + +template<> +struct add_reference +{ + typedef const nat &type; +}; + +template +struct add_const_reference +{ typedef const T &type; }; + +template +struct add_const_reference +{ typedef T& type; }; + +template +struct add_const +{ typedef const T type; }; + +template +struct is_same +{ + typedef char yes_type; + struct no_type + { + char padding[8]; + }; + + template + static yes_type is_same_tester(V*, V*); + static no_type is_same_tester(...); + + static T *t; + static U *u; + + static const bool value = sizeof(yes_type) == sizeof(is_same_tester(t,u)); +}; + +template +struct remove_const +{ + typedef T type; +}; + +template +struct remove_const< const T> +{ + typedef T type; +}; + +template +struct remove_ref_const +{ + typedef typename remove_const< typename remove_reference::type >::type type; +}; + +template +struct make_unsigned +{ + typedef T type; +}; + +template <> struct make_unsigned {}; +template <> struct make_unsigned {typedef unsigned char type;}; +template <> struct make_unsigned {typedef unsigned short type;}; +template <> struct make_unsigned {typedef unsigned int type;}; +template <> struct make_unsigned {typedef unsigned long type;}; +#ifdef AUTOBOOST_HAS_LONG_LONG +template <> struct make_unsigned {typedef unsigned long long type;}; +#endif + +} // namespace container_detail +} //namespace container { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_CONTAINER_DETAIL_TYPE_TRAITS_HPP diff --git a/contrib/autoboost/autoboost/container/detail/utilities.hpp b/contrib/autoboost/autoboost/container/detail/utilities.hpp new file mode 100644 index 000000000..40e118333 --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/utilities.hpp @@ -0,0 +1,1267 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_DETAIL_UTILITIES_HPP +#define AUTOBOOST_CONTAINER_DETAIL_UTILITIES_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include //for ::memmove / ::memcpy +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //std::distance + +namespace autoboost { +namespace container { + +////////////////////////////////////////////////////////////////////////////// +// +// swap +// +////////////////////////////////////////////////////////////////////////////// + +namespace container_swap { + +template::value > +struct has_member_swap +{ + static const bool value = autoboost::container::container_detail:: + has_member_function_callable_with_swap::value; +}; + +template +struct has_member_swap +{ + static const bool value = false; +}; + +} //namespace container_swap { + +template inline +typename container_detail::enable_if_c + ::value, void>::type +swap_dispatch(T &left, T &right) //swap using member swap +{ + left.swap(right); // may throw +} + +template inline +typename container_detail::enable_if_c + ::value/* && autoboost::has_move_emulation_enabled::value*/, void>::type + swap_dispatch(T &left, T &right) +{ + T temp(autoboost::move(left)); // may throw + left = autoboost::move(right); // may throw + right = autoboost::move(temp); // may throw +} +/* +template inline +typename container_detail::enable_if_c + ::value && !autoboost::has_move_emulation_enabled::value, void>::type + swap_dispatch(T &left, T &right) +{ + using std::swap; + swap(left, right); // may throw +} +*/ +namespace container_detail { + +template +inline T* addressof(T& obj) +{ + return static_cast( + static_cast( + const_cast( + &reinterpret_cast(obj) + ))); +} + +template +const T &max_value(const T &a, const T &b) +{ return a > b ? a : b; } + +template +const T &min_value(const T &a, const T &b) +{ return a < b ? a : b; } + +enum NextCapacityOption { NextCapacityDouble, NextCapacity60Percent }; + +template +struct next_capacity_calculator; + +template +struct next_capacity_calculator +{ + static SizeType get(const SizeType max_size + ,const SizeType capacity + ,const SizeType n) + { + const SizeType remaining = max_size - capacity; + if ( remaining < n ) + autoboost::container::throw_length_error("get_next_capacity, allocator's max_size reached"); + const SizeType additional = max_value(n, capacity); + return ( remaining < additional ) ? max_size : ( capacity + additional ); + } +}; + + +template +struct next_capacity_calculator +{ + static SizeType get(const SizeType max_size + ,const SizeType capacity + ,const SizeType n) + { + const SizeType remaining = max_size - capacity; + if ( remaining < n ) + autoboost::container::throw_length_error("get_next_capacity, allocator's max_size reached"); + const SizeType m3 = max_size/3; + + if (capacity < m3) + return capacity + max_value(3*(capacity+1)/5, n); + + if (capacity < m3*2) + return capacity + max_value((capacity+1)/2, n); + return max_size; + } +}; + +template +inline T* to_raw_pointer(T* p) +{ return p; } + +template +inline typename autoboost::intrusive::pointer_traits::element_type* + to_raw_pointer(const Pointer &p) +{ return autoboost::container::container_detail::to_raw_pointer(p.operator->()); } + +template +inline T* iterator_to_pointer(T* i) +{ return i; } + +template +inline typename std::iterator_traits::pointer + iterator_to_pointer(const Iterator &i) +{ return i.operator->(); } + +template +inline + typename autoboost::intrusive::pointer_traits + ::pointer>::element_type* + iterator_to_raw_pointer(const Iterator &i) +{ return (to_raw_pointer)((iterator_to_pointer)(i)); } + + +template +inline void swap_alloc(AllocatorType &, AllocatorType &, container_detail::false_type) + AUTOBOOST_CONTAINER_NOEXCEPT +{} + +template +inline void swap_alloc(AllocatorType &l, AllocatorType &r, container_detail::true_type) +{ autoboost::container::swap_dispatch(l, r); } + +template +inline void assign_alloc(AllocatorType &, const AllocatorType &, container_detail::false_type) + AUTOBOOST_CONTAINER_NOEXCEPT +{} + +template +inline void assign_alloc(AllocatorType &l, const AllocatorType &r, container_detail::true_type) +{ l = r; } + +template +inline void move_alloc(AllocatorType &, AllocatorType &, container_detail::false_type) + AUTOBOOST_CONTAINER_NOEXCEPT +{} + +template +inline void move_alloc(AllocatorType &l, AllocatorType &r, container_detail::true_type) +{ l = ::autoboost::move(r); } + +//Rounds "orig_size" by excess to round_to bytes +template +inline SizeType get_rounded_size(SizeType orig_size, SizeType round_to) +{ + return ((orig_size-1)/round_to+1)*round_to; +} + +template +struct ct_rounded_size +{ + enum { value = ((OrigSize-1)/RoundTo+1)*RoundTo }; +}; + +template +struct are_elements_contiguous +{ + static const bool value = false; +}; + +///////////////////////// +// raw pointers +///////////////////////// + +template +struct are_elements_contiguous +{ + static const bool value = true; +}; + +///////////////////////// +// predeclarations +///////////////////////// + +#ifndef AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +template +class vector_iterator; + +template +class vector_const_iterator; + +#endif //AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +} //namespace container_detail { +} //namespace container { + +namespace interprocess { + +template +class offset_ptr; + +} //namespace interprocess { + +namespace container { + +namespace container_detail { + +///////////////////////// +//vector_[const_]iterator +///////////////////////// + +#ifndef AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +template +struct are_elements_contiguous > +{ + static const bool value = true; +}; + +template +struct are_elements_contiguous > +{ + static const bool value = true; +}; + +#endif //AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +///////////////////////// +// offset_ptr +///////////////////////// + +template +struct are_elements_contiguous< ::autoboost::interprocess::offset_ptr > +{ + static const bool value = true; +}; + +template +struct are_contiguous_and_same +{ + static const bool is_same_io = + is_same< typename remove_const< typename ::std::iterator_traits::value_type >::type + , typename ::std::iterator_traits::value_type + >::value; + static const bool value = is_same_io && + are_elements_contiguous::value && + are_elements_contiguous::value; +}; + +template +struct is_memtransfer_copy_assignable +{ + static const bool value = are_contiguous_and_same::value && + autoboost::has_trivial_assign< typename ::std::iterator_traits::value_type >::value; +}; + +template +struct is_memtransfer_copy_constructible +{ + static const bool value = are_contiguous_and_same::value && + autoboost::has_trivial_copy< typename ::std::iterator_traits::value_type >::value; +}; + +template +struct enable_if_memtransfer_copy_constructible + : public enable_if_c::value, R> +{}; + +template +struct disable_if_memtransfer_copy_constructible + : public enable_if_c::value, R> +{}; + +template +struct enable_if_memtransfer_copy_assignable + : public enable_if_c::value, R> +{}; + +template +struct disable_if_memtransfer_copy_assignable + : public enable_if_c::value, R> +{}; + +template + // F models ForwardIterator +inline F memmove(I f, I l, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ + typedef typename std::iterator_traits::value_type value_type; + typename std::iterator_traits::difference_type n = std::distance(f, l); + ::memmove((iterator_to_raw_pointer)(r), (iterator_to_raw_pointer)(f), sizeof(value_type)*n); + std::advance(r, n); + return r; +} + +template + // F models ForwardIterator +F memmove_n(I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ + typedef typename std::iterator_traits::value_type value_type; + ::memmove((iterator_to_raw_pointer)(r), (iterator_to_raw_pointer)(f), sizeof(value_type)*n); + std::advance(r, n); + return r; +} + +template + // F models ForwardIterator +I memmove_n_source(I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ + typedef typename std::iterator_traits::value_type value_type; + ::memmove((iterator_to_raw_pointer)(r), (iterator_to_raw_pointer)(f), sizeof(value_type)*n); + std::advance(f, n); + return f; +} + +template + // F models ForwardIterator +I memmove_n_source_dest(I f, typename std::iterator_traits::difference_type n, F &r) AUTOBOOST_CONTAINER_NOEXCEPT +{ + typedef typename std::iterator_traits::value_type value_type; + ::memmove((iterator_to_raw_pointer)(r), (iterator_to_raw_pointer)(f), sizeof(value_type)*n); + std::advance(f, n); + std::advance(r, n); + return f; +} + +template +struct is_memzero_initializable +{ + typedef typename ::std::iterator_traits::value_type value_type; + static const bool value = are_elements_contiguous::value && + ( ::autoboost::is_integral::value || ::autoboost::is_enum::value + #if defined(AUTOBOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL) + || ::autoboost::is_pointer::value + #endif + #if defined(AUTOBOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO) + || ::autoboost::is_floating_point::value + #endif + #if defined(AUTOBOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO) && defined(AUTOBOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL) + || ::autoboost::is_pod::value + #endif + ); +}; + +template +struct enable_if_memzero_initializable + : public enable_if_c::value, R> +{}; + +template +struct disable_if_memzero_initializable + : public enable_if_c::value, R> +{}; + +} //namespace container_detail { + + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_move_alloc +// +////////////////////////////////////////////////////////////////////////////// + + +//! Effects: +//! \code +//! for (; f != l; ++r, ++f) +//! allocator_traits::construct(a, &*r, autoboost::move(*f)); +//! \endcode +//! +//! Returns: r +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_constructible::type + uninitialized_move_alloc(A &a, I f, I l, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (f != l) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r), autoboost::move(*f)); + ++f; ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_constructible::type + uninitialized_move_alloc(A &, I f, I l, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove(f, l, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_move_alloc_n +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; n--; ++r, ++f) +//! allocator_traits::construct(a, &*r, autoboost::move(*f)); +//! \endcode +//! +//! Returns: r +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_constructible::type + uninitialized_move_alloc_n(A &a, I f, typename std::iterator_traits::difference_type n, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (n--) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r), autoboost::move(*f)); + ++f; ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_constructible::type + uninitialized_move_alloc_n(A &, I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_move_alloc_n_source +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; n--; ++r, ++f) +//! allocator_traits::construct(a, &*r, autoboost::move(*f)); +//! \endcode +//! +//! Returns: f (after incremented) +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_constructible::type + uninitialized_move_alloc_n_source(A &a, I f, typename std::iterator_traits::difference_type n, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (n--) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r), autoboost::move(*f)); + ++f; ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return f; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_constructible::type + uninitialized_move_alloc_n_source(A &, I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n_source(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_copy_alloc +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; f != l; ++r, ++f) +//! allocator_traits::construct(a, &*r, *f); +//! \endcode +//! +//! Returns: r +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_constructible::type + uninitialized_copy_alloc(A &a, I f, I l, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (f != l) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r), *f); + ++f; ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_constructible::type + uninitialized_copy_alloc(A &, I f, I l, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove(f, l, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_copy_alloc_n +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; n--; ++r, ++f) +//! allocator_traits::construct(a, &*r, *f); +//! \endcode +//! +//! Returns: r +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_constructible::type + uninitialized_copy_alloc_n(A &a, I f, typename std::iterator_traits::difference_type n, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (n--) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r), *f); + ++f; ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_constructible::type + uninitialized_copy_alloc_n(A &, I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_copy_alloc_n_source +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; n--; ++r, ++f) +//! allocator_traits::construct(a, &*r, *f); +//! \endcode +//! +//! Returns: f (after incremented) +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_constructible::type + uninitialized_copy_alloc_n_source(A &a, I f, typename std::iterator_traits::difference_type n, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (n--) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r), *f); + ++f; ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return f; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_constructible::type + uninitialized_copy_alloc_n_source(A &, I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n_source(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_value_init_alloc_n +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; n--; ++r, ++f) +//! allocator_traits::construct(a, &*r); +//! \endcode +//! +//! Returns: r +template + // F models ForwardIterator +inline typename container_detail::disable_if_memzero_initializable::type + uninitialized_value_init_alloc_n(A &a, typename allocator_traits::difference_type n, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (n--) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r)); + ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memzero_initializable::type + uninitialized_value_init_alloc_n(A &, typename allocator_traits::difference_type n, F r) +{ + typedef typename std::iterator_traits::value_type value_type; + ::memset((void*)container_detail::iterator_to_raw_pointer(r), 0, sizeof(value_type)*n); + std::advance(r, n); + return r; +} + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_default_init_alloc_n +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; n--; ++r, ++f) +//! allocator_traits::construct(a, &*r); +//! \endcode +//! +//! Returns: r +template + // F models ForwardIterator +inline F uninitialized_default_init_alloc_n(A &a, typename allocator_traits::difference_type n, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (n--) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r), default_init); + ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return r; +} + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_fill_alloc +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; f != l; ++r, ++f) +//! allocator_traits::construct(a, &*r, *f); +//! \endcode +//! +//! Returns: r +template + +inline void uninitialized_fill_alloc(A &a, F f, F l, const T &t) +{ + F back = f; + AUTOBOOST_TRY{ + while (f != l) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(f), t); + ++f; + } + } + AUTOBOOST_CATCH(...){ + for (; back != l; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END +} + + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_fill_alloc_n +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; n--; ++r, ++f) +//! allocator_traits::construct(a, &*r, v); +//! \endcode +//! +//! Returns: r +template + // F models ForwardIterator +inline F uninitialized_fill_alloc_n(A &a, const T &v, typename allocator_traits::difference_type n, F r) +{ + F back = r; + AUTOBOOST_TRY{ + while (n--) { + allocator_traits::construct(a, container_detail::iterator_to_raw_pointer(r), v); + ++r; + } + } + AUTOBOOST_CATCH(...){ + for (; back != r; ++back){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(back)); + } + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return r; +} + +////////////////////////////////////////////////////////////////////////////// +// +// copy +// +////////////////////////////////////////////////////////////////////////////// + +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + copy(I f, I l, F r) +{ + while (f != l) { + *r = *f; + ++f; ++r; + } + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_assignable::type + copy(I f, I l, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove(f, l, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// copy_n +// +////////////////////////////////////////////////////////////////////////////// + +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + copy_n(I f, typename std::iterator_traits::difference_type n, F r) +{ + while (n--) { + *r = *f; + ++f; ++r; + } + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_assignable::type + copy_n(I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// copy_n_source +// +////////////////////////////////////////////////////////////////////////////// + +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + copy_n_source(I f, typename std::iterator_traits::difference_type n, F r) +{ + while (n--) { + *r = *f; + ++f; ++r; + } + return f; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_assignable::type + copy_n_source(I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n_source(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// copy_n_source_dest +// +////////////////////////////////////////////////////////////////////////////// + +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + copy_n_source_dest(I f, typename std::iterator_traits::difference_type n, F &r) +{ + while (n--) { + *r = *f; + ++f; ++r; + } + return f; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_assignable::type + copy_n_source_dest(I f, typename std::iterator_traits::difference_type n, F &r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n_source_dest(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// move +// +////////////////////////////////////////////////////////////////////////////// + +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + move(I f, I l, F r) +{ + while (f != l) { + *r = ::autoboost::move(*f); + ++f; ++r; + } + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_assignable::type + move(I f, I l, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove(f, l, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// move_n +// +////////////////////////////////////////////////////////////////////////////// + +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + move_n(I f, typename std::iterator_traits::difference_type n, F r) +{ + while (n--) { + *r = ::autoboost::move(*f); + ++f; ++r; + } + return r; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_assignable::type + move_n(I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// move_n_source +// +////////////////////////////////////////////////////////////////////////////// + +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + move_n_source(I f, typename std::iterator_traits::difference_type n, F r) +{ + while (n--) { + *r = ::autoboost::move(*f); + ++f; ++r; + } + return f; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_assignable::type + move_n_source(I f, typename std::iterator_traits::difference_type n, F r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n_source(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// move_n_source_dest +// +////////////////////////////////////////////////////////////////////////////// + +template + // F models ForwardIterator +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + move_n_source_dest(I f, typename std::iterator_traits::difference_type n, F &r) +{ + while (n--) { + *r = ::autoboost::move(*f); + ++f; ++r; + } + return f; +} + +template + // F models ForwardIterator +inline typename container_detail::enable_if_memtransfer_copy_assignable::type + move_n_source_dest(I f, typename std::iterator_traits::difference_type n, F &r) AUTOBOOST_CONTAINER_NOEXCEPT +{ return container_detail::memmove_n_source_dest(f, n, r); } + +////////////////////////////////////////////////////////////////////////////// +// +// destroy_n +// +////////////////////////////////////////////////////////////////////////////// + +template + // I models InputIterator +inline void destroy_alloc_n(A &a, I f, typename std::iterator_traits::difference_type n + ,typename autoboost::container::container_detail::enable_if_c + < !autoboost::has_trivial_destructor::value_type>::value >::type* = 0) +{ + while(n--){ + allocator_traits::destroy(a, container_detail::iterator_to_raw_pointer(f++)); + } +} + +template + // I models InputIterator +inline void destroy_alloc_n(A &, I, typename std::iterator_traits::difference_type + ,typename autoboost::container::container_detail::enable_if_c + < autoboost::has_trivial_destructor::value_type>::value >::type* = 0) +{} + +////////////////////////////////////////////////////////////////////////////// +// +// deep_swap_alloc_n +// +////////////////////////////////////////////////////////////////////////////// + +template + +inline typename container_detail::disable_if_memtransfer_copy_assignable::type + deep_swap_alloc_n( A &a, F short_range_f, typename allocator_traits::size_type n_i + , G large_range_f, typename allocator_traits::size_type n_j) +{ + typename allocator_traits::size_type n = 0; + for (; n != n_i ; ++short_range_f, ++large_range_f, ++n){ + autoboost::container::swap_dispatch(*short_range_f, *large_range_f); + } + autoboost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f); // may throw + autoboost::container::destroy_alloc_n(a, large_range_f, n_j - n_i); +} + +static const std::size_t DeepSwapAllocNMaxStorage = std::size_t(1) << std::size_t(11); //2K bytes + +template + +inline typename container_detail::enable_if_c + < container_detail::is_memtransfer_copy_assignable::value && (MaxTmpBytes <= DeepSwapAllocNMaxStorage) && false + , void>::type + deep_swap_alloc_n( A &a, F short_range_f, typename allocator_traits::size_type n_i + , G large_range_f, typename allocator_traits::size_type n_j) +{ + typedef typename allocator_traits::value_type value_type; + typedef typename autoboost::aligned_storage + ::value>::type storage_type; + storage_type storage; + + const std::size_t n_i_bytes = sizeof(value_type)*n_i; + void *const large_ptr = static_cast(container_detail::iterator_to_raw_pointer(large_range_f)); + void *const short_ptr = static_cast(container_detail::iterator_to_raw_pointer(short_range_f)); + void *const stora_ptr = static_cast(container_detail::iterator_to_raw_pointer(storage)); + ::memcpy(stora_ptr, large_ptr, n_i_bytes); + ::memcpy(large_ptr, short_ptr, n_i_bytes); + ::memcpy(short_ptr, stora_ptr, n_i_bytes); + std::advance(large_range_f, n_i); + std::advance(short_range_f, n_i); + autoboost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f); // may throw + autoboost::container::destroy_alloc_n(a, large_range_f, n_j - n_i); +} + +template + +inline typename container_detail::enable_if_c + < container_detail::is_memtransfer_copy_assignable::value && true//(MaxTmpBytes > DeepSwapAllocNMaxStorage) + , void>::type + deep_swap_alloc_n( A &a, F short_range_f, typename allocator_traits::size_type n_i + , G large_range_f, typename allocator_traits::size_type n_j) +{ + typedef typename allocator_traits::value_type value_type; + typedef typename autoboost::aligned_storage + ::value>::type storage_type; + storage_type storage; + const std::size_t sizeof_storage = sizeof(storage); + + std::size_t n_i_bytes = sizeof(value_type)*n_i; + char *large_ptr = static_cast(static_cast(container_detail::iterator_to_raw_pointer(large_range_f))); + char *short_ptr = static_cast(static_cast(container_detail::iterator_to_raw_pointer(short_range_f))); + char *stora_ptr = static_cast(static_cast(&storage)); + + std::size_t szt_times = n_i_bytes/sizeof_storage; + const std::size_t szt_rem = n_i_bytes%sizeof_storage; + + //Loop unrolling using Duff's device, as it seems it helps on some architectures + const std::size_t Unroll = 4; + std::size_t n = (szt_times + (Unroll-1))/Unroll; + const std::size_t branch_number = (!szt_times)*Unroll + (szt_times % Unroll); + switch(branch_number){ + case 4: + break; + case 0: do{ + ::memcpy(stora_ptr, large_ptr, sizeof_storage); + ::memcpy(large_ptr, short_ptr, sizeof_storage); + ::memcpy(short_ptr, stora_ptr, sizeof_storage); + large_ptr += sizeof_storage; + short_ptr += sizeof_storage; + AUTOBOOST_CONTAINER_FALLTHOUGH + case 3: + ::memcpy(stora_ptr, large_ptr, sizeof_storage); + ::memcpy(large_ptr, short_ptr, sizeof_storage); + ::memcpy(short_ptr, stora_ptr, sizeof_storage); + large_ptr += sizeof_storage; + short_ptr += sizeof_storage; + AUTOBOOST_CONTAINER_FALLTHOUGH + case 2: + ::memcpy(stora_ptr, large_ptr, sizeof_storage); + ::memcpy(large_ptr, short_ptr, sizeof_storage); + ::memcpy(short_ptr, stora_ptr, sizeof_storage); + large_ptr += sizeof_storage; + short_ptr += sizeof_storage; + AUTOBOOST_CONTAINER_FALLTHOUGH + case 1: + ::memcpy(stora_ptr, large_ptr, sizeof_storage); + ::memcpy(large_ptr, short_ptr, sizeof_storage); + ::memcpy(short_ptr, stora_ptr, sizeof_storage); + large_ptr += sizeof_storage; + short_ptr += sizeof_storage; + } while(--n); + } + ::memcpy(stora_ptr, large_ptr, szt_rem); + ::memcpy(large_ptr, short_ptr, szt_rem); + ::memcpy(short_ptr, stora_ptr, szt_rem); + std::advance(large_range_f, n_i); + std::advance(short_range_f, n_i); + autoboost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f); // may throw + autoboost::container::destroy_alloc_n(a, large_range_f, n_j - n_i); +} + + +////////////////////////////////////////////////////////////////////////////// +// +// copy_assign_range_alloc_n +// +////////////////////////////////////////////////////////////////////////////// + +template + +void copy_assign_range_alloc_n( A &a, I inp_start, typename allocator_traits::size_type n_i + , O out_start, typename allocator_traits::size_type n_o ) +{ + if (n_o < n_i){ + inp_start = autoboost::container::copy_n_source_dest(inp_start, n_o, out_start); // may throw + autoboost::container::uninitialized_copy_alloc_n(a, inp_start, n_i - n_o, out_start);// may throw + } + else{ + out_start = autoboost::container::copy_n(inp_start, n_i, out_start); // may throw + autoboost::container::destroy_alloc_n(a, out_start, n_o - n_i); + } +} + +////////////////////////////////////////////////////////////////////////////// +// +// move_assign_range_alloc_n +// +////////////////////////////////////////////////////////////////////////////// + +template + +void move_assign_range_alloc_n( A &a, I inp_start, typename allocator_traits::size_type n_i + , O out_start, typename allocator_traits::size_type n_o ) +{ + if (n_o < n_i){ + inp_start = autoboost::container::move_n_source_dest(inp_start, n_o, out_start); // may throw + autoboost::container::uninitialized_move_alloc_n(a, inp_start, n_i - n_o, out_start); // may throw + } + else{ + out_start = autoboost::container::move_n(inp_start, n_i, out_start); // may throw + autoboost::container::destroy_alloc_n(a, out_start, n_o - n_i); + } +} + +} //namespace container { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_UTILITIES_HPP diff --git a/contrib/autoboost/autoboost/container/detail/value_init.hpp b/contrib/autoboost/autoboost/container/detail/value_init.hpp new file mode 100644 index 000000000..a5e83df4b --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/value_init.hpp @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. +// +// 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_DETAIL_VALUE_INIT_HPP +#define AUTOBOOST_CONTAINER_DETAIL_VALUE_INIT_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +namespace autoboost { +namespace container { +namespace container_detail { + +template +struct value_init +{ + value_init() + : m_t() + {} + + operator T &() { return m_t; } + + T m_t; +}; + +} //namespace container_detail { +} //namespace container { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_VALUE_INIT_HPP diff --git a/contrib/autoboost/boost/container/detail/variadic_templates_tools.hpp b/contrib/autoboost/autoboost/container/detail/variadic_templates_tools.hpp similarity index 91% rename from contrib/autoboost/boost/container/detail/variadic_templates_tools.hpp rename to contrib/autoboost/autoboost/container/detail/variadic_templates_tools.hpp index 6255d6d08..ddaca6cf8 100644 --- a/contrib/autoboost/boost/container/detail/variadic_templates_tools.hpp +++ b/contrib/autoboost/autoboost/container/detail/variadic_templates_tools.hpp @@ -8,17 +8,17 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP -#define BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP +#ifndef AUTOBOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP +#define AUTOBOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include +#include +#include -#include +#include #include //std::size_t namespace autoboost { @@ -149,6 +149,6 @@ struct build_number_seq<0, index_tuple > }}} //namespace autoboost { namespace container { namespace container_detail { -#include +#include -#endif //#ifndef BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP diff --git a/contrib/autoboost/autoboost/container/detail/version_type.hpp b/contrib/autoboost/autoboost/container/detail/version_type.hpp new file mode 100644 index 000000000..e0dd88585 --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/version_type.hpp @@ -0,0 +1,103 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// +// +// This code comes from N1953 document by Howard E. Hinnant +// +////////////////////////////////////////////////////////////////////////////// + + +#ifndef AUTOBOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP +#define AUTOBOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include + +namespace autoboost{ +namespace container { +namespace container_detail { + +//using namespace autoboost; + +template +struct version_type + : public container_detail::integral_constant +{ + typedef T type; + + version_type(const version_type&); +}; + +namespace impl{ + +template , typename T::version>::value> +struct extract_version +{ + static const unsigned value = 1; +}; + +template +struct extract_version +{ + static const unsigned value = T::version::value; +}; + +template +struct has_version +{ + private: + struct two {char _[2];}; + template static two test(...); + template static char test(const typename U::version*); + public: + static const bool value = sizeof(test(0)) == 1; + void dummy(){} +}; + +template ::value> +struct version +{ + static const unsigned value = 1; +}; + +template +struct version +{ + static const unsigned value = extract_version::value; +}; + +} //namespace impl + +template +struct version + : public container_detail::integral_constant::value> +{}; + +template +struct is_version +{ + static const bool value = + is_same< typename version::type, integral_constant >::value; +}; + +} //namespace container_detail { +} //namespace container { +} //namespace autoboost{ + +#include + +#endif //#define AUTOBOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP diff --git a/contrib/autoboost/autoboost/container/detail/workaround.hpp b/contrib/autoboost/autoboost/container/detail/workaround.hpp new file mode 100644 index 000000000..72b3ce708 --- /dev/null +++ b/contrib/autoboost/autoboost/container/detail/workaround.hpp @@ -0,0 +1,72 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_DETAIL_WORKAROUND_HPP +#define AUTOBOOST_CONTAINER_DETAIL_WORKAROUND_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include + +#if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES)\ + && !defined(AUTOBOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL) + #define AUTOBOOST_CONTAINER_PERFECT_FORWARDING +#endif + +#if defined(AUTOBOOST_NO_CXX11_NOEXCEPT) + #if defined(AUTOBOOST_MSVC) + #define AUTOBOOST_CONTAINER_NOEXCEPT throw() + #else + #define AUTOBOOST_CONTAINER_NOEXCEPT + #endif + #define AUTOBOOST_CONTAINER_NOEXCEPT_IF(x) +#else + #define AUTOBOOST_CONTAINER_NOEXCEPT noexcept + #define AUTOBOOST_CONTAINER_NOEXCEPT_IF(x) noexcept(x) +#endif + +#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(__GXX_EXPERIMENTAL_CXX0X__)\ + && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40700) + #define AUTOBOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST +#endif + +#if !defined(AUTOBOOST_FALLTHOUGH) + #define AUTOBOOST_CONTAINER_FALLTHOUGH +#else + #define AUTOBOOST_CONTAINER_FALLTHOUGH AUTOBOOST_FALLTHOUGH; +#endif + +//Macros for documentation purposes. For code, expands to the argument +#define AUTOBOOST_CONTAINER_IMPDEF(TYPE) TYPE +#define AUTOBOOST_CONTAINER_SEEDOC(TYPE) TYPE + +//Macros for memset optimization. In most platforms +//memsetting pointers and floatings is safe and faster. +// +//If your platform does not offer these guarantees +//define these to value zero. +#ifndef AUTOBOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_NOT_ZERO +#define AUTOBOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO 1 +#endif + +#ifndef AUTOBOOST_CONTAINER_MEMZEROED_POINTER_IS_NOT_NULL +#define AUTOBOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL +#endif + +#define AUTOBOOST_CONTAINER_DOC1ST(TYPE1, TYPE2) TYPE2 +#define AUTOBOOST_CONTAINER_I , +#define AUTOBOOST_CONTAINER_DOCIGN(T) T +#define AUTOBOOST_CONTAINER_DOCONLY(T) + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_DETAIL_WORKAROUND_HPP diff --git a/contrib/autoboost/autoboost/container/list.hpp b/contrib/autoboost/autoboost/container/list.hpp new file mode 100644 index 000000000..64a6564e9 --- /dev/null +++ b/contrib/autoboost/autoboost/container/list.hpp @@ -0,0 +1,1462 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// + +#ifndef AUTOBOOST_CONTAINER_LIST_HPP +#define AUTOBOOST_CONTAINER_LIST_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(AUTOBOOST_CONTAINER_PERFECT_FORWARDING) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) +#else +//Preprocessor library to emulate perfect forwarding +#include +#endif + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) +#include +#endif + +#include +#include +#include +#include +#include + +namespace autoboost { +namespace container { + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +namespace container_detail { + +template +struct list_hook +{ + typedef typename container_detail::bi::make_list_base_hook + , container_detail::bi::link_mode >::type type; +}; + +template +struct list_node + : public list_hook::type +{ + private: + list_node(); + + public: + typedef T value_type; + typedef typename list_hook::type hook_type; + + T m_data; + + T &get_data() + { return this->m_data; } + + const T &get_data() const + { return this->m_data; } +}; + +template +struct iiterator_node_value_type< list_node > { + typedef T type; +}; + +template +struct intrusive_list_type +{ + typedef autoboost::container::allocator_traits allocator_traits_type; + typedef typename allocator_traits_type::value_type value_type; + typedef typename autoboost::intrusive::pointer_traits + ::template + rebind_pointer::type + void_pointer; + typedef typename container_detail::list_node + node_type; + typedef typename container_detail::bi::make_list + < node_type + , container_detail::bi::base_hook::type> + , container_detail::bi::constant_time_size + , container_detail::bi::size_type + + >::type container_type; + typedef container_type type ; +}; + +} //namespace container_detail { +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//! A list is a doubly linked list. That is, it is a Sequence that supports both +//! forward and backward traversal, and (amortized) constant time insertion and +//! removal of elements at the beginning or the end, or in the middle. Lists have +//! the important property that insertion and splicing do not invalidate iterators +//! to list elements, and that even removal invalidates only the iterators that point +//! to the elements that are removed. The ordering of iterators may be changed +//! (that is, list::iterator might have a different predecessor or successor +//! after a list operation than it did before), but the iterators themselves will +//! not be invalidated or made to point to different elements unless that invalidation +//! or mutation is explicit. +//! +//! \tparam T The type of object that is stored in the list +//! \tparam Allocator The allocator used for all internal memory management +#ifdef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +template > +#else +template +#endif +class list + : protected container_detail::node_alloc_holder + ::type> +{ + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + typedef typename + container_detail::intrusive_list_type::type Icont; + typedef container_detail::node_alloc_holder AllocHolder; + typedef typename AllocHolder::NodePtr NodePtr; + typedef typename AllocHolder::NodeAlloc NodeAlloc; + typedef typename AllocHolder::ValAlloc ValAlloc; + typedef typename AllocHolder::Node Node; + typedef container_detail::allocator_destroyer Destroyer; + typedef typename AllocHolder::allocator_v1 allocator_v1; + typedef typename AllocHolder::allocator_v2 allocator_v2; + typedef typename AllocHolder::alloc_version alloc_version; + typedef autoboost::container::allocator_traits allocator_traits_type; + + class equal_to_value + { + typedef typename AllocHolder::value_type value_type; + const value_type &t_; + + public: + equal_to_value(const value_type &t) + : t_(t) + {} + + bool operator()(const value_type &t)const + { return t_ == t; } + }; + + template + struct ValueCompareToNodeCompare + : Pred + { + ValueCompareToNodeCompare(Pred pred) + : Pred(pred) + {} + + bool operator()(const Node &a, const Node &b) const + { return static_cast(*this)(a.m_data, b.m_data); } + + bool operator()(const Node &a) const + { return static_cast(*this)(a.m_data); } + }; + + AUTOBOOST_COPYABLE_AND_MOVABLE(list) + + typedef container_detail::iterator iterator_impl; + typedef container_detail::iterator const_iterator_impl; + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + public: + ////////////////////////////////////////////// + // + // types + // + ////////////////////////////////////////////// + + typedef T value_type; + typedef typename ::autoboost::container::allocator_traits::pointer pointer; + typedef typename ::autoboost::container::allocator_traits::const_pointer const_pointer; + typedef typename ::autoboost::container::allocator_traits::reference reference; + typedef typename ::autoboost::container::allocator_traits::const_reference const_reference; + typedef typename ::autoboost::container::allocator_traits::size_type size_type; + typedef typename ::autoboost::container::allocator_traits::difference_type difference_type; + typedef Allocator allocator_type; + typedef AUTOBOOST_CONTAINER_IMPDEF(NodeAlloc) stored_allocator_type; + typedef AUTOBOOST_CONTAINER_IMPDEF(iterator_impl) iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(const_iterator_impl) const_iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(container_detail::reverse_iterator) reverse_iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(container_detail::reverse_iterator) const_reverse_iterator; + + ////////////////////////////////////////////// + // + // construct/copy/destroy + // + ////////////////////////////////////////////// + + //! Effects: Default constructs a list. + //! + //! Throws: If allocator_type's default constructor throws. + //! + //! Complexity: Constant. + list() + : AllocHolder() + {} + + //! Effects: Constructs a list taking the allocator as parameter. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + explicit list(const allocator_type &a) AUTOBOOST_CONTAINER_NOEXCEPT + : AllocHolder(a) + {} + + //! Effects: Constructs a list that will use a copy of allocator a + //! and inserts n copies of value. + //! + //! Throws: If allocator_type's default constructor + //! throws or T's default or copy constructor throws. + //! + //! Complexity: Linear to n. + explicit list(size_type n) + : AllocHolder(Allocator()) + { this->resize(n); } + + //! Effects: Constructs a list that will use a copy of allocator a + //! and inserts n copies of value. + //! + //! Throws: If allocator_type's default constructor + //! throws or T's default or copy constructor throws. + //! + //! Complexity: Linear to n. + list(size_type n, const T& value, const Allocator& a = Allocator()) + : AllocHolder(a) + { this->insert(this->cbegin(), n, value); } + + //! Effects: Copy constructs a list. + //! + //! Postcondition: x == *this. + //! + //! Throws: If allocator_type's default constructor throws. + //! + //! Complexity: Linear to the elements x contains. + list(const list& x) + : AllocHolder(x) + { this->insert(this->cbegin(), x.begin(), x.end()); } + + //! Effects: Move constructor. Moves mx's resources to *this. + //! + //! Throws: If allocator_type's copy constructor throws. + //! + //! Complexity: Constant. + list(AUTOBOOST_RV_REF(list) x) + : AllocHolder(autoboost::move(static_cast(x))) + {} + + //! Effects: Copy constructs a list using the specified allocator. + //! + //! Postcondition: x == *this. + //! + //! Throws: If allocator_type's default constructor or copy constructor throws. + //! + //! Complexity: Linear to the elements x contains. + list(const list& x, const allocator_type &a) + : AllocHolder(a) + { this->insert(this->cbegin(), x.begin(), x.end()); } + + //! Effects: Move constructor sing the specified allocator. + //! Moves mx's resources to *this. + //! + //! Throws: If allocation or value_type's copy constructor throws. + //! + //! Complexity: Constant if a == x.get_allocator(), linear otherwise. + list(AUTOBOOST_RV_REF(list) x, const allocator_type &a) + : AllocHolder(a) + { + if(this->node_alloc() == x.node_alloc()){ + this->icont().swap(x.icont()); + } + else{ + this->insert(this->cbegin(), x.begin(), x.end()); + } + } + + //! Effects: Constructs a list that will use a copy of allocator a + //! and inserts a copy of the range [first, last) in the list. + //! + //! Throws: If allocator_type's default constructor + //! throws or T's constructor taking a dereferenced InIt throws. + //! + //! Complexity: Linear to the range [first, last). + template + list(InpIt first, InpIt last, const Allocator &a = Allocator()) + : AllocHolder(a) + { this->insert(this->cbegin(), first, last); } + + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Constructs a list that will use a copy of allocator a + //! and inserts a copy of the range [il.begin(), il.end()) in the list. + //! + //! Throws: If allocator_type's default constructor + //! throws or T's constructor taking a dereferenced + //! std::initializer_list iterator throws. + //! + //! Complexity: Linear to the range [il.begin(), il.end()). + list(std::initializer_list il, const Allocator &a = Allocator()) + : AllocHolder(a) + { this->insert(this->cbegin(), il.begin(), il.end()); } +#endif + + //! Effects: Destroys the list. All stored values are destroyed + //! and used memory is deallocated. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the number of elements. + ~list() AUTOBOOST_CONTAINER_NOEXCEPT + {} //AllocHolder clears the list + + //! Effects: Makes *this contain the same elements as x. + //! + //! Postcondition: this->size() == x.size(). *this contains a copy + //! of each of x's elements. + //! + //! Throws: If memory allocation throws or T's copy constructor throws. + //! + //! Complexity: Linear to the number of elements in x. + list& operator=(AUTOBOOST_COPY_ASSIGN_REF(list) x) + { + if (&x != this){ + NodeAlloc &this_alloc = this->node_alloc(); + const NodeAlloc &x_alloc = x.node_alloc(); + container_detail::bool_ flag; + if(flag && this_alloc != x_alloc){ + this->clear(); + } + this->AllocHolder::copy_assign_alloc(x); + this->assign(x.begin(), x.end()); + } + return *this; + } + + //! Effects: Move assignment. All x's values are transferred to *this. + //! + //! Postcondition: x.empty(). *this contains a the elements x had + //! before the function. + //! + //! Throws: If allocator_traits_type::propagate_on_container_move_assignment + //! is false and (allocation throws or value_type's move constructor throws) + //! + //! Complexity: Constant if allocator_traits_type:: + //! propagate_on_container_move_assignment is true or + //! this->get>allocator() == x.get_allocator(). Linear otherwise. + list& operator=(AUTOBOOST_RV_REF(list) x) + AUTOBOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value) + { + AUTOBOOST_ASSERT(this != &x); + NodeAlloc &this_alloc = this->node_alloc(); + NodeAlloc &x_alloc = x.node_alloc(); + const bool propagate_alloc = allocator_traits_type:: + propagate_on_container_move_assignment::value; + const bool allocators_equal = this_alloc == x_alloc; (void)allocators_equal; + //Resources can be transferred if both allocators are + //going to be equal after this function (either propagated or already equal) + if(propagate_alloc || allocators_equal){ + //Destroy + this->clear(); + //Move allocator if needed + this->AllocHolder::move_assign_alloc(x); + //Obtain resources + this->icont() = autoboost::move(x.icont()); + } + //Else do a one by one move + else{ + this->assign( autoboost::make_move_iterator(x.begin()) + , autoboost::make_move_iterator(x.end())); + } + return *this; + } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Makes *this contain the same elements as il. + //! + //! Postcondition: this->size() == il.size(). *this contains a copy + //! of each of x's elements. + //! + //! Throws: If memory allocation throws or T's copy constructor throws. + //! + //! Complexity: Linear to the number of elements in x. + list& operator=(std::initializer_list il) + { + assign(il.begin(), il.end()); + return *this; + } +#endif + + //! Effects: Assigns the n copies of val to *this. + //! + //! Throws: If memory allocation throws or T's copy constructor throws. + //! + //! Complexity: Linear to n. + void assign(size_type n, const T& val) + { + typedef constant_iterator cvalue_iterator; + return this->assign(cvalue_iterator(val, n), cvalue_iterator()); + } + + //! Effects: Assigns the the range [first, last) to *this. + //! + //! Throws: If memory allocation throws or + //! T's constructor from dereferencing InpIt throws. + //! + //! Complexity: Linear to n. + template + void assign(InpIt first, InpIt last + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + >::type * = 0 + #endif + ) + { + iterator first1 = this->begin(); + const iterator last1 = this->end(); + for ( ; first1 != last1 && first != last; ++first1, ++first) + *first1 = *first; + if (first == last) + this->erase(first1, last1); + else{ + this->insert(last1, first, last); + } + } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Assigns the the range [il.begin(), il.end()) to *this. + //! + //! Throws: If memory allocation throws or + //! T's constructor from dereferencing std::initializer_list iterator throws. + //! + //! Complexity: Linear to n. + void assign(std::initializer_list il) + { assign(il.begin(), il.end()); } +#endif + + //! Effects: Returns a copy of the internal allocator. + //! + //! Throws: If allocator's copy constructor throws. + //! + //! Complexity: Constant. + allocator_type get_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT + { return allocator_type(this->node_alloc()); } + + //! Effects: Returns a reference to the internal allocator. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Non-standard extension. + stored_allocator_type &get_stored_allocator() AUTOBOOST_CONTAINER_NOEXCEPT + { return this->node_alloc(); } + + //! Effects: Returns a reference to the internal allocator. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Non-standard extension. + const stored_allocator_type &get_stored_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->node_alloc(); } + + ////////////////////////////////////////////// + // + // iterators + // + ////////////////////////////////////////////// + + //! Effects: Returns an iterator to the first element contained in the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + iterator begin() AUTOBOOST_CONTAINER_NOEXCEPT + { return iterator(this->icont().begin()); } + + //! Effects: Returns a const_iterator to the first element contained in the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator begin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->cbegin(); } + + //! Effects: Returns an iterator to the end of the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + iterator end() AUTOBOOST_CONTAINER_NOEXCEPT + { return iterator(this->icont().end()); } + + //! Effects: Returns a const_iterator to the end of the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator end() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->cend(); } + + //! Effects: Returns a reverse_iterator pointing to the beginning + //! of the reversed list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reverse_iterator rbegin() AUTOBOOST_CONTAINER_NOEXCEPT + { return reverse_iterator(end()); } + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator rbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->crbegin(); } + + //! Effects: Returns a reverse_iterator pointing to the end + //! of the reversed list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reverse_iterator rend() AUTOBOOST_CONTAINER_NOEXCEPT + { return reverse_iterator(begin()); } + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator rend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->crend(); } + + //! Effects: Returns a const_iterator to the first element contained in the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_iterator(this->non_const_icont().begin()); } + + //! Effects: Returns a const_iterator to the end of the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_iterator(this->non_const_icont().end()); } + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_reverse_iterator(this->cend()); } + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_reverse_iterator(this->cbegin()); } + + ////////////////////////////////////////////// + // + // capacity + // + ////////////////////////////////////////////// + + //! Effects: Returns true if the list contains no elements. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + bool empty() const AUTOBOOST_CONTAINER_NOEXCEPT + { return !this->size(); } + + //! Effects: Returns the number of the elements contained in the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type size() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->icont().size(); } + + //! Effects: Returns the largest possible size of the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type max_size() const AUTOBOOST_CONTAINER_NOEXCEPT + { return AllocHolder::max_size(); } + + //! Effects: Inserts or erases elements at the end such that + //! the size becomes n. New elements are value initialized. + //! + //! Throws: If memory allocation throws, or T's copy constructor throws. + //! + //! Complexity: Linear to the difference between size() and new_size. + void resize(size_type new_size) + { + if(!priv_try_shrink(new_size)){ + typedef value_init_construct_iterator value_init_iterator; + this->insert(this->cend(), value_init_iterator(new_size - this->size()), value_init_iterator()); + } + } + + //! Effects: Inserts or erases elements at the end such that + //! the size becomes n. New elements are copy constructed from x. + //! + //! Throws: If memory allocation throws, or T's copy constructor throws. + //! + //! Complexity: Linear to the difference between size() and new_size. + void resize(size_type new_size, const T& x) + { + if(!priv_try_shrink(new_size)){ + this->insert(this->cend(), new_size - this->size(), x); + } + } + + ////////////////////////////////////////////// + // + // element access + // + ////////////////////////////////////////////// + + //! Requires: !empty() + //! + //! Effects: Returns a reference to the first element + //! from the beginning of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reference front() AUTOBOOST_CONTAINER_NOEXCEPT + { return *this->begin(); } + + //! Requires: !empty() + //! + //! Effects: Returns a const reference to the first element + //! from the beginning of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reference front() const AUTOBOOST_CONTAINER_NOEXCEPT + { return *this->begin(); } + + //! Requires: !empty() + //! + //! Effects: Returns a reference to the first element + //! from the beginning of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reference back() AUTOBOOST_CONTAINER_NOEXCEPT + { return *(--this->end()); } + + //! Requires: !empty() + //! + //! Effects: Returns a const reference to the first element + //! from the beginning of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reference back() const AUTOBOOST_CONTAINER_NOEXCEPT + { return *(--this->end()); } + + ////////////////////////////////////////////// + // + // modifiers + // + ////////////////////////////////////////////// + + #if defined(AUTOBOOST_CONTAINER_PERFECT_FORWARDING) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... in the end of the list. + //! + //! Throws: If memory allocation throws or + //! T's in-place constructor throws. + //! + //! Complexity: Constant + template + void emplace_back(Args&&... args) + { this->emplace(this->cend(), autoboost::forward(args)...); } + + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... in the beginning of the list. + //! + //! Throws: If memory allocation throws or + //! T's in-place constructor throws. + //! + //! Complexity: Constant + template + void emplace_front(Args&&... args) + { this->emplace(this->cbegin(), autoboost::forward(args)...); } + + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... before p. + //! + //! Throws: If memory allocation throws or + //! T's in-place constructor throws. + //! + //! Complexity: Constant + template + iterator emplace(const_iterator p, Args&&... args) + { + NodePtr pnode(AllocHolder::create_node(autoboost::forward(args)...)); + return iterator(this->icont().insert(p.get(), *pnode)); + } + + #else //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + void emplace_back(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + this->emplace(this->cend() \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ + } \ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + void emplace_front(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + this->emplace(this->cbegin() \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ + } \ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + iterator emplace(const_iterator p \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + NodePtr pnode (AllocHolder::create_node \ + (AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + return iterator(this->icont().insert(p.get(), *pnode)); \ + } \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + //! Effects: Inserts a copy of x at the beginning of the list. + //! + //! Throws: If memory allocation throws or + //! T's copy constructor throws. + //! + //! Complexity: Amortized constant time. + void push_front(const T &x); + + //! Effects: Constructs a new element in the beginning of the list + //! and moves the resources of mx to this new element. + //! + //! Throws: If memory allocation throws. + //! + //! Complexity: Amortized constant time. + void push_front(T &&x); + #else + AUTOBOOST_MOVE_CONVERSION_AWARE_CATCH(push_front, T, void, priv_push_front) + #endif + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + //! Effects: Inserts a copy of x at the end of the list. + //! + //! Throws: If memory allocation throws or + //! T's copy constructor throws. + //! + //! Complexity: Amortized constant time. + void push_back(const T &x); + + //! Effects: Constructs a new element in the end of the list + //! and moves the resources of mx to this new element. + //! + //! Throws: If memory allocation throws. + //! + //! Complexity: Amortized constant time. + void push_back(T &&x); + #else + AUTOBOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back) + #endif + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + //! Requires: p must be a valid iterator of *this. + //! + //! Effects: Insert a copy of x before p. + //! + //! Returns: an iterator to the inserted element. + //! + //! Throws: If memory allocation throws or x's copy constructor throws. + //! + //! Complexity: Amortized constant time. + iterator insert(const_iterator p, const T &x); + + //! Requires: p must be a valid iterator of *this. + //! + //! Effects: Insert a new element before p with mx's resources. + //! + //! Returns: an iterator to the inserted element. + //! + //! Throws: If memory allocation throws. + //! + //! Complexity: Amortized constant time. + iterator insert(const_iterator p, T &&x); + #else + AUTOBOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG(insert, T, iterator, priv_insert, const_iterator, const_iterator) + #endif + + //! Requires: p must be a valid iterator of *this. + //! + //! Effects: Inserts n copies of x before p. + //! + //! Returns: an iterator to the first inserted element or p if n is 0. + //! + //! Throws: If memory allocation throws or T's copy constructor throws. + //! + //! Complexity: Linear to n. + iterator insert(const_iterator p, size_type n, const T& x) + { + typedef constant_iterator cvalue_iterator; + return this->insert(p, cvalue_iterator(x, n), cvalue_iterator()); + } + + //! Requires: p must be a valid iterator of *this. + //! + //! Effects: Insert a copy of the [first, last) range before p. + //! + //! Returns: an iterator to the first inserted element or p if first == last. + //! + //! Throws: If memory allocation throws, T's constructor from a + //! dereferenced InpIt throws. + //! + //! Complexity: Linear to std::distance [first, last). + template + iterator insert(const_iterator p, InpIt first, InpIt last + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + && (container_detail::is_input_iterator::value + || container_detail::is_same::value + ) + >::type * = 0 + #endif + ) + { + const typename Icont::iterator ipos(p.get()); + iterator ret_it(ipos); + if(first != last){ + ret_it = iterator(this->icont().insert(ipos, *this->create_node_from_it(first))); + ++first; + } + for (; first != last; ++first){ + this->icont().insert(ipos, *this->create_node_from_it(first)); + } + return ret_it; + } + + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + template + iterator insert(const_iterator p, FwdIt first, FwdIt last + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + && !(container_detail::is_input_iterator::value + || container_detail::is_same::value + ) + >::type * = 0 + ) + { + //Optimized allocation and construction + insertion_functor func(this->icont(), p.get()); + iterator before_p(p.get()); + --before_p; + this->allocate_many_and_construct(first, std::distance(first, last), func); + return ++before_p; + } + #endif + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Requires: p must be a valid iterator of *this. + //! + //! Effects: Insert a copy of the [il.begin(), il.end()) range before p. + //! + //! Returns: an iterator to the first inserted element or p if if.begin() == il.end(). + //! + //! Throws: If memory allocation throws, T's constructor from a + //! dereferenced std::initializer_list iterator throws. + //! + //! Complexity: Linear to std::distance [il.begin(), il.end()). + iterator insert(const_iterator p, std::initializer_list il) + { return insert(p, il.begin(), il.end()); } +#endif + + //! Effects: Removes the first element from the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Amortized constant time. + void pop_front() AUTOBOOST_CONTAINER_NOEXCEPT + { this->erase(this->cbegin()); } + + //! Effects: Removes the last element from the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Amortized constant time. + void pop_back() AUTOBOOST_CONTAINER_NOEXCEPT + { const_iterator tmp = this->cend(); this->erase(--tmp); } + + //! Requires: p must be a valid iterator of *this. + //! + //! Effects: Erases the element at p p. + //! + //! Throws: Nothing. + //! + //! Complexity: Amortized constant time. + iterator erase(const_iterator p) AUTOBOOST_CONTAINER_NOEXCEPT + { return iterator(this->icont().erase_and_dispose(p.get(), Destroyer(this->node_alloc()))); } + + //! Requires: first and last must be valid iterator to elements in *this. + //! + //! Effects: Erases the elements pointed by [first, last). + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the distance between first and last. + iterator erase(const_iterator first, const_iterator last) AUTOBOOST_CONTAINER_NOEXCEPT + { return iterator(AllocHolder::erase_range(first.get(), last.get(), alloc_version())); } + + //! Effects: Swaps the contents of *this and x. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + void swap(list& x) + { AllocHolder::swap(x); } + + //! Effects: Erases all the elements of the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the number of elements in the list. + void clear() AUTOBOOST_CONTAINER_NOEXCEPT + { AllocHolder::clear(alloc_version()); } + + ////////////////////////////////////////////// + // + // slist operations + // + ////////////////////////////////////////////// + + //! Requires: p must point to an element contained + //! by the list. x != *this. this' allocator and x's allocator shall compare equal + //! + //! Effects: Transfers all the elements of list x to this list, before the + //! the element pointed by p. No destructors or copy constructors are called. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Iterators of values obtained from list x now point to elements of + //! this list. Iterators of this list and all the references are not invalidated. + void splice(const_iterator p, list& x) AUTOBOOST_CONTAINER_NOEXCEPT + { + AUTOBOOST_ASSERT(this != &x); + AUTOBOOST_ASSERT(this->node_alloc() == x.node_alloc()); + this->icont().splice(p.get(), x.icont()); + } + + //! Requires: p must point to an element contained + //! by the list. x != *this. this' allocator and x's allocator shall compare equal + //! + //! Effects: Transfers all the elements of list x to this list, before the + //! the element pointed by p. No destructors or copy constructors are called. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Iterators of values obtained from list x now point to elements of + //! this list. Iterators of this list and all the references are not invalidated. + void splice(const_iterator p, AUTOBOOST_RV_REF(list) x) AUTOBOOST_CONTAINER_NOEXCEPT + { this->splice(p, static_cast(x)); } + + //! Requires: p must point to an element contained + //! by this list. i must point to an element contained in list x. + //! this' allocator and x's allocator shall compare equal + //! + //! Effects: Transfers the value pointed by i, from list x to this list, + //! before the the element pointed by p. No destructors or copy constructors are called. + //! If p == i or p == ++i, this function is a null operation. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Iterators of values obtained from list x now point to elements of this + //! list. Iterators of this list and all the references are not invalidated. + void splice(const_iterator p, list &x, const_iterator i) AUTOBOOST_CONTAINER_NOEXCEPT + { + //AUTOBOOST_ASSERT(this != &x); + AUTOBOOST_ASSERT(this->node_alloc() == x.node_alloc()); + this->icont().splice(p.get(), x.icont(), i.get()); + } + + //! Requires: p must point to an element contained + //! by this list. i must point to an element contained in list x. + //! this' allocator and x's allocator shall compare equal. + //! + //! Effects: Transfers the value pointed by i, from list x to this list, + //! before the the element pointed by p. No destructors or copy constructors are called. + //! If p == i or p == ++i, this function is a null operation. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Iterators of values obtained from list x now point to elements of this + //! list. Iterators of this list and all the references are not invalidated. + void splice(const_iterator p, AUTOBOOST_RV_REF(list) x, const_iterator i) AUTOBOOST_CONTAINER_NOEXCEPT + { this->splice(p, static_cast(x), i); } + + //! Requires: p must point to an element contained + //! by this list. first and last must point to elements contained in list x. + //! this' allocator and x's allocator shall compare equal + //! + //! Effects: Transfers the range pointed by first and last from list x to this list, + //! before the the element pointed by p. No destructors or copy constructors are called. + //! + //! Throws: Nothing + //! + //! Complexity: Linear to the number of elements transferred. + //! + //! Note: Iterators of values obtained from list x now point to elements of this + //! list. Iterators of this list and all the references are not invalidated. + void splice(const_iterator p, list &x, const_iterator first, const_iterator last) AUTOBOOST_CONTAINER_NOEXCEPT + { + AUTOBOOST_ASSERT(this->node_alloc() == x.node_alloc()); + this->icont().splice(p.get(), x.icont(), first.get(), last.get()); + } + + //! Requires: p must point to an element contained + //! by this list. first and last must point to elements contained in list x. + //! this' allocator and x's allocator shall compare equal. + //! + //! Effects: Transfers the range pointed by first and last from list x to this list, + //! before the the element pointed by p. No destructors or copy constructors are called. + //! + //! Throws: Nothing + //! + //! Complexity: Linear to the number of elements transferred. + //! + //! Note: Iterators of values obtained from list x now point to elements of this + //! list. Iterators of this list and all the references are not invalidated. + void splice(const_iterator p, AUTOBOOST_RV_REF(list) x, const_iterator first, const_iterator last) AUTOBOOST_CONTAINER_NOEXCEPT + { this->splice(p, static_cast(x), first, last); } + + //! Requires: p must point to an element contained + //! by this list. first and last must point to elements contained in list x. + //! n == std::distance(first, last). this' allocator and x's allocator shall compare equal + //! + //! Effects: Transfers the range pointed by first and last from list x to this list, + //! before the the element pointed by p. No destructors or copy constructors are called. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Iterators of values obtained from list x now point to elements of this + //! list. Iterators of this list and all the references are not invalidated. + //! + //! Note: Non-standard extension + void splice(const_iterator p, list &x, const_iterator first, const_iterator last, size_type n) AUTOBOOST_CONTAINER_NOEXCEPT + { + AUTOBOOST_ASSERT(this->node_alloc() == x.node_alloc()); + this->icont().splice(p.get(), x.icont(), first.get(), last.get(), n); + } + + //! Requires: p must point to an element contained + //! by this list. first and last must point to elements contained in list x. + //! n == std::distance(first, last). this' allocator and x's allocator shall compare equal + //! + //! Effects: Transfers the range pointed by first and last from list x to this list, + //! before the the element pointed by p. No destructors or copy constructors are called. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Iterators of values obtained from list x now point to elements of this + //! list. Iterators of this list and all the references are not invalidated. + //! + //! Note: Non-standard extension + void splice(const_iterator p, AUTOBOOST_RV_REF(list) x, const_iterator first, const_iterator last, size_type n) AUTOBOOST_CONTAINER_NOEXCEPT + { this->splice(p, static_cast(x), first, last, n); } + + //! Effects: Removes all the elements that compare equal to value. + //! + //! Throws: If comparison throws. + //! + //! Complexity: Linear time. It performs exactly size() comparisons for equality. + //! + //! Note: The relative order of elements that are not removed is unchanged, + //! and iterators to elements that are not removed remain valid. + void remove(const T& value) + { this->remove_if(equal_to_value(value)); } + + //! Effects: Removes all the elements for which a specified + //! predicate is satisfied. + //! + //! Throws: If pred throws. + //! + //! Complexity: Linear time. It performs exactly size() calls to the predicate. + //! + //! Note: The relative order of elements that are not removed is unchanged, + //! and iterators to elements that are not removed remain valid. + template + void remove_if(Pred pred) + { + typedef ValueCompareToNodeCompare Predicate; + this->icont().remove_and_dispose_if(Predicate(pred), Destroyer(this->node_alloc())); + } + + //! Effects: Removes adjacent duplicate elements or adjacent + //! elements that are equal from the list. + //! + //! Throws: If comparison throws. + //! + //! Complexity: Linear time (size()-1 comparisons equality comparisons). + //! + //! Note: The relative order of elements that are not removed is unchanged, + //! and iterators to elements that are not removed remain valid. + void unique() + { this->unique(value_equal()); } + + //! Effects: Removes adjacent duplicate elements or adjacent + //! elements that satisfy some binary predicate from the list. + //! + //! Throws: If pred throws. + //! + //! Complexity: Linear time (size()-1 comparisons calls to pred()). + //! + //! Note: The relative order of elements that are not removed is unchanged, + //! and iterators to elements that are not removed remain valid. + template + void unique(BinaryPredicate binary_pred) + { + typedef ValueCompareToNodeCompare Predicate; + this->icont().unique_and_dispose(Predicate(binary_pred), Destroyer(this->node_alloc())); + } + + //! Requires: The lists x and *this must be distinct. + //! + //! Effects: This function removes all of x's elements and inserts them + //! in order into *this according to std::less. The merge is stable; + //! that is, if an element from *this is equivalent to one from x, then the element + //! from *this will precede the one from x. + //! + //! Throws: If comparison throws. + //! + //! Complexity: This function is linear time: it performs at most + //! size() + x.size() - 1 comparisons. + void merge(list &x) + { this->merge(x, value_less()); } + + //! Requires: The lists x and *this must be distinct. + //! + //! Effects: This function removes all of x's elements and inserts them + //! in order into *this according to std::less. The merge is stable; + //! that is, if an element from *this is equivalent to one from x, then the element + //! from *this will precede the one from x. + //! + //! Throws: If comparison throws. + //! + //! Complexity: This function is linear time: it performs at most + //! size() + x.size() - 1 comparisons. + void merge(AUTOBOOST_RV_REF(list) x) + { this->merge(static_cast(x)); } + + //! Requires: p must be a comparison function that induces a strict weak + //! ordering and both *this and x must be sorted according to that ordering + //! The lists x and *this must be distinct. + //! + //! Effects: This function removes all of x's elements and inserts them + //! in order into *this. The merge is stable; that is, if an element from *this is + //! equivalent to one from x, then the element from *this will precede the one from x. + //! + //! Throws: If comp throws. + //! + //! Complexity: This function is linear time: it performs at most + //! size() + x.size() - 1 comparisons. + //! + //! Note: Iterators and references to *this are not invalidated. + template + void merge(list &x, const StrictWeakOrdering &comp) + { + AUTOBOOST_ASSERT(this->node_alloc() == x.node_alloc()); + this->icont().merge(x.icont(), + ValueCompareToNodeCompare(comp)); + } + + //! Requires: p must be a comparison function that induces a strict weak + //! ordering and both *this and x must be sorted according to that ordering + //! The lists x and *this must be distinct. + //! + //! Effects: This function removes all of x's elements and inserts them + //! in order into *this. The merge is stable; that is, if an element from *this is + //! equivalent to one from x, then the element from *this will precede the one from x. + //! + //! Throws: If comp throws. + //! + //! Complexity: This function is linear time: it performs at most + //! size() + x.size() - 1 comparisons. + //! + //! Note: Iterators and references to *this are not invalidated. + template + void merge(AUTOBOOST_RV_REF(list) x, StrictWeakOrdering comp) + { this->merge(static_cast(x), comp); } + + //! Effects: This function sorts the list *this according to std::less. + //! The sort is stable, that is, the relative order of equivalent elements is preserved. + //! + //! Throws: If comparison throws. + //! + //! Notes: Iterators and references are not invalidated. + //! + //! Complexity: The number of comparisons is approximately N log N, where N + //! is the list's size. + void sort() + { this->sort(value_less()); } + + //! Effects: This function sorts the list *this according to std::less. + //! The sort is stable, that is, the relative order of equivalent elements is preserved. + //! + //! Throws: If comp throws. + //! + //! Notes: Iterators and references are not invalidated. + //! + //! Complexity: The number of comparisons is approximately N log N, where N + //! is the list's size. + template + void sort(StrictWeakOrdering comp) + { + // nothing if the list has length 0 or 1. + if (this->size() < 2) + return; + this->icont().sort(ValueCompareToNodeCompare(comp)); + } + + //! Effects: Reverses the order of elements in the list. + //! + //! Throws: Nothing. + //! + //! Complexity: This function is linear time. + //! + //! Note: Iterators and references are not invalidated + void reverse() AUTOBOOST_CONTAINER_NOEXCEPT + { this->icont().reverse(); } + + //! Effects: Returns true if x and y are equal + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator==(const list& x, const list& y) + { + if(x.size() != y.size()){ + return false; + } + typedef typename list::const_iterator const_iterator; + const_iterator end1 = x.end(); + + const_iterator i1 = x.begin(); + const_iterator i2 = y.begin(); + while (i1 != end1 && *i1 == *i2) { + ++i1; + ++i2; + } + return i1 == end1; + } + + //! Effects: Returns true if x and y are unequal + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator!=(const list& x, const list& y) + { return !(x == y); } + + //! Effects: Returns true if x is less than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator<(const list& x, const list& y) + { return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); } + + //! Effects: Returns true if x is greater than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator>(const list& x, const list& y) + { return y < x; } + + //! Effects: Returns true if x is equal or less than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator<=(const list& x, const list& y) + { return !(y < x); } + + //! Effects: Returns true if x is equal or greater than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator>=(const list& x, const list& y) + { return !(x < y); } + + //! Effects: x.swap(y) + //! + //! Complexity: Constant. + friend void swap(list& x, list& y) + { x.swap(y); } + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + + bool priv_try_shrink(size_type new_size) + { + const size_type len = this->size(); + if(len > new_size){ + const const_iterator iend = this->cend(); + size_type to_erase = len - new_size; + const_iterator ifirst; + if(to_erase < len/2u){ + ifirst = iend; + while(to_erase--){ + --ifirst; + } + } + else{ + ifirst = this->cbegin(); + size_type to_skip = len - to_erase; + while(to_skip--){ + ++ifirst; + } + } + this->erase(ifirst, iend); + return true; + } + else{ + return false; + } + } + + iterator priv_insert(const_iterator p, const T &x) + { + NodePtr tmp = AllocHolder::create_node(x); + return iterator(this->icont().insert(p.get(), *tmp)); + } + + iterator priv_insert(const_iterator p, AUTOBOOST_RV_REF(T) x) + { + NodePtr tmp = AllocHolder::create_node(autoboost::move(x)); + return iterator(this->icont().insert(p.get(), *tmp)); + } + + void priv_push_back (const T &x) + { this->insert(this->cend(), x); } + + void priv_push_back (AUTOBOOST_RV_REF(T) x) + { this->insert(this->cend(), autoboost::move(x)); } + + void priv_push_front (const T &x) + { this->insert(this->cbegin(), x); } + + void priv_push_front (AUTOBOOST_RV_REF(T) x) + { this->insert(this->cbegin(), autoboost::move(x)); } + + class insertion_functor; + friend class insertion_functor; + + class insertion_functor + { + Icont &icont_; + typedef typename Icont::const_iterator iconst_iterator; + const iconst_iterator pos_; + + public: + insertion_functor(Icont &icont, typename Icont::const_iterator pos) + : icont_(icont), pos_(pos) + {} + + void operator()(Node &n) + { + this->icont_.insert(pos_, n); + } + }; + + //Functors for member algorithm defaults + struct value_less + { + bool operator()(const value_type &a, const value_type &b) const + { return a < b; } + }; + + struct value_equal + { + bool operator()(const value_type &a, const value_type &b) const + { return a == b; } + }; + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +}; + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +} //namespace container { + +//!has_trivial_destructor_after_move<> == true_type +//!specialization for optimizations +template +struct has_trivial_destructor_after_move > + : public ::autoboost::has_trivial_destructor_after_move +{}; + +namespace container { + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +}} + +#include + +#endif // AUTOBOOST_CONTAINER_LIST_HPP diff --git a/contrib/autoboost/autoboost/container/map.hpp b/contrib/autoboost/autoboost/container/map.hpp new file mode 100644 index 000000000..cd60bcd35 --- /dev/null +++ b/contrib/autoboost/autoboost/container/map.hpp @@ -0,0 +1,1406 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_MAP_HPP +#define AUTOBOOST_CONTAINER_MAP_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) +#include +#endif + +namespace autoboost { +namespace container { + +#ifdef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//! A map is a kind of associative container that supports unique keys (contains at +//! most one of each key value) and provides for fast retrieval of values of another +//! type T based on the keys. The map class supports bidirectional iterators. +//! +//! A map satisfies all of the requirements of a container and of a reversible +//! container and of an associative container. The value_type stored +//! by this container is the value_type is std::pair. +//! +//! \tparam Key is the key_type of the map +//! \tparam Value is the mapped_type +//! \tparam Compare is the ordering function for Keys (e.g. std::less). +//! \tparam Allocator is the allocator to allocate the value_types +//! (e.g. allocator< std::pair > ). +//! \tparam MapOptions is an packed option type generated using using autoboost::container::tree_assoc_options. +template < class Key, class T, class Compare = std::less + , class Allocator = std::allocator< std::pair< const Key, T> >, class MapOptions = tree_assoc_defaults > +#else +template +#endif +class map + ///@cond + : public container_detail::tree + < Key, std::pair + , container_detail::select1st< std::pair > + , Compare, Allocator, MapOptions> + ///@endcond +{ + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + AUTOBOOST_COPYABLE_AND_MOVABLE(map) + + typedef std::pair value_type_impl; + typedef container_detail::tree + , Compare, Allocator, MapOptions> base_t; + typedef container_detail::pair movable_value_type_impl; + typedef container_detail::tree_value_compare + < Key, value_type_impl, Compare, container_detail::select1st + > value_compare_impl; + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + public: + ////////////////////////////////////////////// + // + // types + // + ////////////////////////////////////////////// + + typedef Key key_type; + typedef ::autoboost::container::allocator_traits allocator_traits_type; + typedef T mapped_type; + typedef std::pair value_type; + typedef typename autoboost::container::allocator_traits::pointer pointer; + typedef typename autoboost::container::allocator_traits::const_pointer const_pointer; + typedef typename autoboost::container::allocator_traits::reference reference; + typedef typename autoboost::container::allocator_traits::const_reference const_reference; + typedef typename autoboost::container::allocator_traits::size_type size_type; + typedef typename autoboost::container::allocator_traits::difference_type difference_type; + typedef Allocator allocator_type; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::stored_allocator_type) stored_allocator_type; + typedef AUTOBOOST_CONTAINER_IMPDEF(value_compare_impl) value_compare; + typedef Compare key_compare; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::iterator) iterator; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::const_iterator) const_iterator; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::reverse_iterator) reverse_iterator; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::const_reverse_iterator) const_reverse_iterator; + typedef std::pair nonconst_value_type; + typedef AUTOBOOST_CONTAINER_IMPDEF(movable_value_type_impl) movable_value_type; + + ////////////////////////////////////////////// + // + // construct/copy/destroy + // + ////////////////////////////////////////////// + + //! Effects: Default constructs an empty map. + //! + //! Complexity: Constant. + map() + : base_t() + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Constructs an empty map using the specified comparison object + //! and allocator. + //! + //! Complexity: Constant. + explicit map(const Compare& comp, + const allocator_type& a = allocator_type()) + : base_t(comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Constructs an empty map using the specified allocator. + //! + //! Complexity: Constant. + explicit map(const allocator_type& a) + : base_t(a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Constructs an empty map using the specified comparison object and + //! allocator, and inserts elements from the range [first ,last ). + //! + //! Complexity: Linear in N if the range [first ,last ) is already sorted using + //! comp and otherwise N logN, where N is last - first. + template + map(InputIterator first, InputIterator last, const Compare& comp = Compare(), + const allocator_type& a = allocator_type()) + : base_t(true, first, last, comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Constructs an empty map using the specified comparison object and + //! allocator, and inserts elements from the ordered unique range [first ,last). This function + //! is more efficient than the normal range creation for ordered ranges. + //! + //! Requires: [first ,last) must be ordered according to the predicate and must be + //! unique values. + //! + //! Complexity: Linear in N. + //! + //! Note: Non-standard extension. + template + map( ordered_unique_range_t, InputIterator first, InputIterator last + , const Compare& comp = Compare(), const allocator_type& a = allocator_type()) + : base_t(ordered_range, first, last, comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Constructs an empty map using the specified comparison object and + //! allocator, and inserts elements from the range [il.begin(), il.end()). + //! + //! Complexity: Linear in N if the range [first ,last ) is already sorted using + //! comp and otherwise N logN, where N is il.first() - il.end(). + map(std::initializer_list il, const Compare& comp = Compare(), const allocator_type& a = allocator_type()) + : base_t(true, il.begin(), il.end(), comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + map(ordered_unique_range_t, std::initializer_list il, const Compare& comp = Compare(), + const allocator_type& a = allocator_type()) + : base_t(ordered_range, il.begin(), il.end(), comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } +#endif + + //! Effects: Copy constructs a map. + //! + //! Complexity: Linear in x.size(). + map(const map& x) + : base_t(static_cast(x)) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Move constructs a map. Constructs *this using x's resources. + //! + //! Complexity: Constant. + //! + //! Postcondition: x is emptied. + map(AUTOBOOST_RV_REF(map) x) + : base_t(autoboost::move(static_cast(x))) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Copy constructs a map using the specified allocator. + //! + //! Complexity: Linear in x.size(). + map(const map& x, const allocator_type &a) + : base_t(static_cast(x), a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Move constructs a map using the specified allocator. + //! Constructs *this using x's resources. + //! + //! Complexity: Constant if x == x.get_allocator(), linear otherwise. + //! + //! Postcondition: x is emptied. + map(AUTOBOOST_RV_REF(map) x, const allocator_type &a) + : base_t(autoboost::move(static_cast(x)), a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Makes *this a copy of x. + //! + //! Complexity: Linear in x.size(). + map& operator=(AUTOBOOST_COPY_ASSIGN_REF(map) x) + { return static_cast(this->base_t::operator=(static_cast(x))); } + + //! Effects: this->swap(x.get()). + //! + //! Throws: If allocator_traits_type::propagate_on_container_move_assignment + //! is false and (allocation throws or value_type's move constructor throws) + //! + //! Complexity: Constant if allocator_traits_type:: + //! propagate_on_container_move_assignment is true or + //! this->get>allocator() == x.get_allocator(). Linear otherwise. + map& operator=(AUTOBOOST_RV_REF(map) x) + AUTOBOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value) + { return static_cast(this->base_t::operator=(autoboost::move(static_cast(x)))); } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Assign content of il to *this. + //! + map& operator=(std::initializer_list il) + { + this->clear(); + insert(il.begin(), il.end()); + return *this; + } +#endif + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: Returns a copy of the Allocator that + //! was passed to the object's constructor. + //! + //! Complexity: Constant. + allocator_type get_allocator() const; + + //! Effects: Returns a reference to the internal allocator. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Non-standard extension. + stored_allocator_type &get_stored_allocator() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a reference to the internal allocator. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Non-standard extension. + const stored_allocator_type &get_stored_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns an iterator to the first element contained in the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + iterator begin() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a const_iterator to the first element contained in the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator begin() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a const_iterator to the first element contained in the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cbegin() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns an iterator to the end of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + iterator end() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a const_iterator to the end of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator end() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a const_iterator to the end of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cend() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a reverse_iterator pointing to the beginning + //! of the reversed container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reverse_iterator rbegin() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator rbegin() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crbegin() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a reverse_iterator pointing to the end + //! of the reversed container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reverse_iterator rend() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator rend() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crend() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns true if the container contains no elements. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + bool empty() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns the number of the elements contained in the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type size() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns the largest possible size of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type max_size() const AUTOBOOST_CONTAINER_NOEXCEPT; + + #endif //#if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + //! Effects: If there is no key equivalent to x in the map, inserts + //! value_type(x, T()) into the map. + //! + //! Returns: Allocator reference to the mapped_type corresponding to x in *this. + //! + //! Complexity: Logarithmic. + mapped_type& operator[](const key_type &k); + + //! Effects: If there is no key equivalent to x in the map, inserts + //! value_type(autoboost::move(x), T()) into the map (the key is move-constructed) + //! + //! Returns: Allocator reference to the mapped_type corresponding to x in *this. + //! + //! Complexity: Logarithmic. + mapped_type& operator[](key_type &&k); + #else + AUTOBOOST_MOVE_CONVERSION_AWARE_CATCH( operator[] , key_type, mapped_type&, this->priv_subscript) + #endif + + //! Returns: Allocator reference to the element whose key is equivalent to x. + //! Throws: An exception object of type out_of_range if no such element is present. + //! Complexity: logarithmic. + T& at(const key_type& k) + { + iterator i = this->find(k); + if(i == this->end()){ + throw_out_of_range("map::at key not found"); + } + return i->second; + } + + //! Returns: Allocator reference to the element whose key is equivalent to x. + //! Throws: An exception object of type out_of_range if no such element is present. + //! Complexity: logarithmic. + const T& at(const key_type& k) const + { + const_iterator i = this->find(k); + if(i == this->end()){ + throw_out_of_range("map::at key not found"); + } + return i->second; + } + + ////////////////////////////////////////////// + // + // modifiers + // + ////////////////////////////////////////////// + + //! Effects: Inserts x if and only if there is no element in the container + //! with key equivalent to the key of x. + //! + //! Returns: The bool component of the returned pair is true if and only + //! if the insertion takes place, and the iterator component of the pair + //! points to the element with key equivalent to the key of x. + //! + //! Complexity: Logarithmic. + std::pair insert(const value_type& x) + { return this->base_t::insert_unique(x); } + + //! Effects: Inserts a new value_type created from the pair if and only if + //! there is no element in the container with key equivalent to the key of x. + //! + //! Returns: The bool component of the returned pair is true if and only + //! if the insertion takes place, and the iterator component of the pair + //! points to the element with key equivalent to the key of x. + //! + //! Complexity: Logarithmic. + std::pair insert(const nonconst_value_type& x) + { return this->base_t::insert_unique(x); } + + //! Effects: Inserts a new value_type move constructed from the pair if and + //! only if there is no element in the container with key equivalent to the key of x. + //! + //! Returns: The bool component of the returned pair is true if and only + //! if the insertion takes place, and the iterator component of the pair + //! points to the element with key equivalent to the key of x. + //! + //! Complexity: Logarithmic. + std::pair insert(AUTOBOOST_RV_REF(nonconst_value_type) x) + { return this->base_t::insert_unique(autoboost::move(x)); } + + //! Effects: Inserts a new value_type move constructed from the pair if and + //! only if there is no element in the container with key equivalent to the key of x. + //! + //! Returns: The bool component of the returned pair is true if and only + //! if the insertion takes place, and the iterator component of the pair + //! points to the element with key equivalent to the key of x. + //! + //! Complexity: Logarithmic. + std::pair insert(AUTOBOOST_RV_REF(movable_value_type) x) + { return this->base_t::insert_unique(autoboost::move(x)); } + + //! Effects: Move constructs a new value from x if and only if there is + //! no element in the container with key equivalent to the key of x. + //! + //! Returns: The bool component of the returned pair is true if and only + //! if the insertion takes place, and the iterator component of the pair + //! points to the element with key equivalent to the key of x. + //! + //! Complexity: Logarithmic. + std::pair insert(AUTOBOOST_RV_REF(value_type) x) + { return this->base_t::insert_unique(autoboost::move(x)); } + + //! Effects: Inserts a copy of x in the container if and only if there is + //! no element in the container with key equivalent to the key of x. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + iterator insert(const_iterator p, const value_type& x) + { return this->base_t::insert_unique(p, x); } + + //! Effects: Move constructs a new value from x if and only if there is + //! no element in the container with key equivalent to the key of x. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + iterator insert(const_iterator p, AUTOBOOST_RV_REF(nonconst_value_type) x) + { return this->base_t::insert_unique(p, autoboost::move(x)); } + + //! Effects: Move constructs a new value from x if and only if there is + //! no element in the container with key equivalent to the key of x. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + iterator insert(const_iterator p, AUTOBOOST_RV_REF(movable_value_type) x) + { return this->base_t::insert_unique(p, autoboost::move(x)); } + + //! Effects: Inserts a copy of x in the container. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent to the key of x. + //! + //! Complexity: Logarithmic. + iterator insert(const_iterator p, const nonconst_value_type& x) + { return this->base_t::insert_unique(p, x); } + + //! Effects: Inserts an element move constructed from x in the container. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent to the key of x. + //! + //! Complexity: Logarithmic. + iterator insert(const_iterator p, AUTOBOOST_RV_REF(value_type) x) + { return this->base_t::insert_unique(p, autoboost::move(x)); } + + //! Requires: first, last are not iterators into *this. + //! + //! Effects: inserts each element from the range [first,last) if and only + //! if there is no element with key equivalent to the key of that element. + //! + //! Complexity: At most N log(size()+N) (N is the distance from first to last) + template + void insert(InputIterator first, InputIterator last) + { this->base_t::insert_unique(first, last); } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: inserts each element from the range [il.begin(), il.end()) if and only + //! if there is no element with key equivalent to the key of that element. + //! + //! Complexity: At most N log(size()+N) (N is the distance from il.begin() to il.end()) + void insert(std::initializer_list il) + { this->base_t::insert_unique(il.begin(), il.end()); } +#endif + + #if defined(AUTOBOOST_CONTAINER_PERFECT_FORWARDING) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: Inserts an object x of type T constructed with + //! std::forward(args)... in the container if and only if there is + //! no element in the container with an equivalent key. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: The bool component of the returned pair is true if and only + //! if the insertion takes place, and the iterator component of the pair + //! points to the element with key equivalent to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + template + std::pair emplace(Args&&... args) + { return this->base_t::emplace_unique(autoboost::forward(args)...); } + + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... in the container if and only if there is + //! no element in the container with an equivalent key. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + template + iterator emplace_hint(const_iterator p, Args&&... args) + { return this->base_t::emplace_hint_unique(p, autoboost::forward(args)...); } + + #else //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + std::pair emplace(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return this->base_t::emplace_unique(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); }\ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + iterator emplace_hint(const_iterator p \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return this->base_t::emplace_hint_unique(p \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: Erases the element pointed to by p. + //! + //! Returns: Returns an iterator pointing to the element immediately + //! following q prior to the element being erased. If no such element exists, + //! returns end(). + //! + //! Complexity: Amortized constant time + iterator erase(const_iterator p) AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Erases all elements in the container with key equivalent to x. + //! + //! Returns: Returns the number of erased elements. + //! + //! Complexity: log(size()) + count(k) + size_type erase(const key_type& x) AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Erases all the elements in the range [first, last). + //! + //! Returns: Returns last. + //! + //! Complexity: log(size())+N where N is the distance from first to last. + iterator erase(const_iterator first, const_iterator last) AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Swaps the contents of *this and x. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + void swap(map& x); + + //! Effects: erase(a.begin(),a.end()). + //! + //! Postcondition: size() == 0. + //! + //! Complexity: linear in size(). + void clear() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Effects: Returns the comparison object out + //! of which a was constructed. + //! + //! Complexity: Constant. + key_compare key_comp() const; + + //! Effects: Returns an object of value_compare constructed out + //! of the comparison object. + //! + //! Complexity: Constant. + value_compare value_comp() const; + + //! Returns: An iterator pointing to an element with the key + //! equivalent to x, or end() if such an element is not found. + //! + //! Complexity: Logarithmic. + iterator find(const key_type& x); + + //! Returns: Allocator const_iterator pointing to an element with the key + //! equivalent to x, or end() if such an element is not found. + //! + //! Complexity: Logarithmic. + const_iterator find(const key_type& x) const; + + #endif //#if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Returns: The number of elements with key equivalent to x. + //! + //! Complexity: log(size())+count(k) + size_type count(const key_type& x) const + { return static_cast(this->find(x) != this->cend()); } + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Returns: An iterator pointing to the first element with key not less + //! than k, or a.end() if such an element is not found. + //! + //! Complexity: Logarithmic + iterator lower_bound(const key_type& x); + + //! Returns: Allocator const iterator pointing to the first element with key not + //! less than k, or a.end() if such an element is not found. + //! + //! Complexity: Logarithmic + const_iterator lower_bound(const key_type& x) const; + + //! Returns: An iterator pointing to the first element with key not less + //! than x, or end() if such an element is not found. + //! + //! Complexity: Logarithmic + iterator upper_bound(const key_type& x); + + //! Returns: Allocator const iterator pointing to the first element with key not + //! less than x, or end() if such an element is not found. + //! + //! Complexity: Logarithmic + const_iterator upper_bound(const key_type& x) const; + + //! Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)). + //! + //! Complexity: Logarithmic + std::pair equal_range(const key_type& x); + + //! Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)). + //! + //! Complexity: Logarithmic + std::pair equal_range(const key_type& x) const; + + //! Effects: Rebalances the tree. It's a no-op for Red-Black and AVL trees. + //! + //! Complexity: Linear + void rebalance(); + + //! Effects: Returns true if x and y are equal + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator==(const map& x, const map& y); + + //! Effects: Returns true if x and y are unequal + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator!=(const map& x, const map& y); + + //! Effects: Returns true if x is less than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator<(const map& x, const map& y); + + //! Effects: Returns true if x is greater than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator>(const map& x, const map& y); + + //! Effects: Returns true if x is equal or less than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator<=(const map& x, const map& y); + + //! Effects: Returns true if x is equal or greater than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator>=(const map& x, const map& y); + + //! Effects: x.swap(y) + //! + //! Complexity: Constant. + friend void swap(map& x, map& y); + + #endif //#if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + mapped_type& priv_subscript(const key_type &k) + { + //we can optimize this + iterator i = this->lower_bound(k); + // i->first is greater than or equivalent to k. + if (i == this->end() || this->key_comp()(k, (*i).first)){ + container_detail::value_init m; + movable_value_type val(k, autoboost::move(m.m_t)); + i = insert(i, autoboost::move(val)); + } + return (*i).second; + } + + mapped_type& priv_subscript(AUTOBOOST_RV_REF(key_type) mk) + { + key_type &k = mk; + //we can optimize this + iterator i = this->lower_bound(k); + // i->first is greater than or equivalent to k. + if (i == this->end() || this->key_comp()(k, (*i).first)){ + container_detail::value_init m; + movable_value_type val(autoboost::move(k), autoboost::move(m.m_t)); + i = insert(i, autoboost::move(val)); + } + return (*i).second; + } + + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +}; + + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +} //namespace container { + +//!has_trivial_destructor_after_move<> == true_type +//!specialization for optimizations +template +struct has_trivial_destructor_after_move > +{ + static const bool value = has_trivial_destructor_after_move::value && has_trivial_destructor_after_move::value; +}; + +namespace container { + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +#ifdef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//! A multimap is a kind of associative container that supports equivalent keys +//! (possibly containing multiple copies of the same key value) and provides for +//! fast retrieval of values of another type T based on the keys. The multimap class +//! supports bidirectional iterators. +//! +//! A multimap satisfies all of the requirements of a container and of a reversible +//! container and of an associative container. The value_type stored +//! by this container is the value_type is std::pair. +//! +//! \tparam Key is the key_type of the map +//! \tparam Value is the mapped_type +//! \tparam Compare is the ordering function for Keys (e.g. std::less). +//! \tparam Allocator is the allocator to allocate the value_types +//! (e.g. allocator< std::pair > ). +//! \tparam MultiMapOptions is an packed option type generated using using autoboost::container::tree_assoc_options. +template < class Key, class T, class Compare = std::less + , class Allocator = std::allocator< std::pair< const Key, T> >, class MultiMapOptions = tree_assoc_defaults> +#else +template +#endif +class multimap + ///@cond + : public container_detail::tree + < Key, std::pair + , container_detail::select1st< std::pair > + , Compare, Allocator, MultiMapOptions> + ///@endcond +{ + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + AUTOBOOST_COPYABLE_AND_MOVABLE(multimap) + + typedef std::pair value_type_impl; + typedef container_detail::tree + , Compare, Allocator, MultiMapOptions> base_t; + typedef container_detail::pair movable_value_type_impl; + typedef container_detail::tree_value_compare + < Key, value_type_impl, Compare, container_detail::select1st + > value_compare_impl; + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + public: + ////////////////////////////////////////////// + // + // types + // + ////////////////////////////////////////////// + + typedef Key key_type; + typedef T mapped_type; + typedef std::pair value_type; + typedef typename autoboost::container::allocator_traits::pointer pointer; + typedef typename autoboost::container::allocator_traits::const_pointer const_pointer; + typedef typename autoboost::container::allocator_traits::reference reference; + typedef typename autoboost::container::allocator_traits::const_reference const_reference; + typedef typename autoboost::container::allocator_traits::size_type size_type; + typedef typename autoboost::container::allocator_traits::difference_type difference_type; + typedef Allocator allocator_type; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::stored_allocator_type) stored_allocator_type; + typedef AUTOBOOST_CONTAINER_IMPDEF(value_compare_impl) value_compare; + typedef Compare key_compare; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::iterator) iterator; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::const_iterator) const_iterator; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::reverse_iterator) reverse_iterator; + typedef typename AUTOBOOST_CONTAINER_IMPDEF(base_t::const_reverse_iterator) const_reverse_iterator; + typedef std::pair nonconst_value_type; + typedef AUTOBOOST_CONTAINER_IMPDEF(movable_value_type_impl) movable_value_type; + + ////////////////////////////////////////////// + // + // construct/copy/destroy + // + ////////////////////////////////////////////// + + //! Effects: Default constructs an empty multimap. + //! + //! Complexity: Constant. + multimap() + : base_t() + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Constructs an empty multimap using the specified allocator. + //! + //! Complexity: Constant. + explicit multimap(const Compare& comp, const allocator_type& a = allocator_type()) + : base_t(comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Constructs an empty multimap using the specified comparison + //! object and allocator. + //! + //! Complexity: Constant. + explicit multimap(const allocator_type& a) + : base_t(a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Constructs an empty multimap using the specified comparison object + //! and allocator, and inserts elements from the range [first ,last ). + //! + //! Complexity: Linear in N if the range [first ,last ) is already sorted using + //! comp and otherwise N logN, where N is last - first. + template + multimap(InputIterator first, InputIterator last, + const Compare& comp = Compare(), + const allocator_type& a = allocator_type()) + : base_t(false, first, last, comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Constructs an empty multimap using the specified comparison object and + //! allocator, and inserts elements from the ordered range [first ,last). This function + //! is more efficient than the normal range creation for ordered ranges. + //! + //! Requires: [first ,last) must be ordered according to the predicate. + //! + //! Complexity: Linear in N. + //! + //! Note: Non-standard extension. + template + multimap(ordered_range_t, InputIterator first, InputIterator last, const Compare& comp = Compare(), + const allocator_type& a = allocator_type()) + : base_t(ordered_range, first, last, comp, a) + {} + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Constructs an empty multimap using the specified comparison object and + //! allocator, and inserts elements from the range [il.begin(), il.end()). + //! + //! Complexity: Linear in N if the range [first ,last ) is already sorted using + //! comp and otherwise N logN, where N is il.first() - il.end(). + multimap(std::initializer_list il, const Compare& comp = Compare(), + const allocator_type& a = allocator_type()) + : base_t(false, il.begin(), il.end(), comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + multimap(ordered_range_t, std::initializer_list il, const Compare& comp = Compare(), + const allocator_type& a = allocator_type()) + : base_t(ordered_range, il.begin(), il.end(), comp, a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } +#endif + + //! Effects: Copy constructs a multimap. + //! + //! Complexity: Linear in x.size(). + multimap(const multimap& x) + : base_t(static_cast(x)) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Move constructs a multimap. Constructs *this using x's resources. + //! + //! Complexity: Constant. + //! + //! Postcondition: x is emptied. + multimap(AUTOBOOST_RV_REF(multimap) x) + : base_t(autoboost::move(static_cast(x))) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Copy constructs a multimap. + //! + //! Complexity: Linear in x.size(). + multimap(const multimap& x, const allocator_type &a) + : base_t(static_cast(x), a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Move constructs a multimap using the specified allocator. + //! Constructs *this using x's resources. + //! Complexity: Constant if a == x.get_allocator(), linear otherwise. + //! + //! Postcondition: x is emptied. + multimap(AUTOBOOST_RV_REF(multimap) x, const allocator_type &a) + : base_t(autoboost::move(static_cast(x)), a) + { + //Allocator type must be std::pair + AUTOBOOST_STATIC_ASSERT((container_detail::is_same, typename Allocator::value_type>::value)); + } + + //! Effects: Makes *this a copy of x. + //! + //! Complexity: Linear in x.size(). + multimap& operator=(AUTOBOOST_COPY_ASSIGN_REF(multimap) x) + { return static_cast(this->base_t::operator=(static_cast(x))); } + + //! Effects: this->swap(x.get()). + //! + //! Complexity: Constant. + multimap& operator=(AUTOBOOST_RV_REF(multimap) x) + { return static_cast(this->base_t::operator=(autoboost::move(static_cast(x)))); } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Assign content of il to *this. + //! + multimap& operator=(std::initializer_list il) + { + this->clear(); + insert(il.begin(), il.end()); + return *this; + } +#endif + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! @copydoc ::autoboost::container::set::get_allocator() + allocator_type get_allocator() const; + + //! @copydoc ::autoboost::container::set::get_stored_allocator() + stored_allocator_type &get_stored_allocator(); + + //! @copydoc ::autoboost::container::set::get_stored_allocator() const + const stored_allocator_type &get_stored_allocator() const; + + //! @copydoc ::autoboost::container::set::begin() + iterator begin(); + + //! @copydoc ::autoboost::container::set::begin() const + const_iterator begin() const; + + //! @copydoc ::autoboost::container::set::cbegin() const + const_iterator cbegin() const; + + //! @copydoc ::autoboost::container::set::end() + iterator end() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::end() const + const_iterator end() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::cend() const + const_iterator cend() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::rbegin() + reverse_iterator rbegin() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::rbegin() const + const_reverse_iterator rbegin() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::crbegin() const + const_reverse_iterator crbegin() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::rend() + reverse_iterator rend() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::rend() const + const_reverse_iterator rend() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::crend() const + const_reverse_iterator crend() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::empty() const + bool empty() const; + + //! @copydoc ::autoboost::container::set::size() const + size_type size() const; + + //! @copydoc ::autoboost::container::set::max_size() const + size_type max_size() const; + + #endif //#if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + #if defined(AUTOBOOST_CONTAINER_PERFECT_FORWARDING) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... in the container. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + template + iterator emplace(Args&&... args) + { return this->base_t::emplace_equal(autoboost::forward(args)...); } + + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... in the container. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + template + iterator emplace_hint(const_iterator p, Args&&... args) + { return this->base_t::emplace_hint_equal(p, autoboost::forward(args)...); } + + #else //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + iterator emplace(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return this->base_t::emplace_equal(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + iterator emplace_hint(const_iterator p \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return this->base_t::emplace_hint_equal(p \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + //! Effects: Inserts x and returns the iterator pointing to the + //! newly inserted element. + //! + //! Complexity: Logarithmic. + iterator insert(const value_type& x) + { return this->base_t::insert_equal(x); } + + //! Effects: Inserts a new value constructed from x and returns + //! the iterator pointing to the newly inserted element. + //! + //! Complexity: Logarithmic. + iterator insert(const nonconst_value_type& x) + { return this->base_t::insert_equal(x); } + + //! Effects: Inserts a new value move-constructed from x and returns + //! the iterator pointing to the newly inserted element. + //! + //! Complexity: Logarithmic. + iterator insert(AUTOBOOST_RV_REF(nonconst_value_type) x) + { return this->base_t::insert_equal(autoboost::move(x)); } + + //! Effects: Inserts a new value move-constructed from x and returns + //! the iterator pointing to the newly inserted element. + //! + //! Complexity: Logarithmic. + iterator insert(AUTOBOOST_RV_REF(movable_value_type) x) + { return this->base_t::insert_equal(autoboost::move(x)); } + + //! Effects: Inserts a copy of x in the container. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + iterator insert(const_iterator p, const value_type& x) + { return this->base_t::insert_equal(p, x); } + + //! Effects: Inserts a new value constructed from x in the container. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + iterator insert(const_iterator p, const nonconst_value_type& x) + { return this->base_t::insert_equal(p, x); } + + //! Effects: Inserts a new value move constructed from x in the container. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + iterator insert(const_iterator p, AUTOBOOST_RV_REF(nonconst_value_type) x) + { return this->base_t::insert_equal(p, autoboost::move(x)); } + + //! Effects: Inserts a new value move constructed from x in the container. + //! p is a hint pointing to where the insert should start to search. + //! + //! Returns: An iterator pointing to the element with key equivalent + //! to the key of x. + //! + //! Complexity: Logarithmic in general, but amortized constant if t + //! is inserted right before p. + iterator insert(const_iterator p, AUTOBOOST_RV_REF(movable_value_type) x) + { return this->base_t::insert_equal(p, autoboost::move(x)); } + + //! Requires: first, last are not iterators into *this. + //! + //! Effects: inserts each element from the range [first,last) . + //! + //! Complexity: At most N log(size()+N) (N is the distance from first to last) + template + void insert(InputIterator first, InputIterator last) + { this->base_t::insert_equal(first, last); } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: inserts each element from the range [il.begin(), il.end(). + //! + //! Complexity: At most N log(size()+N) (N is the distance from il.begin() to il.end()) + void insert(std::initializer_list il) + { this->base_t::insert_equal(il.begin(), il.end()); } +#endif + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! @copydoc ::autoboost::container::set::erase(const_iterator) + iterator erase(const_iterator p); + + //! @copydoc ::autoboost::container::set::erase(const key_type&) + size_type erase(const key_type& x); + + //! @copydoc ::autoboost::container::set::erase(const_iterator,const_iterator) + iterator erase(const_iterator first, const_iterator last); + + //! @copydoc ::autoboost::container::set::swap + void swap(flat_multiset& x); + + //! @copydoc ::autoboost::container::set::clear + void clear() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! @copydoc ::autoboost::container::set::key_comp + key_compare key_comp() const; + + //! @copydoc ::autoboost::container::set::value_comp + value_compare value_comp() const; + + //! Returns: An iterator pointing to an element with the key + //! equivalent to x, or end() if such an element is not found. + //! + //! Complexity: Logarithmic. + iterator find(const key_type& x); + + //! Returns: Allocator const iterator pointing to an element with the key + //! equivalent to x, or end() if such an element is not found. + //! + //! Complexity: Logarithmic. + const_iterator find(const key_type& x) const; + + //! Returns: The number of elements with key equivalent to x. + //! + //! Complexity: log(size())+count(k) + size_type count(const key_type& x) const; + + //! Returns: An iterator pointing to the first element with key not less + //! than k, or a.end() if such an element is not found. + //! + //! Complexity: Logarithmic + iterator lower_bound(const key_type& x); + + //! Returns: Allocator const iterator pointing to the first element with key not + //! less than k, or a.end() if such an element is not found. + //! + //! Complexity: Logarithmic + const_iterator lower_bound(const key_type& x) const; + + //! Returns: An iterator pointing to the first element with key not less + //! than x, or end() if such an element is not found. + //! + //! Complexity: Logarithmic + iterator upper_bound(const key_type& x); + + //! Returns: Allocator const iterator pointing to the first element with key not + //! less than x, or end() if such an element is not found. + //! + //! Complexity: Logarithmic + const_iterator upper_bound(const key_type& x) const; + + //! Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)). + //! + //! Complexity: Logarithmic + std::pair equal_range(const key_type& x); + + //! Effects: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)). + //! + //! Complexity: Logarithmic + std::pair equal_range(const key_type& x) const; + + //! Effects: Rebalances the tree. It's a no-op for Red-Black and AVL trees. + //! + //! Complexity: Linear + void rebalance(); + + //! Effects: Returns true if x and y are equal + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator==(const multimap& x, const multimap& y); + + //! Effects: Returns true if x and y are unequal + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator!=(const multimap& x, const multimap& y); + + //! Effects: Returns true if x is less than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator<(const multimap& x, const multimap& y); + + //! Effects: Returns true if x is greater than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator>(const multimap& x, const multimap& y); + + //! Effects: Returns true if x is equal or less than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator<=(const multimap& x, const multimap& y); + + //! Effects: Returns true if x is equal or greater than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator>=(const multimap& x, const multimap& y); + + //! Effects: x.swap(y) + //! + //! Complexity: Constant. + friend void swap(multimap& x, multimap& y); + + #endif //#if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) +}; + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +} //namespace container { + +//!has_trivial_destructor_after_move<> == true_type +//!specialization for optimizations +template +struct has_trivial_destructor_after_move > +{ + static const bool value = has_trivial_destructor_after_move::value && has_trivial_destructor_after_move::value; +}; + +namespace container { + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +}} + +#include + +#endif /* AUTOBOOST_CONTAINER_MAP_HPP */ + diff --git a/contrib/autoboost/autoboost/container/options.hpp b/contrib/autoboost/autoboost/container/options.hpp new file mode 100644 index 000000000..3e23724a3 --- /dev/null +++ b/contrib/autoboost/autoboost/container/options.hpp @@ -0,0 +1,76 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2013-2013 +// +// 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/libs/container for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_OPTIONS_HPP +#define AUTOBOOST_CONTAINER_OPTIONS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include + +namespace autoboost { +namespace container { + +#if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + +template +struct tree_opt +{ + static const autoboost::container::tree_type_enum tree_type = TreeType; + static const bool optimize_size = OptimizeSize; +}; + +#endif //!defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + +//!This option setter specifies the underlying tree type +//!(red-black, AVL, Scapegoat or Splay) for ordered associative containers +AUTOBOOST_INTRUSIVE_OPTION_CONSTANT(tree_type, tree_type_enum, TreeType, tree_type) + +//!This option setter specifies if node size is optimized +//!storing rebalancing data masked into pointers for ordered associative containers +AUTOBOOST_INTRUSIVE_OPTION_CONSTANT(optimize_size, bool, Enabled, optimize_size) + +//! Helper metafunction to combine options into a single type to be used +//! by \c autoboost::container::set, \c autoboost::container::multiset +//! \c autoboost::container::map and \c autoboost::container::multimap. +//! Supported options are: \c autoboost::container::optimize_size and \c autoboost::container::tree_type +#if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) || defined(AUTOBOOST_CONTAINER_VARIADIC_TEMPLATES) +template +#else +template +#endif +struct tree_assoc_options +{ + /// @cond + typedef typename ::autoboost::intrusive::pack_options + < tree_assoc_defaults, + #if !defined(AUTOBOOST_CONTAINER_VARIADIC_TEMPLATES) + O1, O2, O3, O4 + #else + Options... + #endif + >::type packed_options; + typedef tree_opt implementation_defined; + /// @endcond + typedef implementation_defined type; +}; + +} //namespace container { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_OPTIONS_HPP diff --git a/contrib/autoboost/autoboost/container/scoped_allocator.hpp b/contrib/autoboost/autoboost/container/scoped_allocator.hpp new file mode 100644 index 000000000..5399cbc35 --- /dev/null +++ b/contrib/autoboost/autoboost/container/scoped_allocator.hpp @@ -0,0 +1,1534 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Pablo Halpern 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) +// +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2011-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP +#define AUTOBOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP + +#if defined (_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace container { + +//! Remark: if a specialization is derived from true_type, indicates that T may be constructed +//! with an allocator as its last constructor argument. Ideally, all constructors of T (including the +//! copy and move constructors) should have a variant that accepts a final argument of +//! allocator_type. +//! +//! Requires: if a specialization is derived from true_type, T must have a nested type, +//! allocator_type and at least one constructor for which allocator_type is the last +//! parameter. If not all constructors of T can be called with a final allocator_type argument, +//! and if T is used in a context where a container must call such a constructor, then the program is +//! ill-formed. +//! +//! +//! template > +//! class Z { +//! public: +//! typedef Allocator allocator_type; +//! +//! // Default constructor with optional allocator suffix +//! Z(const allocator_type& a = allocator_type()); +//! +//! // Copy constructor and allocator-extended copy constructor +//! Z(const Z& zz); +//! Z(const Z& zz, const allocator_type& a); +//! }; +//! +//! // Specialize trait for class template Z +//! template > +//! struct constructible_with_allocator_suffix > +//! : ::autoboost::true_type { }; +//! +//! +//! Note: This trait is a workaround inspired by "N2554: The Scoped Allocator Model (Rev 2)" +//! (Pablo Halpern, 2008-02-29) to backport the scoped allocator model to C++03, as +//! in C++03 there is no mechanism to detect if a type can be constructed from arbitrary arguments. +//! Applications aiming portability with several compilers should always define this trait. +//! +//! In conforming C++11 compilers or compilers supporting SFINAE expressions +//! (when AUTOBOOST_NO_SFINAE_EXPR is NOT defined), this trait is ignored and C++11 rules will be used +//! to detect if a type should be constructed with suffix or prefix allocator arguments. +template +struct constructible_with_allocator_suffix + : ::autoboost::false_type +{}; + +//! Remark: if a specialization is derived from true_type, indicates that T may be constructed +//! with allocator_arg and T::allocator_type as its first two constructor arguments. +//! Ideally, all constructors of T (including the copy and move constructors) should have a variant +//! that accepts these two initial arguments. +//! +//! Requires: if a specialization is derived from true_type, T must have a nested type, +//! allocator_type and at least one constructor for which allocator_arg_t is the first +//! parameter and allocator_type is the second parameter. If not all constructors of T can be +//! called with these initial arguments, and if T is used in a context where a container must call such +//! a constructor, then the program is ill-formed. +//! +//! +//! template > +//! class Y { +//! public: +//! typedef Allocator allocator_type; +//! +//! // Default constructor with and allocator-extended default constructor +//! Y(); +//! Y(allocator_arg_t, const allocator_type& a); +//! +//! // Copy constructor and allocator-extended copy constructor +//! Y(const Y& yy); +//! Y(allocator_arg_t, const allocator_type& a, const Y& yy); +//! +//! // Variadic constructor and allocator-extended variadic constructor +//! template Y(Args&& args...); +//! template +//! Y(allocator_arg_t, const allocator_type& a, Args&&... args); +//! }; +//! +//! // Specialize trait for class template Y +//! template > +//! struct constructible_with_allocator_prefix > +//! : ::autoboost::true_type { }; +//! +//! +//! +//! Note: This trait is a workaround inspired by "N2554: The Scoped Allocator Model (Rev 2)" +//! (Pablo Halpern, 2008-02-29) to backport the scoped allocator model to C++03, as +//! in C++03 there is no mechanism to detect if a type can be constructed from arbitrary arguments. +//! Applications aiming portability with several compilers should always define this trait. +//! +//! In conforming C++11 compilers or compilers supporting SFINAE expressions +//! (when AUTOBOOST_NO_SFINAE_EXPR is NOT defined), this trait is ignored and C++11 rules will be used +//! to detect if a type should be constructed with suffix or prefix allocator arguments. +template +struct constructible_with_allocator_prefix + : ::autoboost::false_type +{}; + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +namespace container_detail { + +template +struct uses_allocator_imp +{ + // Use SFINAE (Substitution Failure Is Not An Error) to detect the + // presence of an 'allocator_type' nested type convertilble from Alloc. + + private: + // Match this function if TypeT::allocator_type exists and is + // implicitly convertible from Alloc + template + static char test(int, typename U::allocator_type); + + // Match this function if TypeT::allocator_type does not exist or is + // not convertible from Alloc. + template + static int test(LowPriorityConversion, LowPriorityConversion); + + static Alloc alloc; // Declared but not defined + + public: + enum { value = sizeof(test(0, alloc)) == sizeof(char) }; +}; + +} //namespace container_detail { + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//! Remark: Automatically detects if T has a nested allocator_type that is convertible from +//! Alloc. Meets the BinaryTypeTrait requirements ([meta.rqmts] 20.4.1). A program may +//! specialize this type to derive from true_type for a T of user-defined type if T does not +//! have a nested allocator_type but is nonetheless constructible using the specified Alloc. +//! +//! Result: derived from true_type if Convertible and +//! derived from false_type otherwise. +template +struct uses_allocator + : autoboost::integral_constant::value> +{}; + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +namespace container_detail { + +template +struct is_scoped_allocator_imp +{ + template + static char test(int, typename T::outer_allocator_type*); + + template + static int test(LowPriorityConversion, void*); + + static const bool value = (sizeof(char) == sizeof(test(0, 0))); +}; + +template::value > +struct outermost_allocator_type_impl +{ + typedef typename MaybeScopedAlloc::outer_allocator_type outer_type; + typedef typename outermost_allocator_type_impl::type type; +}; + +template +struct outermost_allocator_type_impl +{ + typedef MaybeScopedAlloc type; +}; + +template::value > +struct outermost_allocator_imp +{ + typedef MaybeScopedAlloc type; + + static type &get(MaybeScopedAlloc &a) + { return a; } + + static const type &get(const MaybeScopedAlloc &a) + { return a; } +}; + +template +struct outermost_allocator_imp +{ + typedef typename MaybeScopedAlloc::outer_allocator_type outer_type; + typedef typename outermost_allocator_type_impl::type type; + + static type &get(MaybeScopedAlloc &a) + { return outermost_allocator_imp::get(a.outer_allocator()); } + + static const type &get(const MaybeScopedAlloc &a) + { return outermost_allocator_imp::get(a.outer_allocator()); } +}; + +} //namespace container_detail { + +template +struct is_scoped_allocator + : autoboost::integral_constant::value> +{}; + +template +struct outermost_allocator + : container_detail::outermost_allocator_imp +{}; + +template +typename container_detail::outermost_allocator_imp::type & + get_outermost_allocator(Alloc &a) +{ return container_detail::outermost_allocator_imp::get(a); } + +template +const typename container_detail::outermost_allocator_imp::type & + get_outermost_allocator(const Alloc &a) +{ return container_detail::outermost_allocator_imp::get(a); } + +namespace container_detail { + +// Check if we can detect is_convertible using advanced SFINAE expressions +#if !defined(AUTOBOOST_NO_SFINAE_EXPR) + + //! Code inspired by Mathias Gaunard's is_convertible.cpp found in the Boost mailing list + //! http://boost.2283326.n4.nabble.com/type-traits-is-constructible-when-decltype-is-supported-td3575452.html + //! Thanks Mathias! + + //With variadic templates, we need a single class to implement the trait + #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + template + struct is_constructible_impl + { + typedef char yes_type; + struct no_type + { char padding[2]; }; + + template + struct dummy; + + template + static yes_type test(dummy()...))>*); + + template + static no_type test(...); + + static const bool value = sizeof(test(0)) == sizeof(yes_type); + }; + + template + struct is_constructible + : autoboost::integral_constant::value> + {}; + + template + struct is_constructible_with_allocator_prefix + : is_constructible + {}; + + #else // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + //Without variadic templates, we need to use the preprocessor to generate + //some specializations. + + #define AUTOBOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS \ + AUTOBOOST_PP_ADD(AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, 3) + //! + + //Generate N+1 template parameters so that we can specialize N + template + struct is_constructible_impl; + + //Generate N specializations, from 0 to + //AUTOBOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS parameters + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + template \ + struct is_constructible_impl \ + \ + { \ + typedef char yes_type; \ + struct no_type \ + { char padding[2]; }; \ + \ + template \ + struct dummy; \ + \ + template \ + static yes_type test(dummy*); \ + \ + template \ + static no_type test(...); \ + \ + static const bool value = sizeof(test(0)) == sizeof(yes_type); \ + }; \ + //! + + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + //Finally just inherit from the implementation to define he trait + template< class T + AUTOBOOST_PP_ENUM_TRAILING( AUTOBOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS + , AUTOBOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT + , void) + > + struct is_constructible + : autoboost::integral_constant + < bool + , is_constructible_impl + < T + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(AUTOBOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, P) + , void>::value + > + {}; + + //Finally just inherit from the implementation to define he trait + template + struct is_constructible_with_allocator_prefix + : is_constructible + < T, allocator_arg_t, InnerAlloc + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(AUTOBOOST_PP_SUB(AUTOBOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, 2), P) + > + {}; +/* + template + struct is_constructible_with_allocator_suffix + : is_constructible + < T + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(AUTOBOOST_PP_SUB(AUTOBOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, 1), P) + , InnerAlloc + > + {};*/ + + #endif // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +#else // #if !defined(AUTOBOOST_NO_SFINAE_EXPR) + + //Without advanced SFINAE expressions, we can't use is_constructible + //so backup to constructible_with_allocator_xxx + + #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + template < class T, class InnerAlloc, class ...Args> + struct is_constructible_with_allocator_prefix + : constructible_with_allocator_prefix + {}; +/* + template < class T, class InnerAlloc, class ...Args> + struct is_constructible_with_allocator_suffix + : constructible_with_allocator_suffix + {};*/ + + #else // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + template < class T + , class InnerAlloc + AUTOBOOST_PP_ENUM_TRAILING( AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS + , AUTOBOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT + , void) + > + struct is_constructible_with_allocator_prefix + : constructible_with_allocator_prefix + {}; +/* + template < class T + , class InnerAlloc + AUTOBOOST_PP_ENUM_TRAILING( AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS + , AUTOBOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT + , void) + > + struct is_constructible_with_allocator_suffix + : constructible_with_allocator_suffix + {};*/ + + #endif // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +#endif // #if !defined(AUTOBOOST_NO_SFINAE_EXPR) + +#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +template < typename OutermostAlloc + , typename InnerAlloc + , typename T + , class ...Args + > +inline void dispatch_allocator_prefix_suffix + ( autoboost::true_type use_alloc_prefix, OutermostAlloc& outermost_alloc + , InnerAlloc& inner_alloc, T* p, AUTOBOOST_FWD_REF(Args) ...args) +{ + (void)use_alloc_prefix; + allocator_traits::construct + ( outermost_alloc, p, allocator_arg, inner_alloc, ::autoboost::forward(args)...); +} + +template < typename OutermostAlloc + , typename InnerAlloc + , typename T + , class ...Args + > +inline void dispatch_allocator_prefix_suffix + ( autoboost::false_type use_alloc_prefix, OutermostAlloc& outermost_alloc + , InnerAlloc &inner_alloc, T* p, AUTOBOOST_FWD_REF(Args)...args) +{ + (void)use_alloc_prefix; + allocator_traits::construct + (outermost_alloc, p, ::autoboost::forward(args)..., inner_alloc); +} + +template < typename OutermostAlloc + , typename InnerAlloc + , typename T + , class ...Args + > +inline void dispatch_uses_allocator + ( autoboost::true_type uses_allocator, OutermostAlloc& outermost_alloc + , InnerAlloc& inner_alloc, T* p, AUTOBOOST_FWD_REF(Args)...args) +{ + (void)uses_allocator; + //AUTOBOOST_STATIC_ASSERT((is_constructible_with_allocator_prefix::value || + // is_constructible_with_allocator_suffix::value )); + dispatch_allocator_prefix_suffix + ( is_constructible_with_allocator_prefix() + , outermost_alloc, inner_alloc, p, ::autoboost::forward(args)...); +} + +template < typename OutermostAlloc + , typename InnerAlloc + , typename T + , class ...Args + > +inline void dispatch_uses_allocator + ( autoboost::false_type uses_allocator, OutermostAlloc & outermost_alloc + , InnerAlloc & inner_alloc + ,T* p, AUTOBOOST_FWD_REF(Args)...args) +{ + (void)uses_allocator; (void)inner_alloc; + allocator_traits::construct + (outermost_alloc, p, ::autoboost::forward(args)...); +} + +#else //#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +#define AUTOBOOST_PP_LOCAL_MACRO(n) \ +template < typename OutermostAlloc \ + , typename InnerAlloc \ + , typename T \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \ + > \ +inline void dispatch_allocator_prefix_suffix( \ + autoboost::true_type use_alloc_prefix, \ + OutermostAlloc& outermost_alloc, \ + InnerAlloc& inner_alloc, \ + T* p \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ +{ \ + (void)use_alloc_prefix, \ + allocator_traits::construct \ + (outermost_alloc, p, allocator_arg, inner_alloc \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ +} \ + \ +template < typename OutermostAlloc \ + , typename InnerAlloc \ + , typename T \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \ + > \ +inline void dispatch_allocator_prefix_suffix( \ + autoboost::false_type use_alloc_prefix, \ + OutermostAlloc& outermost_alloc, \ + InnerAlloc& inner_alloc, \ + T* p AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ +{ \ + (void)use_alloc_prefix; \ + allocator_traits::construct \ + (outermost_alloc, p \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _) \ + , inner_alloc); \ +} \ + \ +template < typename OutermostAlloc \ + , typename InnerAlloc \ + , typename T \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \ + > \ +inline void dispatch_uses_allocator(autoboost::true_type uses_allocator, \ + OutermostAlloc& outermost_alloc, \ + InnerAlloc& inner_alloc, \ + T* p AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ +{ \ + (void)uses_allocator; \ + dispatch_allocator_prefix_suffix \ + (is_constructible_with_allocator_prefix \ + < T, InnerAlloc AUTOBOOST_PP_ENUM_TRAILING_PARAMS(n, P)>() \ + , outermost_alloc, inner_alloc, p \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ +} \ + \ +template < typename OutermostAlloc \ + , typename InnerAlloc \ + , typename T \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \ + > \ +inline void dispatch_uses_allocator(autoboost::false_type uses_allocator \ + ,OutermostAlloc & outermost_alloc \ + ,InnerAlloc & inner_alloc \ + ,T* p AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ +{ \ + (void)uses_allocator; (void)inner_alloc; \ + allocator_traits::construct \ + (outermost_alloc, p AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ +} \ +//! +#define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) +#include AUTOBOOST_PP_LOCAL_ITERATE() + +#endif //#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +template +class scoped_allocator_adaptor_base + : public OuterAlloc +{ + typedef allocator_traits outer_traits_type; + AUTOBOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor_base) + + public: + template + struct rebind_base + { + typedef scoped_allocator_adaptor_base other; + }; + + typedef OuterAlloc outer_allocator_type; + typedef scoped_allocator_adaptor inner_allocator_type; + typedef allocator_traits inner_traits_type; + typedef scoped_allocator_adaptor + scoped_allocator_type; + typedef autoboost::integral_constant< + bool, + outer_traits_type::propagate_on_container_copy_assignment::value || + inner_allocator_type::propagate_on_container_copy_assignment::value + > propagate_on_container_copy_assignment; + typedef autoboost::integral_constant< + bool, + outer_traits_type::propagate_on_container_move_assignment::value || + inner_allocator_type::propagate_on_container_move_assignment::value + > propagate_on_container_move_assignment; + typedef autoboost::integral_constant< + bool, + outer_traits_type::propagate_on_container_swap::value || + inner_allocator_type::propagate_on_container_swap::value + > propagate_on_container_swap; + + scoped_allocator_adaptor_base() + {} + + template + scoped_allocator_adaptor_base(AUTOBOOST_FWD_REF(OuterA2) outerAlloc, const InnerAllocs &...args) + : outer_allocator_type(::autoboost::forward(outerAlloc)) + , m_inner(args...) + {} + + scoped_allocator_adaptor_base(const scoped_allocator_adaptor_base& other) + : outer_allocator_type(other.outer_allocator()) + , m_inner(other.inner_allocator()) + {} + + scoped_allocator_adaptor_base(AUTOBOOST_RV_REF(scoped_allocator_adaptor_base) other) + : outer_allocator_type(::autoboost::move(other.outer_allocator())) + , m_inner(::autoboost::move(other.inner_allocator())) + {} + + template + scoped_allocator_adaptor_base + (const scoped_allocator_adaptor_base& other) + : outer_allocator_type(other.outer_allocator()) + , m_inner(other.inner_allocator()) + {} + + template + scoped_allocator_adaptor_base + (AUTOBOOST_RV_REF_BEG scoped_allocator_adaptor_base + AUTOBOOST_RV_REF_END other) + : outer_allocator_type(other.outer_allocator()) + , m_inner(other.inner_allocator()) + {} + + public: + struct internal_type_t{}; + + template + scoped_allocator_adaptor_base + ( internal_type_t + , AUTOBOOST_FWD_REF(OuterA2) outerAlloc + , const inner_allocator_type &inner) + : outer_allocator_type(::autoboost::forward(outerAlloc)) + , m_inner(inner) + {} + + public: + + scoped_allocator_adaptor_base &operator= + (AUTOBOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other) + { + outer_allocator_type::operator=(other.outer_allocator()); + m_inner = other.inner_allocator(); + return *this; + } + + scoped_allocator_adaptor_base &operator=(AUTOBOOST_RV_REF(scoped_allocator_adaptor_base) other) + { + outer_allocator_type::operator=(autoboost::move(other.outer_allocator())); + m_inner = ::autoboost::move(other.inner_allocator()); + return *this; + } + + void swap(scoped_allocator_adaptor_base &r) + { + autoboost::container::swap_dispatch(this->outer_allocator(), r.outer_allocator()); + autoboost::container::swap_dispatch(this->m_inner, r.inner_allocator()); + } + + friend void swap(scoped_allocator_adaptor_base &l, scoped_allocator_adaptor_base &r) + { l.swap(r); } + + inner_allocator_type& inner_allocator() AUTOBOOST_CONTAINER_NOEXCEPT + { return m_inner; } + + inner_allocator_type const& inner_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT + { return m_inner; } + + outer_allocator_type & outer_allocator() AUTOBOOST_CONTAINER_NOEXCEPT + { return static_cast(*this); } + + const outer_allocator_type &outer_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT + { return static_cast(*this); } + + scoped_allocator_type select_on_container_copy_construction() const + { + return scoped_allocator_type + (internal_type_t() + ,outer_traits_type::select_on_container_copy_construction(this->outer_allocator()) + ,inner_traits_type::select_on_container_copy_construction(this->inner_allocator()) + ); + } + + private: + inner_allocator_type m_inner; +}; + +#else //#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +//Let's add a dummy first template parameter to allow creating +//specializations up to maximum InnerAlloc count +template < + typename OuterAlloc + , bool Dummy + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, class Q) + > +class scoped_allocator_adaptor_base; + +//Specializations for the adaptor with InnerAlloc allocators + +#define AUTOBOOST_PP_LOCAL_MACRO(n) \ +template \ +class scoped_allocator_adaptor_base \ + : public OuterAlloc \ +{ \ + typedef allocator_traits outer_traits_type; \ + AUTOBOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor_base) \ + \ + public: \ + template \ + struct rebind_base \ + { \ + typedef scoped_allocator_adaptor_base other; \ + }; \ + \ + typedef OuterAlloc outer_allocator_type; \ + typedef scoped_allocator_adaptor inner_allocator_type; \ + typedef scoped_allocator_adaptor scoped_allocator_type; \ + typedef allocator_traits inner_traits_type; \ + typedef autoboost::integral_constant< \ + bool, \ + outer_traits_type::propagate_on_container_copy_assignment::value || \ + inner_allocator_type::propagate_on_container_copy_assignment::value \ + > propagate_on_container_copy_assignment; \ + typedef autoboost::integral_constant< \ + bool, \ + outer_traits_type::propagate_on_container_move_assignment::value || \ + inner_allocator_type::propagate_on_container_move_assignment::value \ + > propagate_on_container_move_assignment; \ + typedef autoboost::integral_constant< \ + bool, \ + outer_traits_type::propagate_on_container_swap::value || \ + inner_allocator_type::propagate_on_container_swap::value \ + > propagate_on_container_swap; \ + \ + scoped_allocator_adaptor_base() \ + {} \ + \ + template \ + scoped_allocator_adaptor_base(AUTOBOOST_FWD_REF(OuterA2) outerAlloc \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_CONST_REF_PARAM_LIST_Q, _)) \ + : outer_allocator_type(::autoboost::forward(outerAlloc)) \ + , m_inner(AUTOBOOST_PP_ENUM_PARAMS(n, q)) \ + {} \ + \ + scoped_allocator_adaptor_base(const scoped_allocator_adaptor_base& other) \ + : outer_allocator_type(other.outer_allocator()) \ + , m_inner(other.inner_allocator()) \ + {} \ + \ + scoped_allocator_adaptor_base(AUTOBOOST_RV_REF(scoped_allocator_adaptor_base) other) \ + : outer_allocator_type(::autoboost::move(other.outer_allocator())) \ + , m_inner(::autoboost::move(other.inner_allocator())) \ + {} \ + \ + template \ + scoped_allocator_adaptor_base(const scoped_allocator_adaptor_base& other) \ + : outer_allocator_type(other.outer_allocator()) \ + , m_inner(other.inner_allocator()) \ + {} \ + \ + template \ + scoped_allocator_adaptor_base \ + (AUTOBOOST_RV_REF_BEG scoped_allocator_adaptor_base AUTOBOOST_RV_REF_END other) \ + : outer_allocator_type(other.outer_allocator()) \ + , m_inner(other.inner_allocator()) \ + {} \ + \ + public: \ + struct internal_type_t{}; \ + \ + template \ + scoped_allocator_adaptor_base \ + ( internal_type_t \ + , AUTOBOOST_FWD_REF(OuterA2) outerAlloc \ + , const inner_allocator_type &inner) \ + : outer_allocator_type(::autoboost::forward(outerAlloc)) \ + , m_inner(inner) \ + {} \ + \ + public: \ + scoped_allocator_adaptor_base &operator= \ + (AUTOBOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other) \ + { \ + outer_allocator_type::operator=(other.outer_allocator()); \ + m_inner = other.inner_allocator(); \ + return *this; \ + } \ + \ + scoped_allocator_adaptor_base &operator=(AUTOBOOST_RV_REF(scoped_allocator_adaptor_base) other) \ + { \ + outer_allocator_type::operator=(autoboost::move(other.outer_allocator())); \ + m_inner = ::autoboost::move(other.inner_allocator()); \ + return *this; \ + } \ + \ + void swap(scoped_allocator_adaptor_base &r) \ + { \ + autoboost::container::swap_dispatch(this->outer_allocator(), r.outer_allocator()); \ + autoboost::container::swap_dispatch(this->m_inner, r.inner_allocator()); \ + } \ + \ + friend void swap(scoped_allocator_adaptor_base &l, scoped_allocator_adaptor_base &r) \ + { l.swap(r); } \ + \ + inner_allocator_type& inner_allocator() \ + { return m_inner; } \ + \ + inner_allocator_type const& inner_allocator() const \ + { return m_inner; } \ + \ + outer_allocator_type & outer_allocator() \ + { return static_cast(*this); } \ + \ + const outer_allocator_type &outer_allocator() const \ + { return static_cast(*this); } \ + \ + scoped_allocator_type select_on_container_copy_construction() const \ + { \ + return scoped_allocator_type \ + (internal_type_t() \ + ,outer_traits_type::select_on_container_copy_construction(this->outer_allocator()) \ + ,inner_traits_type::select_on_container_copy_construction(this->inner_allocator()) \ + ); \ + } \ + private: \ + inner_allocator_type m_inner; \ +}; \ +//! +#define AUTOBOOST_PP_LOCAL_LIMITS (1, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) +#include AUTOBOOST_PP_LOCAL_ITERATE() + +#endif //#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +//Specialization for adaptor without any InnerAlloc +template +class scoped_allocator_adaptor_base + < OuterAlloc + #if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + , true + AUTOBOOST_PP_ENUM_TRAILING(AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, AUTOBOOST_CONTAINER_PP_IDENTITY, nat) + #endif + > + : public OuterAlloc +{ + AUTOBOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor_base) + public: + + template + struct rebind_base + { + typedef scoped_allocator_adaptor_base + ::template portable_rebind_alloc::type + #if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + , true + AUTOBOOST_PP_ENUM_TRAILING(AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, AUTOBOOST_CONTAINER_PP_IDENTITY, container_detail::nat) + #endif + > other; + }; + + typedef OuterAlloc outer_allocator_type; + typedef allocator_traits outer_traits_type; + typedef scoped_allocator_adaptor inner_allocator_type; + typedef inner_allocator_type scoped_allocator_type; + typedef allocator_traits inner_traits_type; + typedef typename outer_traits_type:: + propagate_on_container_copy_assignment propagate_on_container_copy_assignment; + typedef typename outer_traits_type:: + propagate_on_container_move_assignment propagate_on_container_move_assignment; + typedef typename outer_traits_type:: + propagate_on_container_swap propagate_on_container_swap; + + scoped_allocator_adaptor_base() + {} + + template + scoped_allocator_adaptor_base(AUTOBOOST_FWD_REF(OuterA2) outerAlloc) + : outer_allocator_type(::autoboost::forward(outerAlloc)) + {} + + scoped_allocator_adaptor_base(const scoped_allocator_adaptor_base& other) + : outer_allocator_type(other.outer_allocator()) + {} + + scoped_allocator_adaptor_base(AUTOBOOST_RV_REF(scoped_allocator_adaptor_base) other) + : outer_allocator_type(::autoboost::move(other.outer_allocator())) + {} + + template + scoped_allocator_adaptor_base + (const scoped_allocator_adaptor_base< + OuterA2 + #if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + , true + AUTOBOOST_PP_ENUM_TRAILING(AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, AUTOBOOST_CONTAINER_PP_IDENTITY, container_detail::nat) + #endif + >& other) + : outer_allocator_type(other.outer_allocator()) + {} + + template + scoped_allocator_adaptor_base + (AUTOBOOST_RV_REF_BEG scoped_allocator_adaptor_base< + OuterA2 + #if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + , true + AUTOBOOST_PP_ENUM_TRAILING(AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, AUTOBOOST_CONTAINER_PP_IDENTITY, container_detail::nat) + #endif + > AUTOBOOST_RV_REF_END other) + : outer_allocator_type(other.outer_allocator()) + {} + + public: + struct internal_type_t{}; + + template + scoped_allocator_adaptor_base(internal_type_t, AUTOBOOST_FWD_REF(OuterA2) outerAlloc, const inner_allocator_type &) + : outer_allocator_type(::autoboost::forward(outerAlloc)) + {} + + public: + scoped_allocator_adaptor_base &operator=(AUTOBOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other) + { + outer_allocator_type::operator=(other.outer_allocator()); + return *this; + } + + scoped_allocator_adaptor_base &operator=(AUTOBOOST_RV_REF(scoped_allocator_adaptor_base) other) + { + outer_allocator_type::operator=(autoboost::move(other.outer_allocator())); + return *this; + } + + void swap(scoped_allocator_adaptor_base &r) + { + autoboost::container::swap_dispatch(this->outer_allocator(), r.outer_allocator()); + } + + friend void swap(scoped_allocator_adaptor_base &l, scoped_allocator_adaptor_base &r) + { l.swap(r); } + + inner_allocator_type& inner_allocator() + { return static_cast(*this); } + + inner_allocator_type const& inner_allocator() const + { return static_cast(*this); } + + outer_allocator_type & outer_allocator() + { return static_cast(*this); } + + const outer_allocator_type &outer_allocator() const + { return static_cast(*this); } + + scoped_allocator_type select_on_container_copy_construction() const + { + return scoped_allocator_type + (internal_type_t() + ,outer_traits_type::select_on_container_copy_construction(this->outer_allocator()) + //Don't use inner_traits_type::select_on_container_copy_construction(this->inner_allocator()) + //as inner_allocator() is equal to *this and that would trigger an infinite loop + , this->inner_allocator() + ); + } +}; + +} //namespace container_detail { + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//Scoped allocator +#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + #if !defined(AUTOBOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST) + + //! This class is a C++03-compatible implementation of std::scoped_allocator_adaptor. + //! The class template scoped_allocator_adaptor is an allocator template that specifies + //! the memory resource (the outer allocator) to be used by a container (as any other + //! allocator does) and also specifies an inner allocator resource to be passed to + //! the constructor of every element within the container. + //! + //! This adaptor is + //! instantiated with one outer and zero or more inner allocator types. If + //! instantiated with only one allocator type, the inner allocator becomes the + //! scoped_allocator_adaptor itself, thus using the same allocator resource for the + //! container and every element within the container and, if the elements themselves + //! are containers, each of their elements recursively. If instantiated with more than + //! one allocator, the first allocator is the outer allocator for use by the container, + //! the second allocator is passed to the constructors of the container's elements, + //! and, if the elements themselves are containers, the third allocator is passed to + //! the elements' elements, and so on. If containers are nested to a depth greater + //! than the number of allocators, the last allocator is used repeatedly, as in the + //! single-allocator case, for any remaining recursions. + //! + //! [Note: The + //! scoped_allocator_adaptor is derived from the outer allocator type so it can be + //! substituted for the outer allocator type in most expressions. -end note] + //! + //! In the construct member functions, OUTERMOST(x) is x if x does not have + //! an outer_allocator() member function and + //! OUTERMOST(x.outer_allocator()) otherwise; OUTERMOST_ALLOC_TRAITS(x) is + //! allocator_traits. + //! + //! [Note: OUTERMOST(x) and + //! OUTERMOST_ALLOC_TRAITS(x) are recursive operations. It is incumbent upon + //! the definition of outer_allocator() to ensure that the recursion terminates. + //! It will terminate for all instantiations of scoped_allocator_adaptor. -end note] + template + class scoped_allocator_adaptor + + #else // #if !defined(AUTOBOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST) + + template + class scoped_allocator_adaptor + + #endif // #if !defined(AUTOBOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST) + +#else // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + +template +class scoped_allocator_adaptor +#endif + : public container_detail::scoped_allocator_adaptor_base + +{ + AUTOBOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor) + + public: + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + typedef container_detail::scoped_allocator_adaptor_base + base_type; + typedef typename base_type::internal_type_t internal_type_t; + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + typedef OuterAlloc outer_allocator_type; + //! Type: For exposition only + //! + typedef allocator_traits outer_traits_type; + //! Type: scoped_allocator_adaptor if sizeof...(InnerAllocs) is zero; otherwise, + //! scoped_allocator_adaptor. + typedef typename base_type::inner_allocator_type inner_allocator_type; + typedef allocator_traits inner_traits_type; + typedef typename outer_traits_type::value_type value_type; + typedef typename outer_traits_type::size_type size_type; + typedef typename outer_traits_type::difference_type difference_type; + typedef typename outer_traits_type::pointer pointer; + typedef typename outer_traits_type::const_pointer const_pointer; + typedef typename outer_traits_type::void_pointer void_pointer; + typedef typename outer_traits_type::const_void_pointer const_void_pointer; + //! Type: true_type if allocator_traits::propagate_on_container_copy_assignment::value is + //! true for any Allocator in the set of OuterAlloc and InnerAllocs...; otherwise, false_type. + typedef typename base_type:: + propagate_on_container_copy_assignment propagate_on_container_copy_assignment; + //! Type: true_type if allocator_traits::propagate_on_container_move_assignment::value is + //! true for any Allocator in the set of OuterAlloc and InnerAllocs...; otherwise, false_type. + typedef typename base_type:: + propagate_on_container_move_assignment propagate_on_container_move_assignment; + //! Type: true_type if allocator_traits::propagate_on_container_swap::value is true for any + //! Allocator in the set of OuterAlloc and InnerAllocs...; otherwise, false_type. + typedef typename base_type:: + propagate_on_container_swap propagate_on_container_swap; + + //! Type: Rebinds scoped allocator to + //! typedef scoped_allocator_adaptor + //! < typename outer_traits_type::template portable_rebind_alloc::type + //! , InnerAllocs... > + template + struct rebind + { + typedef scoped_allocator_adaptor + < typename outer_traits_type::template portable_rebind_alloc::type + #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , InnerAllocs... + #else + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q) + #endif + > other; + }; + + //! Effects: value-initializes the OuterAlloc base class + //! and the inner allocator object. + scoped_allocator_adaptor() + {} + + ~scoped_allocator_adaptor() + {} + + //! Effects: initializes each allocator within the adaptor with + //! the corresponding allocator from other. + scoped_allocator_adaptor(const scoped_allocator_adaptor& other) + : base_type(other.base()) + {} + + //! Effects: move constructs each allocator within the adaptor with + //! the corresponding allocator from other. + scoped_allocator_adaptor(AUTOBOOST_RV_REF(scoped_allocator_adaptor) other) + : base_type(::autoboost::move(other.base())) + {} + + #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Requires: OuterAlloc shall be constructible from OuterA2. + //! + //! Effects: initializes the OuterAlloc base class with autoboost::forward(outerAlloc) and inner + //! with innerAllocs...(hence recursively initializing each allocator within the adaptor with the + //! corresponding allocator from the argument list). + template + scoped_allocator_adaptor(AUTOBOOST_FWD_REF(OuterA2) outerAlloc, const InnerAllocs & ...innerAllocs) + : base_type(::autoboost::forward(outerAlloc), innerAllocs...) + {} + #else // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + template \ + scoped_allocator_adaptor(AUTOBOOST_FWD_REF(OuterA2) outerAlloc \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_CONST_REF_PARAM_LIST_Q, _)) \ + : base_type(::autoboost::forward(outerAlloc) \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(n, q) \ + ) \ + {} \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Requires: OuterAlloc shall be constructible from OuterA2. + //! + //! Effects: initializes each allocator within the adaptor with the corresponding allocator from other. + template + scoped_allocator_adaptor(const scoped_allocator_adaptor &other) + : base_type(other.base()) + {} + + //! Requires: OuterAlloc shall be constructible from OuterA2. + //! + //! Effects: initializes each allocator within the adaptor with the corresponding allocator + //! rvalue from other. + template + scoped_allocator_adaptor(AUTOBOOST_RV_REF_BEG scoped_allocator_adaptor AUTOBOOST_RV_REF_END other) + : base_type(::autoboost::move(other.base())) + {} + + scoped_allocator_adaptor &operator=(AUTOBOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor) other) + { return static_cast(base_type::operator=(static_cast(other))); } + + scoped_allocator_adaptor &operator=(AUTOBOOST_RV_REF(scoped_allocator_adaptor) other) + { return static_cast(base_type::operator=(autoboost::move(static_cast(other)))); } + + #ifdef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + //! Effects: swaps *this with r. + //! + void swap(scoped_allocator_adaptor &r); + + //! Effects: swaps *this with r. + //! + friend void swap(scoped_allocator_adaptor &l, scoped_allocator_adaptor &r); + + //! Returns: + //! static_cast(*this). + outer_allocator_type & outer_allocator() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Returns: + //! static_cast(*this). + const outer_allocator_type &outer_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Returns: + //! *this if sizeof...(InnerAllocs) is zero; otherwise, inner. + inner_allocator_type& inner_allocator() AUTOBOOST_CONTAINER_NOEXCEPT; + + //! Returns: + //! *this if sizeof...(InnerAllocs) is zero; otherwise, inner. + inner_allocator_type const& inner_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT; + + #endif //AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + //! Returns: + //! allocator_traits::max_size(outer_allocator()). + size_type max_size() const AUTOBOOST_CONTAINER_NOEXCEPT + { + return outer_traits_type::max_size(this->outer_allocator()); + } + + //! Effects: + //! calls OUTERMOST_ALLOC_TRAITS(*this)::destroy(OUTERMOST(*this), p). + template + void destroy(T* p) AUTOBOOST_CONTAINER_NOEXCEPT + { + allocator_traits::type> + ::destroy(get_outermost_allocator(this->outer_allocator()), p); + } + + //! Returns: + //! allocator_traits::allocate(outer_allocator(), n). + pointer allocate(size_type n) + { + return outer_traits_type::allocate(this->outer_allocator(), n); + } + + //! Returns: + //! allocator_traits::allocate(outer_allocator(), n, hint). + pointer allocate(size_type n, const_void_pointer hint) + { + return outer_traits_type::allocate(this->outer_allocator(), n, hint); + } + + //! Effects: + //! allocator_traits::deallocate(outer_allocator(), p, n). + void deallocate(pointer p, size_type n) + { + outer_traits_type::deallocate(this->outer_allocator(), p, n); + } + + #ifdef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + //! Returns: Allocator new scoped_allocator_adaptor object where each allocator + //! A in the adaptor is initialized from the result of calling + //! allocator_traits::select_on_container_copy_construction() on + //! the corresponding allocator in *this. + scoped_allocator_adaptor select_on_container_copy_construction() const; + #endif //AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + base_type &base() { return *this; } + + const base_type &base() const { return *this; } + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: + //! 1) If uses_allocator::value is false calls + //! OUTERMOST_ALLOC_TRAITS(*this)::construct + //! (OUTERMOST(*this), p, std::forward(args)...). + //! + //! 2) Otherwise, if uses_allocator::value is true and + //! is_constructible::value is true, calls + //! OUTERMOST_ALLOC_TRAITS(*this)::construct(OUTERMOST(*this), p, allocator_arg, + //! inner_allocator(), std::forward(args)...). + //! + //! [Note: In compilers without advanced decltype SFINAE support, is_constructible can't + //! be implemented so that condition will be replaced by + //! constructible_with_allocator_prefix::value. -end note] + //! + //! 3) Otherwise, if uses_allocator::value is true and + //! is_constructible::value is true, calls + //! OUTERMOST_ALLOC_TRAITS(*this)::construct(OUTERMOST(*this), p, + //! std::forward(args)..., inner_allocator()). + //! + //! [Note: In compilers without advanced decltype SFINAE support, is_constructible can't be + //! implemented so that condition will be replaced by + //! constructible_with_allocator_suffix::value. -end note] + //! + //! 4) Otherwise, the program is ill-formed. + //! + //! [Note: An error will result if uses_allocator evaluates + //! to true but the specific constructor does not take an allocator. This definition prevents a silent + //! failure to pass an inner allocator to a contained element. -end note] + template < typename T, class ...Args> + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + void + #else + typename container_detail::enable_if_c::value, void>::type + #endif + construct(T* p, AUTOBOOST_FWD_REF(Args)...args) + { + container_detail::dispatch_uses_allocator + ( uses_allocator() + , get_outermost_allocator(this->outer_allocator()) + , this->inner_allocator() + , p, ::autoboost::forward(args)...); + } + + #else // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //Disable this overload if the first argument is pair as some compilers have + //overload selection problems when the first parameter is a pair. + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + template < typename T \ + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \ + > \ + typename container_detail::enable_if_c::value, void>::type \ + construct(T* p AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + container_detail::dispatch_uses_allocator \ + ( uses_allocator() \ + , get_outermost_allocator(this->outer_allocator()) \ + , this->inner_allocator() \ + , p AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ + } \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + template + void construct(std::pair* p) + { this->construct_pair(p); } + + template + void construct(container_detail::pair* p) + { this->construct_pair(p); } + + template + void construct(std::pair* p, AUTOBOOST_FWD_REF(U) x, AUTOBOOST_FWD_REF(V) y) + { this->construct_pair(p, ::autoboost::forward(x), ::autoboost::forward(y)); } + + template + void construct(container_detail::pair* p, AUTOBOOST_FWD_REF(U) x, AUTOBOOST_FWD_REF(V) y) + { this->construct_pair(p, ::autoboost::forward(x), ::autoboost::forward(y)); } + + template + void construct(std::pair* p, const std::pair& x) + { this->construct_pair(p, x); } + + template + void construct( container_detail::pair* p + , const container_detail::pair& x) + { this->construct_pair(p, x); } + + template + void construct( std::pair* p + , AUTOBOOST_RV_REF_BEG std::pair AUTOBOOST_RV_REF_END x) + { this->construct_pair(p, x); } + + template + void construct( container_detail::pair* p + , AUTOBOOST_RV_REF_BEG container_detail::pair AUTOBOOST_RV_REF_END x) + { this->construct_pair(p, x); } + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + template + void construct_pair(Pair* p) + { + this->construct(container_detail::addressof(p->first)); + AUTOBOOST_TRY{ + this->construct(container_detail::addressof(p->second)); + } + AUTOBOOST_CATCH(...){ + this->destroy(container_detail::addressof(p->first)); + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + } + + template + void construct_pair(Pair* p, AUTOBOOST_FWD_REF(U) x, AUTOBOOST_FWD_REF(V) y) + { + this->construct(container_detail::addressof(p->first), ::autoboost::forward(x)); + AUTOBOOST_TRY{ + this->construct(container_detail::addressof(p->second), ::autoboost::forward(y)); + } + AUTOBOOST_CATCH(...){ + this->destroy(container_detail::addressof(p->first)); + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + } + + template + void construct_pair(Pair* p, const Pair2& pr) + { + this->construct(container_detail::addressof(p->first), pr.first); + AUTOBOOST_TRY{ + this->construct(container_detail::addressof(p->second), pr.second); + } + AUTOBOOST_CATCH(...){ + this->destroy(container_detail::addressof(p->first)); + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + } + + template + void construct_pair(Pair* p, AUTOBOOST_RV_REF(Pair2) pr) + { + this->construct(container_detail::addressof(p->first), ::autoboost::move(pr.first)); + AUTOBOOST_TRY{ + this->construct(container_detail::addressof(p->second), ::autoboost::move(pr.second)); + } + AUTOBOOST_CATCH(...){ + this->destroy(container_detail::addressof(p->first)); + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + } + + //template + //void construct(pair* p, piecewise_construct_t, tuple x, tuple y); + + public: + //Internal function + template + scoped_allocator_adaptor(internal_type_t, AUTOBOOST_FWD_REF(OuterA2) outer, const inner_allocator_type& inner) + : base_type(internal_type_t(), ::autoboost::forward(outer), inner) + {} + + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +}; + +template +inline bool operator==( + const scoped_allocator_adaptor& a, + const scoped_allocator_adaptor& b) +{ + #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + const bool has_zero_inner = sizeof...(InnerAllocs) == 0u; + #else + const bool has_zero_inner = + autoboost::container::container_detail::is_same + ::value; + #endif + + return a.outer_allocator() == b.outer_allocator() + && (has_zero_inner || a.inner_allocator() == b.inner_allocator()); +} + +template +inline bool operator!=( + const scoped_allocator_adaptor& a, + const scoped_allocator_adaptor& b) +{ + return ! (a == b); +} + +}} // namespace autoboost { namespace container { + +#include + +#endif // AUTOBOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP diff --git a/contrib/autoboost/autoboost/container/scoped_allocator_fwd.hpp b/contrib/autoboost/autoboost/container/scoped_allocator_fwd.hpp new file mode 100644 index 000000000..e2be35e0e --- /dev/null +++ b/contrib/autoboost/autoboost/container/scoped_allocator_fwd.hpp @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2011-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP +#define AUTOBOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP + +//! \file +//! This header file forward declares autoboost::container::scoped_allocator_adaptor +//! and defines the following types: + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) +#include +#include +#endif + +namespace autoboost { namespace container { + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + #if !defined(AUTOBOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST) + + template + class scoped_allocator_adaptor; + + #else // #if !defined(AUTOBOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST) + + template + class scoped_allocator_adaptor; + + template + class scoped_allocator_adaptor; + + #endif // #if !defined(AUTOBOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST) + + +#else // #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + +template +class scoped_allocator_adaptor; + +#endif + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//! The allocator_arg_t struct is an empty structure type used as a unique type to +//! disambiguate constructor and function overloading. Specifically, several types +//! have constructors with allocator_arg_t as the first argument, immediately followed +//! by an argument of a type that satisfies the Allocator requirements +struct allocator_arg_t{}; + +//! A instance of type allocator_arg_t +//! +static const allocator_arg_t allocator_arg = allocator_arg_t(); + +template +struct constructible_with_allocator_suffix; + +template +struct constructible_with_allocator_prefix; + +template +struct uses_allocator; + +}} // namespace autoboost { namespace container { + +#include + +#endif // AUTOBOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP diff --git a/contrib/autoboost/autoboost/container/string.hpp b/contrib/autoboost/autoboost/container/string.hpp new file mode 100644 index 000000000..77d520b79 --- /dev/null +++ b/contrib/autoboost/autoboost/container/string.hpp @@ -0,0 +1,2918 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_STRING_HPP +#define AUTOBOOST_CONTAINER_STRING_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace container { + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +namespace container_detail { +// ------------------------------------------------------------ +// Class basic_string_base. + +// basic_string_base is a helper class that makes it it easier to write +// an exception-safe version of basic_string. The constructor allocates, +// but does not initialize, a block of memory. The destructor +// deallocates, but does not destroy elements within, a block of +// memory. The destructor assumes that the memory either is the internal buffer, +// or else points to a block of memory that was allocated using string_base's +// allocator and whose size is this->m_storage. +template +class basic_string_base +{ + basic_string_base & operator=(const basic_string_base &); + basic_string_base(const basic_string_base &); + + typedef allocator_traits allocator_traits_type; + public: + typedef Allocator allocator_type; + typedef allocator_type stored_allocator_type; + typedef typename allocator_traits_type::pointer pointer; + typedef typename allocator_traits_type::value_type value_type; + typedef typename allocator_traits_type::size_type size_type; + typedef ::autoboost::intrusive::pointer_traits pointer_traits; + + basic_string_base() + : members_() + { init(); } + + basic_string_base(const allocator_type& a) + : members_(a) + { init(); } + + basic_string_base(AUTOBOOST_RV_REF(allocator_type) a) + : members_(autoboost::move(a)) + { this->init(); } + + basic_string_base(const allocator_type& a, size_type n) + : members_(a) + { + this->init(); + this->allocate_initial_block(n); + } + + ~basic_string_base() + { + if(!this->is_short()){ + this->deallocate_block(); + this->is_short(true); + } + } + + private: + + //This is the structure controlling a long string + struct long_t + { + size_type is_short : 1; + size_type length : (sizeof(size_type)*CHAR_BIT - 1); + size_type storage; + pointer start; + + long_t() + {} + + long_t(const long_t &other) + { + this->is_short = other.is_short; + length = other.length; + storage = other.storage; + start = other.start; + } + + long_t &operator =(const long_t &other) + { + this->is_short = other.is_short; + length = other.length; + storage = other.storage; + start = other.start; + return *this; + } + }; + + //This type is the first part of the structure controlling a short string + //The "data" member stores + struct short_header + { + unsigned char is_short : 1; + unsigned char length : (CHAR_BIT - 1); + }; + + //This type has the same alignment and size as long_t but it's POD + //so, unlike long_t, it can be placed in a union + + typedef typename autoboost::aligned_storage< sizeof(long_t), + container_detail::alignment_of::value>::type long_raw_t; + + protected: + static const size_type MinInternalBufferChars = 8; + static const size_type AlignmentOfValueType = + alignment_of::value; + static const size_type ShortDataOffset = + container_detail::ct_rounded_size::value; + static const size_type ZeroCostInternalBufferChars = + (sizeof(long_t) - ShortDataOffset)/sizeof(value_type); + static const size_type UnalignedFinalInternalBufferChars = + (ZeroCostInternalBufferChars > MinInternalBufferChars) ? + ZeroCostInternalBufferChars : MinInternalBufferChars; + + struct short_t + { + short_header h; + value_type data[UnalignedFinalInternalBufferChars]; + }; + + union repr_t + { + long_raw_t r; + short_t s; + + const short_t &short_repr() const + { return s; } + + const long_t &long_repr() const + { return *static_cast(static_cast(&r)); } + + short_t &short_repr() + { return s; } + + long_t &long_repr() + { return *static_cast(static_cast(&r)); } + }; + + struct members_holder + : public Allocator + { + members_holder() + : Allocator() + {} + + template + explicit members_holder(AUTOBOOST_FWD_REF(AllocatorConvertible) a) + : Allocator(autoboost::forward(a)) + {} + + repr_t m_repr; + } members_; + + const Allocator &alloc() const + { return members_; } + + Allocator &alloc() + { return members_; } + + static const size_type InternalBufferChars = (sizeof(repr_t) - ShortDataOffset)/sizeof(value_type); + + private: + + static const size_type MinAllocation = InternalBufferChars*2; + + protected: + bool is_short() const + { return static_cast(this->members_.m_repr.s.h.is_short != 0); } + + void is_short(bool yes) + { + const bool was_short = this->is_short(); + if(yes && !was_short){ + allocator_traits_type::destroy + ( this->alloc() + , static_cast(static_cast(&this->members_.m_repr.r)) + ); + this->members_.m_repr.s.h.is_short = true; + } + else if(!yes && was_short){ + allocator_traits_type::construct + ( this->alloc() + , static_cast(static_cast(&this->members_.m_repr.r)) + ); + this->members_.m_repr.s.h.is_short = false; + } + } + + private: + void init() + { + this->members_.m_repr.s.h.is_short = 1; + this->members_.m_repr.s.h.length = 0; + } + + protected: + + typedef container_detail::integral_constant allocator_v1; + typedef container_detail::integral_constant allocator_v2; + typedef container_detail::integral_constant::value> alloc_version; + + std::pair + allocation_command(allocation_type command, + size_type limit_size, + size_type preferred_size, + size_type &received_size, pointer reuse = 0) + { + if(this->is_short() && (command & (expand_fwd | expand_bwd)) ){ + reuse = pointer(); + command &= ~(expand_fwd | expand_bwd); + } + return container_detail::allocator_version_traits::allocation_command + (this->alloc(), command, limit_size, preferred_size, received_size, reuse); + } + + size_type next_capacity(size_type additional_objects) const + { + return next_capacity_calculator + :: + get( allocator_traits_type::max_size(this->alloc()) + , this->priv_storage(), additional_objects ); + } + + void deallocate(pointer p, size_type n) + { + if (p && (n > InternalBufferChars)) + this->alloc().deallocate(p, n); + } + + void construct(pointer p, const value_type &value = value_type()) + { + allocator_traits_type::construct + ( this->alloc() + , container_detail::to_raw_pointer(p) + , value + ); + } + + void destroy(pointer p, size_type n) + { + value_type *raw_p = container_detail::to_raw_pointer(p); + for(; n--; ++raw_p){ + allocator_traits_type::destroy( this->alloc(), raw_p); + } + } + + void destroy(pointer p) + { + allocator_traits_type::destroy + ( this->alloc() + , container_detail::to_raw_pointer(p) + ); + } + + void allocate_initial_block(size_type n) + { + if (n <= this->max_size()) { + if(n > InternalBufferChars){ + size_type new_cap = this->next_capacity(n); + pointer p = this->allocation_command(allocate_new, n, new_cap, new_cap).first; + this->is_short(false); + this->priv_long_addr(p); + this->priv_long_size(0); + this->priv_storage(new_cap); + } + } + else{ + throw_length_error("basic_string::allocate_initial_block max_size() exceeded"); + } + } + + void deallocate_block() + { this->deallocate(this->priv_addr(), this->priv_storage()); } + + size_type max_size() const + { return allocator_traits_type::max_size(this->alloc()) - 1; } + + protected: + size_type priv_capacity() const + { return this->priv_storage() - 1; } + + pointer priv_short_addr() const + { return pointer_traits::pointer_to(const_cast(this->members_.m_repr.short_repr().data[0])); } + + pointer priv_long_addr() const + { return this->members_.m_repr.long_repr().start; } + + pointer priv_addr() const + { + return this->is_short() + ? priv_short_addr() + : priv_long_addr() + ; + } + + pointer priv_end_addr() const + { + return this->is_short() + ? this->priv_short_addr() + this->priv_short_size() + : this->priv_long_addr() + this->priv_long_size() + ; + } + + void priv_long_addr(pointer addr) + { this->members_.m_repr.long_repr().start = addr; } + + size_type priv_storage() const + { return this->is_short() ? priv_short_storage() : priv_long_storage(); } + + size_type priv_short_storage() const + { return InternalBufferChars; } + + size_type priv_long_storage() const + { return this->members_.m_repr.long_repr().storage; } + + void priv_storage(size_type storage) + { + if(!this->is_short()) + this->priv_long_storage(storage); + } + + void priv_long_storage(size_type storage) + { + this->members_.m_repr.long_repr().storage = storage; + } + + size_type priv_size() const + { return this->is_short() ? this->priv_short_size() : this->priv_long_size(); } + + size_type priv_short_size() const + { return this->members_.m_repr.short_repr().h.length; } + + size_type priv_long_size() const + { return this->members_.m_repr.long_repr().length; } + + void priv_size(size_type sz) + { + if(this->is_short()) + this->priv_short_size(sz); + else + this->priv_long_size(sz); + } + + void priv_short_size(size_type sz) + { + this->members_.m_repr.s.h.length = (unsigned char)sz; + } + + void priv_long_size(size_type sz) + { + this->members_.m_repr.long_repr().length = sz; + } + + void swap_data(basic_string_base& other) + { + if(this->is_short()){ + if(other.is_short()){ + std::swap(this->members_.m_repr, other.members_.m_repr); + } + else{ + short_t short_backup(this->members_.m_repr.short_repr()); + long_t long_backup (other.members_.m_repr.long_repr()); + other.members_.m_repr.long_repr().~long_t(); + ::new(&this->members_.m_repr.long_repr()) long_t; + this->members_.m_repr.long_repr() = long_backup; + other.members_.m_repr.short_repr() = short_backup; + } + } + else{ + if(other.is_short()){ + short_t short_backup(other.members_.m_repr.short_repr()); + long_t long_backup (this->members_.m_repr.long_repr()); + this->members_.m_repr.long_repr().~long_t(); + ::new(&other.members_.m_repr.long_repr()) long_t; + other.members_.m_repr.long_repr() = long_backup; + this->members_.m_repr.short_repr() = short_backup; + } + else{ + autoboost::container::swap_dispatch(this->members_.m_repr.long_repr(), other.members_.m_repr.long_repr()); + } + } + } +}; + +} //namespace container_detail { + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//! The basic_string class represents a Sequence of characters. It contains all the +//! usual operations of a Sequence, and, additionally, it contains standard string +//! operations such as search and concatenation. +//! +//! The basic_string class is parameterized by character type, and by that type's +//! Character Traits. +//! +//! This class has performance characteristics very much like vector<>, meaning, +//! for example, that it does not perform reference-count or copy-on-write, and that +//! concatenation of two strings is an O(N) operation. +//! +//! Some of basic_string's member functions use an unusual method of specifying positions +//! and ranges. In addition to the conventional method using iterators, many of +//! basic_string's member functions use a single value pos of type size_type to represent a +//! position (in which case the position is begin() + pos, and many of basic_string's +//! member functions use two values, pos and n, to represent a range. In that case pos is +//! the beginning of the range and n is its size. That is, the range is +//! [begin() + pos, begin() + pos + n). +//! +//! Note that the C++ standard does not specify the complexity of basic_string operations. +//! In this implementation, basic_string has performance characteristics very similar to +//! those of vector: access to a single character is O(1), while copy and concatenation +//! are O(N). +//! +//! In this implementation, begin(), +//! end(), rbegin(), rend(), operator[], c_str(), and data() do not invalidate iterators. +//! In this implementation, iterators are only invalidated by member functions that +//! explicitly change the string's contents. +//! +//! \tparam CharT The type of character it contains. +//! \tparam Traits The Character Traits type, which encapsulates basic character operations +//! \tparam Allocator The allocator, used for internal memory management. +#ifdef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +template , class Allocator = std::allocator > +#else +template +#endif +class basic_string + : private container_detail::basic_string_base +{ + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + typedef allocator_traits allocator_traits_type; + AUTOBOOST_COPYABLE_AND_MOVABLE(basic_string) + typedef container_detail::basic_string_base base_t; + static const typename base_t::size_type InternalBufferChars = base_t::InternalBufferChars; + + protected: + // Allocator helper class to use a char_traits as a function object. + + template + struct Eq_traits + { + //Compatibility with std::binary_function + typedef typename Tr::char_type first_argument_type; + typedef typename Tr::char_type second_argument_type; + typedef bool result_type; + + bool operator()(const first_argument_type& x, const second_argument_type& y) const + { return Tr::eq(x, y); } + }; + + template + struct Not_within_traits + { + typedef typename Tr::char_type argument_type; + typedef bool result_type; + + typedef const typename Tr::char_type* Pointer; + const Pointer m_first; + const Pointer m_last; + + Not_within_traits(Pointer f, Pointer l) + : m_first(f), m_last(l) {} + + bool operator()(const typename Tr::char_type& x) const + { + return std::find_if(m_first, m_last, + std::bind1st(Eq_traits(), x)) == m_last; + } + }; + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + public: + ////////////////////////////////////////////// + // + // types + // + ////////////////////////////////////////////// + typedef Traits traits_type; + typedef CharT value_type; + typedef typename ::autoboost::container::allocator_traits::pointer pointer; + typedef typename ::autoboost::container::allocator_traits::const_pointer const_pointer; + typedef typename ::autoboost::container::allocator_traits::reference reference; + typedef typename ::autoboost::container::allocator_traits::const_reference const_reference; + typedef typename ::autoboost::container::allocator_traits::size_type size_type; + typedef typename ::autoboost::container::allocator_traits::difference_type difference_type; + typedef Allocator allocator_type; + typedef AUTOBOOST_CONTAINER_IMPDEF(allocator_type) stored_allocator_type; + typedef AUTOBOOST_CONTAINER_IMPDEF(pointer) iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(const_pointer) const_iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(container_detail::reverse_iterator) reverse_iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(container_detail::reverse_iterator) const_reverse_iterator; + static const size_type npos = size_type(-1); + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + typedef constant_iterator cvalue_iterator; + typedef typename base_t::allocator_v1 allocator_v1; + typedef typename base_t::allocator_v2 allocator_v2; + typedef typename base_t::alloc_version alloc_version; + typedef ::autoboost::intrusive::pointer_traits pointer_traits; + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + public: // Constructor, destructor, assignment. + ////////////////////////////////////////////// + // + // construct/copy/destroy + // + ////////////////////////////////////////////// + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + struct reserve_t {}; + + basic_string(reserve_t, size_type n, + const allocator_type& a = allocator_type()) + //Select allocator as in copy constructor as reserve_t-based constructors + //are two step copies optimized for capacity + : base_t( allocator_traits_type::select_on_container_copy_construction(a) + , n + 1) + { this->priv_terminate_string(); } + + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + //! Effects: Default constructs a basic_string. + //! + //! Throws: If allocator_type's default constructor throws. + basic_string() + : base_t() + { this->priv_terminate_string(); } + + + //! Effects: Constructs a basic_string taking the allocator as parameter. + //! + //! Throws: Nothing + explicit basic_string(const allocator_type& a) AUTOBOOST_CONTAINER_NOEXCEPT + : base_t(a) + { this->priv_terminate_string(); } + + //! Effects: Copy constructs a basic_string. + //! + //! Postcondition: x == *this. + //! + //! Throws: If allocator_type's default constructor or allocation throws. + basic_string(const basic_string& s) + : base_t(allocator_traits_type::select_on_container_copy_construction(s.alloc())) + { + this->priv_terminate_string(); + this->assign(s.begin(), s.end()); + } + + //! Effects: Move constructor. Moves s's resources to *this. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + basic_string(AUTOBOOST_RV_REF(basic_string) s) AUTOBOOST_CONTAINER_NOEXCEPT + : base_t(autoboost::move(s.alloc())) + { + if(s.alloc() == this->alloc()){ + this->swap_data(s); + } + else{ + this->assign(s.begin(), s.end()); + } + } + + //! Effects: Copy constructs a basic_string using the specified allocator. + //! + //! Postcondition: x == *this. + //! + //! Throws: If allocation throws. + basic_string(const basic_string& s, const allocator_type &a) + : base_t(a) + { + this->priv_terminate_string(); + this->assign(s.begin(), s.end()); + } + + //! Effects: Move constructor using the specified allocator. + //! Moves s's resources to *this. + //! + //! Throws: If allocation throws. + //! + //! Complexity: Constant if a == s.get_allocator(), linear otherwise. + basic_string(AUTOBOOST_RV_REF(basic_string) s, const allocator_type &a) + : base_t(a) + { + this->priv_terminate_string(); + if(a == this->alloc()){ + this->swap_data(s); + } + else{ + this->assign(s.begin(), s.end()); + } + } + + //! Effects: Constructs a basic_string taking the allocator as parameter, + //! and is initialized by a specific number of characters of the s string. + basic_string(const basic_string& s, size_type pos, size_type n = npos, + const allocator_type& a = allocator_type()) + : base_t(a) + { + this->priv_terminate_string(); + if (pos > s.size()) + throw_out_of_range("basic_string::basic_string out of range position"); + else + this->assign + (s.begin() + pos, s.begin() + pos + container_detail::min_value(n, s.size() - pos)); + } + + //! Effects: Constructs a basic_string taking the allocator as parameter, + //! and is initialized by a specific number of characters of the s c-string. + basic_string(const CharT* s, size_type n, const allocator_type& a = allocator_type()) + : base_t(a) + { + this->priv_terminate_string(); + this->assign(s, s + n); + } + + //! Effects: Constructs a basic_string taking the allocator as parameter, + //! and is initialized by the null-terminated s c-string. + basic_string(const CharT* s, const allocator_type& a = allocator_type()) + : base_t(a) + { + this->priv_terminate_string(); + this->assign(s, s + Traits::length(s)); + } + + //! Effects: Constructs a basic_string taking the allocator as parameter, + //! and is initialized by n copies of c. + basic_string(size_type n, CharT c, const allocator_type& a = allocator_type()) + : base_t(a) + { + this->priv_terminate_string(); + this->assign(n, c); + } + + //! Effects: Constructs a basic_string taking the allocator as parameter, + //! and is initialized by n default-initialized characters. + basic_string(size_type n, default_init_t, const allocator_type& a = allocator_type()) + : base_t(a, n + 1) + { + this->priv_size(n); + this->priv_terminate_string(); + } + + //! Effects: Constructs a basic_string taking the allocator as parameter, + //! and a range of iterators. + template + basic_string(InputIterator f, InputIterator l, const allocator_type& a = allocator_type()) + : base_t(a) + { + this->priv_terminate_string(); + this->assign(f, l); + } + + //! Effects: Destroys the basic_string. All used memory is deallocated. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + ~basic_string() AUTOBOOST_CONTAINER_NOEXCEPT + {} + + //! Effects: Copy constructs a string. + //! + //! Postcondition: x == *this. + //! + //! Complexity: Linear to the elements x contains. + basic_string& operator=(AUTOBOOST_COPY_ASSIGN_REF(basic_string) x) + { + if (&x != this){ + allocator_type &this_alloc = this->alloc(); + const allocator_type &x_alloc = x.alloc(); + container_detail::bool_ flag; + if(flag && this_alloc != x_alloc){ + if(!this->is_short()){ + this->deallocate_block(); + this->is_short(true); + Traits::assign(*this->priv_addr(), CharT(0)); + this->priv_short_size(0); + } + } + container_detail::assign_alloc(this->alloc(), x.alloc(), flag); + this->assign(x.begin(), x.end()); + } + return *this; + } + + //! Effects: Move constructor. Moves x's resources to *this. + //! + //! Throws: If allocator_traits_type::propagate_on_container_move_assignment + //! is false and allocation throws + //! + //! Complexity: Constant if allocator_traits_type:: + //! propagate_on_container_move_assignment is true or + //! this->get>allocator() == x.get_allocator(). Linear otherwise. + basic_string& operator=(AUTOBOOST_RV_REF(basic_string) x) + AUTOBOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value) + { + //for move constructor, no aliasing (&x != this) is assummed. + AUTOBOOST_ASSERT(this != &x); + allocator_type &this_alloc = this->alloc(); + allocator_type &x_alloc = x.alloc(); + const bool propagate_alloc = allocator_traits_type:: + propagate_on_container_move_assignment::value; + container_detail::bool_ flag; + const bool allocators_equal = this_alloc == x_alloc; (void)allocators_equal; + //Resources can be transferred if both allocators are + //going to be equal after this function (either propagated or already equal) + if(propagate_alloc || allocators_equal){ + //Destroy objects but retain memory in case x reuses it in the future + this->clear(); + //Move allocator if needed + container_detail::move_alloc(this_alloc, x_alloc, flag); + //Nothrow swap + this->swap_data(x); + } + //Else do a one by one move + else{ + this->assign( x.begin(), x.end()); + } + return *this; + } + + //! Effects: Assignment from a null-terminated c-string. + basic_string& operator=(const CharT* s) + { return this->assign(s, s + Traits::length(s)); } + + //! Effects: Assignment from character. + basic_string& operator=(CharT c) + { return this->assign(static_cast(1), c); } + + //! Effects: Returns a copy of the internal allocator. + //! + //! Throws: If allocator's copy constructor throws. + //! + //! Complexity: Constant. + allocator_type get_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->alloc(); } + + //! Effects: Returns a reference to the internal allocator. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Non-standard extension. + stored_allocator_type &get_stored_allocator() AUTOBOOST_CONTAINER_NOEXCEPT + { return this->alloc(); } + + //! Effects: Returns a reference to the internal allocator. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Non-standard extension. + const stored_allocator_type &get_stored_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->alloc(); } + + ////////////////////////////////////////////// + // + // iterators + // + ////////////////////////////////////////////// + + //! Effects: Returns an iterator to the first element contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + iterator begin() AUTOBOOST_CONTAINER_NOEXCEPT + { return this->priv_addr(); } + + //! Effects: Returns a const_iterator to the first element contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator begin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->priv_addr(); } + + //! Effects: Returns an iterator to the end of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + iterator end() AUTOBOOST_CONTAINER_NOEXCEPT + { return this->priv_end_addr(); } + + //! Effects: Returns a const_iterator to the end of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator end() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->priv_end_addr(); } + + //! Effects: Returns a reverse_iterator pointing to the beginning + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reverse_iterator rbegin() AUTOBOOST_CONTAINER_NOEXCEPT + { return reverse_iterator(this->priv_end_addr()); } + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator rbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->crbegin(); } + + //! Effects: Returns a reverse_iterator pointing to the end + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reverse_iterator rend() AUTOBOOST_CONTAINER_NOEXCEPT + { return reverse_iterator(this->priv_addr()); } + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator rend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->crend(); } + + //! Effects: Returns a const_iterator to the first element contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->priv_addr(); } + + //! Effects: Returns a const_iterator to the end of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->priv_end_addr(); } + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_reverse_iterator(this->priv_end_addr()); } + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_reverse_iterator(this->priv_addr()); } + + ////////////////////////////////////////////// + // + // capacity + // + ////////////////////////////////////////////// + + //! Effects: Returns true if the vector contains no elements. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + bool empty() const AUTOBOOST_CONTAINER_NOEXCEPT + { return !this->priv_size(); } + + //! Effects: Returns the number of the elements contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type size() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->priv_size(); } + + //! Effects: Returns the number of the elements contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type length() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->size(); } + + //! Effects: Returns the largest possible size of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type max_size() const AUTOBOOST_CONTAINER_NOEXCEPT + { return base_t::max_size(); } + + //! Effects: Inserts or erases elements at the end such that + //! the size becomes n. New elements are copy constructed from x. + //! + //! Throws: If memory allocation throws + //! + //! Complexity: Linear to the difference between size() and new_size. + void resize(size_type n, CharT c) + { + if (n <= this->size()) + this->erase(this->begin() + n, this->end()); + else + this->append(n - this->size(), c); + } + + //! Effects: Inserts or erases elements at the end such that + //! the size becomes n. New elements are value initialized. + //! + //! Throws: If memory allocation throws + //! + //! Complexity: Linear to the difference between size() and new_size. + void resize(size_type n) + { resize(n, CharT()); } + + + //! Effects: Inserts or erases elements at the end such that + //! the size becomes n. New elements are uninitialized. + //! + //! Throws: If memory allocation throws + //! + //! Complexity: Linear to the difference between size() and new_size. + //! + //! Note: Non-standard extension + void resize(size_type n, default_init_t) + { + if (n <= this->size()) + this->erase(this->begin() + n, this->end()); + else{ + this->priv_reserve(n, false); + this->priv_size(n); + this->priv_terminate_string(); + } + } + + //! Effects: Number of elements for which memory has been allocated. + //! capacity() is always greater than or equal to size(). + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type capacity() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->priv_capacity(); } + + //! Effects: If n is less than or equal to capacity(), this call has no + //! effect. Otherwise, it is a request for allocation of additional memory. + //! If the request is successful, then capacity() is greater than or equal to + //! n; otherwise, capacity() is unchanged. In either case, size() is unchanged. + //! + //! Throws: If memory allocation allocation throws + void reserve(size_type res_arg) + { this->priv_reserve(res_arg); } + + //! Effects: Tries to deallocate the excess of memory created + //! with previous allocations. The size of the string is unchanged + //! + //! Throws: Nothing + //! + //! Complexity: Linear to size(). + void shrink_to_fit() + { + //Check if shrinking is possible + if(this->priv_storage() > InternalBufferChars){ + //Check if we should pass from dynamically allocated buffer + //to the internal storage + if(this->priv_size() < InternalBufferChars){ + //Dynamically allocated buffer attributes + pointer long_addr = this->priv_long_addr(); + size_type long_storage = this->priv_long_storage(); + size_type long_size = this->priv_long_size(); + //Shrink from allocated buffer to the internal one, including trailing null + Traits::copy( container_detail::to_raw_pointer(this->priv_short_addr()) + , container_detail::to_raw_pointer(long_addr) + , long_size+1); + this->is_short(true); + this->alloc().deallocate(long_addr, long_storage); + } + else{ + //Shrinking in dynamic buffer + this->priv_shrink_to_fit_dynamic_buffer(alloc_version()); + } + } + } + + ////////////////////////////////////////////// + // + // element access + // + ////////////////////////////////////////////// + + //! Requires: size() > n. + //! + //! Effects: Returns a reference to the nth element + //! from the beginning of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reference operator[](size_type n) AUTOBOOST_CONTAINER_NOEXCEPT + { return *(this->priv_addr() + n); } + + //! Requires: size() > n. + //! + //! Effects: Returns a const reference to the nth element + //! from the beginning of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reference operator[](size_type n) const AUTOBOOST_CONTAINER_NOEXCEPT + { return *(this->priv_addr() + n); } + + //! Requires: size() > n. + //! + //! Effects: Returns a reference to the nth element + //! from the beginning of the container. + //! + //! Throws: std::range_error if n >= size() + //! + //! Complexity: Constant. + reference at(size_type n) + { + if (n >= this->size()) + throw_out_of_range("basic_string::at invalid subscript"); + return *(this->priv_addr() + n); + } + + //! Requires: size() > n. + //! + //! Effects: Returns a const reference to the nth element + //! from the beginning of the container. + //! + //! Throws: std::range_error if n >= size() + //! + //! Complexity: Constant. + const_reference at(size_type n) const { + if (n >= this->size()) + throw_out_of_range("basic_string::at invalid subscript"); + return *(this->priv_addr() + n); + } + + ////////////////////////////////////////////// + // + // modifiers + // + ////////////////////////////////////////////// + + //! Effects: Calls append(str.data, str.size()). + //! + //! Returns: *this + basic_string& operator+=(const basic_string& s) + { return this->append(s); } + + //! Effects: Calls append(s). + //! + //! Returns: *this + basic_string& operator+=(const CharT* s) + { return this->append(s); } + + //! Effects: Calls append(1, c). + //! + //! Returns: *this + basic_string& operator+=(CharT c) + { this->push_back(c); return *this; } + + //! Effects: Calls append(str.data(), str.size()). + //! + //! Returns: *this + basic_string& append(const basic_string& s) + { return this->append(s.begin(), s.end()); } + + //! Requires: pos <= str.size() + //! + //! Effects: Determines the effective length rlen of the string to append + //! as the smaller of n and str.size() - pos and calls append(str.data() + pos, rlen). + //! + //! Throws: If memory allocation throws and out_of_range if pos > str.size() + //! + //! Returns: *this + basic_string& append(const basic_string& s, size_type pos, size_type n) + { + if (pos > s.size()) + throw_out_of_range("basic_string::append out of range position"); + return this->append(s.begin() + pos, + s.begin() + pos + container_detail::min_value(n, s.size() - pos)); + } + + //! Requires: s points to an array of at least n elements of CharT. + //! + //! Effects: The function replaces the string controlled by *this with + //! a string of length size() + n whose irst size() elements are a copy of the + //! original string controlled by *this and whose remaining + //! elements are a copy of the initial n elements of s. + //! + //! Throws: If memory allocation throws length_error if size() + n > max_size(). + //! + //! Returns: *this + basic_string& append(const CharT* s, size_type n) + { return this->append(s, s + n); } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Effects: Calls append(s, traits::length(s)). + //! + //! Returns: *this + basic_string& append(const CharT* s) + { return this->append(s, s + Traits::length(s)); } + + //! Effects: Equivalent to append(basic_string(n, c)). + //! + //! Returns: *this + basic_string& append(size_type n, CharT c) + { return this->append(cvalue_iterator(c, n), cvalue_iterator()); } + + //! Requires: [first,last) is a valid range. + //! + //! Effects: Equivalent to append(basic_string(first, last)). + //! + //! Returns: *this + template + basic_string& append(InputIter first, InputIter last) + { this->insert(this->end(), first, last); return *this; } + + //! Effects: Equivalent to append(static_cast(1), c). + void push_back(CharT c) + { + const size_type old_size = this->priv_size(); + if (old_size < this->capacity()){ + const pointer addr = this->priv_addr(); + this->priv_construct_null(addr + old_size + 1); + Traits::assign(addr[old_size], c); + this->priv_size(old_size+1); + } + else{ + //No enough memory, insert a new object at the end + this->append(size_type(1), c); + } + } + + //! Effects: Equivalent to assign(str, 0, npos). + //! + //! Returns: *this + basic_string& assign(const basic_string& s) + { return this->operator=(s); } + + //! Effects: The function replaces the string controlled by *this + //! with a string of length str.size() whose elements are a copy of the string + //! controlled by str. Leaves str in a valid but unspecified state. + //! + //! Throws: Nothing + //! + //! Returns: *this + basic_string& assign(AUTOBOOST_RV_REF(basic_string) ms) AUTOBOOST_CONTAINER_NOEXCEPT + { return this->swap_data(ms), *this; } + + //! Requires: pos <= str.size() + //! + //! Effects: Determines the effective length rlen of the string to assign as + //! the smaller of n and str.size() - pos and calls assign(str.data() + pos rlen). + //! + //! Throws: If memory allocation throws or out_of_range if pos > str.size(). + //! + //! Returns: *this + basic_string& assign(const basic_string& s, size_type pos, size_type n) + { + if (pos > s.size()) + throw_out_of_range("basic_string::assign out of range position"); + return this->assign(s.begin() + pos, + s.begin() + pos + container_detail::min_value(n, s.size() - pos)); + } + + //! Requires: s points to an array of at least n elements of CharT. + //! + //! Effects: Replaces the string controlled by *this with a string of + //! length n whose elements are a copy of those pointed to by s. + //! + //! Throws: If memory allocation throws or length_error if n > max_size(). + //! + //! Returns: *this + basic_string& assign(const CharT* s, size_type n) + { return this->assign(s, s + n); } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Effects: Calls assign(s, traits::length(s)). + //! + //! Returns: *this + basic_string& assign(const CharT* s) + { return this->assign(s, s + Traits::length(s)); } + + //! Effects: Equivalent to assign(basic_string(n, c)). + //! + //! Returns: *this + basic_string& assign(size_type n, CharT c) + { return this->assign(cvalue_iterator(c, n), cvalue_iterator()); } + + //! Effects: Equivalent to assign(basic_string(first, last)). + //! + //! Returns: *this + basic_string& assign(const CharT* first, const CharT* last) + { + size_type n = static_cast(last - first); + this->reserve(n); + CharT* ptr = container_detail::to_raw_pointer(this->priv_addr()); + Traits::copy(ptr, first, n); + this->priv_construct_null(ptr + n); + this->priv_size(n); + return *this; + } + + //! Effects: Equivalent to assign(basic_string(first, last)). + //! + //! Returns: *this + template + basic_string& assign(InputIter first, InputIter last + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + >::type * = 0 + #endif + ) + { + size_type cur = 0; + const pointer addr = this->priv_addr(); + CharT *ptr = container_detail::to_raw_pointer(addr); + const size_type old_size = this->priv_size(); + while (first != last && cur != old_size) { + Traits::assign(*ptr, *first); + ++first; + ++cur; + ++ptr; + } + if (first == last) + this->erase(addr + cur, addr + old_size); + else + this->append(first, last); + return *this; + } + + //! Requires: pos <= size(). + //! + //! Effects: Calls insert(pos, str.data(), str.size()). + //! + //! Throws: If memory allocation throws or out_of_range if pos > size(). + //! + //! Returns: *this + basic_string& insert(size_type pos, const basic_string& s) + { + const size_type sz = this->size(); + if (pos > sz) + throw_out_of_range("basic_string::insert out of range position"); + if (sz > this->max_size() - s.size()) + throw_length_error("basic_string::insert max_size() exceeded"); + this->insert(this->priv_addr() + pos, s.begin(), s.end()); + return *this; + } + + //! Requires: pos1 <= size() and pos2 <= str.size() + //! + //! Effects: Determines the effective length rlen of the string to insert as + //! the smaller of n and str.size() - pos2 and calls insert(pos1, str.data() + pos2, rlen). + //! + //! Throws: If memory allocation throws or out_of_range if pos1 > size() or pos2 > str.size(). + //! + //! Returns: *this + basic_string& insert(size_type pos1, const basic_string& s, size_type pos2, size_type n) + { + const size_type sz = this->size(); + const size_type str_size = s.size(); + if (pos1 > sz || pos2 > str_size) + throw_out_of_range("basic_string::insert out of range position"); + size_type len = container_detail::min_value(n, str_size - pos2); + if (sz > this->max_size() - len) + throw_length_error("basic_string::insert max_size() exceeded"); + const CharT *beg_ptr = container_detail::to_raw_pointer(s.begin()) + pos2; + const CharT *end_ptr = beg_ptr + len; + this->insert(this->priv_addr() + pos1, beg_ptr, end_ptr); + return *this; + } + + //! Requires: s points to an array of at least n elements of CharT and pos <= size(). + //! + //! Effects: Replaces the string controlled by *this with a string of length size() + n + //! whose first pos elements are a copy of the initial elements of the original string + //! controlled by *this and whose next n elements are a copy of the elements in s and whose + //! remaining elements are a copy of the remaining elements of the original string controlled by *this. + //! + //! Throws: If memory allocation throws, out_of_range if pos > size() or + //! length_error if size() + n > max_size(). + //! + //! Returns: *this + basic_string& insert(size_type pos, const CharT* s, size_type n) + { + if (pos > this->size()) + throw_out_of_range("basic_string::insert out of range position"); + if (this->size() > this->max_size() - n) + throw_length_error("basic_string::insert max_size() exceeded"); + this->insert(this->priv_addr() + pos, s, s + n); + return *this; + } + + //! Requires: pos <= size() and s points to an array of at least traits::length(s) + 1 elements of CharT + //! + //! Effects: Calls insert(pos, s, traits::length(s)). + //! + //! Throws: If memory allocation throws, out_of_range if pos > size() + //! length_error if size() > max_size() - Traits::length(s) + //! + //! Returns: *this + basic_string& insert(size_type pos, const CharT* s) + { + if (pos > this->size()) + throw_out_of_range("basic_string::insert out of range position"); + size_type len = Traits::length(s); + if (this->size() > this->max_size() - len) + throw_length_error("basic_string::insert max_size() exceeded"); + this->insert(this->priv_addr() + pos, s, s + len); + return *this; + } + + //! Effects: Equivalent to insert(pos, basic_string(n, c)). + //! + //! Throws: If memory allocation throws, out_of_range if pos > size() + //! length_error if size() > max_size() - n + //! + //! Returns: *this + basic_string& insert(size_type pos, size_type n, CharT c) + { + if (pos > this->size()) + throw_out_of_range("basic_string::insert out of range position"); + if (this->size() > this->max_size() - n) + throw_length_error("basic_string::insert max_size() exceeded"); + this->insert(const_iterator(this->priv_addr() + pos), n, c); + return *this; + } + + //! Requires: p is a valid iterator on *this. + //! + //! Effects: inserts a copy of c before the character referred to by p. + //! + //! Returns: An iterator which refers to the copy of the inserted character. + iterator insert(const_iterator p, CharT c) + { + size_type new_offset = p - this->priv_addr(); + this->insert(p, cvalue_iterator(c, 1), cvalue_iterator()); + return this->priv_addr() + new_offset; + } + + + //! Requires: p is a valid iterator on *this. + //! + //! Effects: Inserts n copies of c before the character referred to by p. + //! + //! Returns: an iterator to the first inserted element or p if n is 0. + iterator insert(const_iterator p, size_type n, CharT c) + { return this->insert(p, cvalue_iterator(c, n), cvalue_iterator()); } + + //! Requires: p is a valid iterator on *this. [first,last) is a valid range. + //! + //! Effects: Equivalent to insert(p - begin(), basic_string(first, last)). + //! + //! Returns: an iterator to the first inserted element or p if first == last. + template + iterator insert(const_iterator p, InputIter first, InputIter last + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + && container_detail::is_input_iterator::value + >::type * = 0 + #endif + ) + { + const size_type n_pos = p - this->cbegin(); + for ( ; first != last; ++first, ++p) { + p = this->insert(p, *first); + } + return this->begin() + n_pos; + } + + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + template + iterator insert(const_iterator p, ForwardIter first, ForwardIter last + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + && !container_detail::is_input_iterator::value + >::type * = 0 + ) + { + const size_type n_pos = p - this->cbegin(); + if (first != last) { + const size_type n = std::distance(first, last); + const size_type old_size = this->priv_size(); + const size_type remaining = this->capacity() - old_size; + const pointer old_start = this->priv_addr(); + bool enough_capacity = false; + std::pair allocation_ret; + size_type new_cap = 0; + + //Check if we have enough capacity + if (remaining >= n){ + enough_capacity = true; + } + else { + //Otherwise expand current buffer or allocate new storage + new_cap = this->next_capacity(n); + allocation_ret = this->allocation_command + (allocate_new | expand_fwd | expand_bwd, old_size + n + 1, + new_cap, new_cap, old_start); + + //Check forward expansion + if(old_start == allocation_ret.first){ + enough_capacity = true; + this->priv_storage(new_cap); + } + } + + //Reuse same buffer + if(enough_capacity){ + const size_type elems_after = old_size - (p - old_start); + const size_type old_length = old_size; + if (elems_after >= n) { + const pointer pointer_past_last = old_start + old_size + 1; + priv_uninitialized_copy(old_start + (old_size - n + 1), + pointer_past_last, pointer_past_last); + + this->priv_size(old_size+n); + Traits::move(const_cast(container_detail::to_raw_pointer(p + n)), + container_detail::to_raw_pointer(p), + (elems_after - n) + 1); + this->priv_copy(first, last, const_cast(container_detail::to_raw_pointer(p))); + } + else { + ForwardIter mid = first; + std::advance(mid, elems_after + 1); + + priv_uninitialized_copy(mid, last, old_start + old_size + 1); + const size_type newer_size = old_size + (n - elems_after); + this->priv_size(newer_size); + priv_uninitialized_copy + (p, const_iterator(old_start + old_length + 1), + old_start + newer_size); + this->priv_size(newer_size + elems_after); + this->priv_copy(first, mid, const_cast(container_detail::to_raw_pointer(p))); + } + } + else{ + pointer new_start = allocation_ret.first; + if(!allocation_ret.second){ + //Copy data to new buffer + size_type new_length = 0; + //This can't throw, since characters are POD + new_length += priv_uninitialized_copy + (const_iterator(old_start), p, new_start); + new_length += priv_uninitialized_copy + (first, last, new_start + new_length); + new_length += priv_uninitialized_copy + (p, const_iterator(old_start + old_size), + new_start + new_length); + this->priv_construct_null(new_start + new_length); + + this->deallocate_block(); + this->is_short(false); + this->priv_long_addr(new_start); + this->priv_long_size(new_length); + this->priv_long_storage(new_cap); + } + else{ + //value_type is POD, so backwards expansion is much easier + //than with vector + value_type * const oldbuf = container_detail::to_raw_pointer(old_start); + value_type * const newbuf = container_detail::to_raw_pointer(new_start); + const value_type *const pos = container_detail::to_raw_pointer(p); + const size_type before = pos - oldbuf; + + //First move old data + Traits::move(newbuf, oldbuf, before); + Traits::move(newbuf + before + n, pos, old_size - before); + //Now initialize the new data + priv_uninitialized_copy(first, last, new_start + before); + this->priv_construct_null(new_start + (old_size + n)); + this->is_short(false); + this->priv_long_addr(new_start); + this->priv_long_size(old_size + n); + this->priv_long_storage(new_cap); + } + } + } + return this->begin() + n_pos; + } + #endif + + //! Requires: pos <= size() + //! + //! Effects: Determines the effective length xlen of the string to be removed as the smaller of n and size() - pos. + //! The function then replaces the string controlled by *this with a string of length size() - xlen + //! whose first pos elements are a copy of the initial elements of the original string controlled by *this, + //! and whose remaining elements are a copy of the elements of the original string controlled by *this + //! beginning at position pos + xlen. + //! + //! Throws: out_of_range if pos > size(). + //! + //! Returns: *this + basic_string& erase(size_type pos = 0, size_type n = npos) + { + if (pos > this->size()) + throw_out_of_range("basic_string::erase out of range position"); + const pointer addr = this->priv_addr(); + erase(addr + pos, addr + pos + container_detail::min_value(n, this->size() - pos)); + return *this; + } + + //! Effects: Removes the character referred to by p. + //! + //! Throws: Nothing + //! + //! Returns: An iterator which points to the element immediately following p prior to the element being + //! erased. If no such element exists, end() is returned. + iterator erase(const_iterator p) AUTOBOOST_CONTAINER_NOEXCEPT + { + // The move includes the terminating null. + CharT * const ptr = const_cast(container_detail::to_raw_pointer(p)); + const size_type old_size = this->priv_size(); + Traits::move(ptr, + container_detail::to_raw_pointer(p + 1), + old_size - (p - this->priv_addr())); + this->priv_size(old_size-1); + return iterator(ptr); + } + + //! Requires: first and last are valid iterators on *this, defining a range [first,last). + //! + //! Effects: Removes the characters in the range [first,last). + //! + //! Throws: Nothing + //! + //! Returns: An iterator which points to the element pointed to by last prior to + //! the other elements being erased. If no such element exists, end() is returned. + iterator erase(const_iterator first, const_iterator last) AUTOBOOST_CONTAINER_NOEXCEPT + { + CharT * f = const_cast(container_detail::to_raw_pointer(first)); + if (first != last) { // The move includes the terminating null. + const size_type num_erased = last - first; + const size_type old_size = this->priv_size(); + Traits::move(f, + container_detail::to_raw_pointer(last), + (old_size + 1)-(last - this->priv_addr())); + const size_type new_length = old_size - num_erased; + this->priv_size(new_length); + } + return iterator(f); + } + + //! Requires: !empty() + //! + //! Throws: Nothing + //! + //! Effects: Equivalent to erase(size() - 1, 1). + void pop_back() AUTOBOOST_CONTAINER_NOEXCEPT + { + const size_type old_size = this->priv_size(); + Traits::assign(this->priv_addr()[old_size-1], CharT(0)); + this->priv_size(old_size-1);; + } + + //! Effects: Erases all the elements of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the number of elements in the vector. + void clear() AUTOBOOST_CONTAINER_NOEXCEPT + { + if (!this->empty()) { + Traits::assign(*this->priv_addr(), CharT(0)); + this->priv_size(0); + } + } + + //! Requires: pos1 <= size(). + //! + //! Effects: Calls replace(pos1, n1, str.data(), str.size()). + //! + //! Throws: if memory allocation throws or out_of_range if pos1 > size(). + //! + //! Returns: *this + basic_string& replace(size_type pos1, size_type n1, const basic_string& str) + { + if (pos1 > this->size()) + throw_out_of_range("basic_string::replace out of range position"); + const size_type len = container_detail::min_value(n1, this->size() - pos1); + if (this->size() - len >= this->max_size() - str.size()) + throw_length_error("basic_string::replace max_size() exceeded"); + const pointer addr = this->priv_addr(); + return this->replace( const_iterator(addr + pos1) + , const_iterator(addr + pos1 + len) + , str.begin(), str.end()); + } + + //! Requires: pos1 <= size() and pos2 <= str.size(). + //! + //! Effects: Determines the effective length rlen of the string to be + //! inserted as the smaller of n2 and str.size() - pos2 and calls + //! replace(pos1, n1, str.data() + pos2, rlen). + //! + //! Throws: if memory allocation throws, out_of_range if pos1 > size() or pos2 > str.size(). + //! + //! Returns: *this + basic_string& replace(size_type pos1, size_type n1, + const basic_string& str, size_type pos2, size_type n2) + { + if (pos1 > this->size() || pos2 > str.size()) + throw_out_of_range("basic_string::replace out of range position"); + const size_type len1 = container_detail::min_value(n1, this->size() - pos1); + const size_type len2 = container_detail::min_value(n2, str.size() - pos2); + if (this->size() - len1 >= this->max_size() - len2) + throw_length_error("basic_string::replace max_size() exceeded"); + const pointer addr = this->priv_addr(); + const pointer straddr = str.priv_addr(); + return this->replace(addr + pos1, addr + pos1 + len1, + straddr + pos2, straddr + pos2 + len2); + } + + //! Requires: pos1 <= size() and s points to an array of at least n2 elements of CharT. + //! + //! Effects: Determines the effective length xlen of the string to be removed as the + //! smaller of n1 and size() - pos1. If size() - xlen >= max_size() - n2 throws length_error. + //! Otherwise, the function replaces the string controlled by *this with a string of + //! length size() - xlen + n2 whose first pos1 elements are a copy of the initial elements + //! of the original string controlled by *this, whose next n2 elements are a copy of the + //! initial n2 elements of s, and whose remaining elements are a copy of the elements of + //! the original string controlled by *this beginning at position pos + xlen. + //! + //! Throws: if memory allocation throws, out_of_range if pos1 > size() or length_error + //! if the length of the resulting string would exceed max_size() + //! + //! Returns: *this + basic_string& replace(size_type pos1, size_type n1, const CharT* s, size_type n2) + { + if (pos1 > this->size()) + throw_out_of_range("basic_string::replace out of range position"); + const size_type len = container_detail::min_value(n1, this->size() - pos1); + if (n2 > this->max_size() || size() - len >= this->max_size() - n2) + throw_length_error("basic_string::replace max_size() exceeded"); + const pointer addr = this->priv_addr(); + return this->replace(addr + pos1, addr + pos1 + len, s, s + n2); + } + + //! Requires: pos1 <= size() and s points to an array of at least n2 elements of CharT. + //! + //! Effects: Determines the effective length xlen of the string to be removed as the smaller + //! of n1 and size() - pos1. If size() - xlen >= max_size() - n2 throws length_error. Otherwise, + //! the function replaces the string controlled by *this with a string of length size() - xlen + n2 + //! whose first pos1 elements are a copy of the initial elements of the original string controlled + //! by *this, whose next n2 elements are a copy of the initial n2 elements of s, and whose + //! remaining elements are a copy of the elements of the original string controlled by *this + //! beginning at position pos + xlen. + //! + //! Throws: if memory allocation throws, out_of_range if pos1 > size() or length_error + //! if the length of the resulting string would exceed max_size() + //! + //! Returns: *this + basic_string& replace(size_type pos, size_type n1, const CharT* s) + { + if (pos > this->size()) + throw_out_of_range("basic_string::replace out of range position"); + const size_type len = container_detail::min_value(n1, this->size() - pos); + const size_type n2 = Traits::length(s); + if (n2 > this->max_size() || this->size() - len >= this->max_size() - n2) + throw_length_error("basic_string::replace max_size() exceeded"); + const pointer addr = this->priv_addr(); + return this->replace(addr + pos, addr + pos + len, + s, s + Traits::length(s)); + } + + //! Requires: pos1 <= size(). + //! + //! Effects: Equivalent to replace(pos1, n1, basic_string(n2, c)). + //! + //! Throws: if memory allocation throws, out_of_range if pos1 > size() or length_error + //! if the length of the resulting string would exceed max_size() + //! + //! Returns: *this + basic_string& replace(size_type pos1, size_type n1, size_type n2, CharT c) + { + if (pos1 > this->size()) + throw_out_of_range("basic_string::replace out of range position"); + const size_type len = container_detail::min_value(n1, this->size() - pos1); + if (n2 > this->max_size() || this->size() - len >= this->max_size() - n2) + throw_length_error("basic_string::replace max_size() exceeded"); + const pointer addr = this->priv_addr(); + return this->replace(addr + pos1, addr + pos1 + len, n2, c); + } + + //! Requires: [begin(),i1) and [i1,i2) are valid ranges. + //! + //! Effects: Calls replace(i1 - begin(), i2 - i1, str). + //! + //! Throws: if memory allocation throws + //! + //! Returns: *this + basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str) + { return this->replace(i1, i2, str.begin(), str.end()); } + + //! Requires: [begin(),i1) and [i1,i2) are valid ranges and + //! s points to an array of at least n elements + //! + //! Effects: Calls replace(i1 - begin(), i2 - i1, s, n). + //! + //! Throws: if memory allocation throws + //! + //! Returns: *this + basic_string& replace(const_iterator i1, const_iterator i2, const CharT* s, size_type n) + { return this->replace(i1, i2, s, s + n); } + + //! Requires: [begin(),i1) and [i1,i2) are valid ranges and s points to an + //! array of at least traits::length(s) + 1 elements of CharT. + //! + //! Effects: Calls replace(i1 - begin(), i2 - i1, s, traits::length(s)). + //! + //! Throws: if memory allocation throws + //! + //! Returns: *this + basic_string& replace(const_iterator i1, const_iterator i2, const CharT* s) + { return this->replace(i1, i2, s, s + Traits::length(s)); } + + //! Requires: [begin(),i1) and [i1,i2) are valid ranges. + //! + //! Effects: Calls replace(i1 - begin(), i2 - i1, basic_string(n, c)). + //! + //! Throws: if memory allocation throws + //! + //! Returns: *this + basic_string& replace(const_iterator i1, const_iterator i2, size_type n, CharT c) + { + const size_type len = static_cast(i2 - i1); + if (len >= n) { + Traits::assign(const_cast(container_detail::to_raw_pointer(i1)), n, c); + erase(i1 + n, i2); + } + else { + Traits::assign(const_cast(container_detail::to_raw_pointer(i1)), len, c); + insert(i2, n - len, c); + } + return *this; + } + + //! Requires: [begin(),i1), [i1,i2) and [j1,j2) are valid ranges. + //! + //! Effects: Calls replace(i1 - begin(), i2 - i1, basic_string(j1, j2)). + //! + //! Throws: if memory allocation throws + //! + //! Returns: *this + template + basic_string& replace(const_iterator i1, const_iterator i2, InputIter j1, InputIter j2 + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + && container_detail::is_input_iterator::value + >::type * = 0 + #endif + ) + { + for ( ; i1 != i2 && j1 != j2; ++i1, ++j1){ + Traits::assign(*const_cast(container_detail::to_raw_pointer(i1)), *j1); + } + + if (j1 == j2) + this->erase(i1, i2); + else + this->insert(i2, j1, j2); + return *this; + } + + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + template + basic_string& replace(const_iterator i1, const_iterator i2, ForwardIter j1, ForwardIter j2 + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + && !container_detail::is_input_iterator::value + >::type * = 0 + ) + { + difference_type n = std::distance(j1, j2); + const difference_type len = i2 - i1; + if (len >= n) { + this->priv_copy(j1, j2, const_cast(container_detail::to_raw_pointer(i1))); + this->erase(i1 + n, i2); + } + else { + ForwardIter m = j1; + std::advance(m, len); + this->priv_copy(j1, m, const_cast(container_detail::to_raw_pointer(i1))); + this->insert(i2, m, j2); + } + return *this; + } + #endif + + //! Requires: pos <= size() + //! + //! Effects: Determines the effective length rlen of the string to copy as the + //! smaller of n and size() - pos. s shall designate an array of at least rlen elements. + //! The function then replaces the string designated by s with a string of length rlen + //! whose elements are a copy of the string controlled by *this beginning at position pos. + //! The function does not append a null object to the string designated by s. + //! + //! Throws: if memory allocation throws, out_of_range if pos > size(). + //! + //! Returns: rlen + size_type copy(CharT* s, size_type n, size_type pos = 0) const + { + if (pos > this->size()) + throw_out_of_range("basic_string::copy out of range position"); + const size_type len = container_detail::min_value(n, this->size() - pos); + Traits::copy(s, container_detail::to_raw_pointer(this->priv_addr() + pos), len); + return len; + } + + //! Effects: *this contains the same sequence of characters that was in s, + //! s contains the same sequence of characters that was in *this. + //! + //! Throws: Nothing + void swap(basic_string& x) + { + this->base_t::swap_data(x); + container_detail::bool_ flag; + container_detail::swap_alloc(this->alloc(), x.alloc(), flag); + } + + ////////////////////////////////////////////// + // + // data access + // + ////////////////////////////////////////////// + + //! Requires: The program shall not alter any of the values stored in the character array. + //! + //! Returns: Allocator pointer p such that p + i == &operator[](i) for each i in [0,size()]. + //! + //! Complexity: constant time. + const CharT* c_str() const AUTOBOOST_CONTAINER_NOEXCEPT + { return container_detail::to_raw_pointer(this->priv_addr()); } + + //! Requires: The program shall not alter any of the values stored in the character array. + //! + //! Returns: Allocator pointer p such that p + i == &operator[](i) for each i in [0,size()]. + //! + //! Complexity: constant time. + const CharT* data() const AUTOBOOST_CONTAINER_NOEXCEPT + { return container_detail::to_raw_pointer(this->priv_addr()); } + + ////////////////////////////////////////////// + // + // string operations + // + ////////////////////////////////////////////// + + //! Effects: Determines the lowest position xpos, if possible, such that both + //! of the following conditions obtain: 19 pos <= xpos and xpos + str.size() <= size(); + //! 2) traits::eq(at(xpos+I), str.at(I)) for all elements I of the string controlled by str. + //! + //! Throws: Nothing + //! + //! Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos. + size_type find(const basic_string& s, size_type pos = 0) const + { return find(s.c_str(), pos, s.size()); } + + //! Requires: s points to an array of at least n elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find(basic_string(s,n),pos). + size_type find(const CharT* s, size_type pos, size_type n) const + { + if (pos + n > this->size()) + return npos; + else { + const pointer addr = this->priv_addr(); + pointer finish = addr + this->priv_size(); + const const_iterator result = + std::search(container_detail::to_raw_pointer(addr + pos), + container_detail::to_raw_pointer(finish), + s, s + n, Eq_traits()); + return result != finish ? result - begin() : npos; + } + } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find(basic_string(s), pos). + size_type find(const CharT* s, size_type pos = 0) const + { return this->find(s, pos, Traits::length(s)); } + + //! Throws: Nothing + //! + //! Returns: find(basic_string(1,c), pos). + size_type find(CharT c, size_type pos = 0) const + { + const size_type sz = this->size(); + if (pos >= sz) + return npos; + else { + const pointer addr = this->priv_addr(); + pointer finish = addr + sz; + const const_iterator result = + std::find_if(addr + pos, finish, + std::bind2nd(Eq_traits(), c)); + return result != finish ? result - begin() : npos; + } + } + + //! Effects: Determines the highest position xpos, if possible, such + //! that both of the following conditions obtain: + //! a) xpos <= pos and xpos + str.size() <= size(); + //! b) traits::eq(at(xpos+I), str.at(I)) for all elements I of the string controlled by str. + //! + //! Throws: Nothing + //! + //! Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos. + size_type rfind(const basic_string& str, size_type pos = npos) const + { return rfind(str.c_str(), pos, str.size()); } + + //! Requires: s points to an array of at least n elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: rfind(basic_string(s, n), pos). + size_type rfind(const CharT* s, size_type pos, size_type n) const + { + const size_type len = this->size(); + + if (n > len) + return npos; + else if (n == 0) + return container_detail::min_value(len, pos); + else { + const const_iterator last = begin() + container_detail::min_value(len - n, pos) + n; + const const_iterator result = find_end(begin(), last, + s, s + n, + Eq_traits()); + return result != last ? result - begin() : npos; + } + } + + //! Requires: pos <= size() and s points to an array of at least + //! traits::length(s) + 1 elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: rfind(basic_string(s), pos). + size_type rfind(const CharT* s, size_type pos = npos) const + { return rfind(s, pos, Traits::length(s)); } + + //! Throws: Nothing + //! + //! Returns: rfind(basic_string(1,c),pos). + size_type rfind(CharT c, size_type pos = npos) const + { + const size_type len = this->size(); + + if (len < 1) + return npos; + else { + const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1; + const_reverse_iterator rresult = + std::find_if(const_reverse_iterator(last), rend(), + std::bind2nd(Eq_traits(), c)); + return rresult != rend() ? (rresult.base() - 1) - begin() : npos; + } + } + + //! Effects: Determines the lowest position xpos, if possible, such that both of the + //! following conditions obtain: a) pos <= xpos and xpos < size(); + //! b) traits::eq(at(xpos), str.at(I)) for some element I of the string controlled by str. + //! + //! Throws: Nothing + //! + //! Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos. + size_type find_first_of(const basic_string& s, size_type pos = 0) const + { return find_first_of(s.c_str(), pos, s.size()); } + + //! Requires: s points to an array of at least n elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_first_of(basic_string(s, n), pos). + size_type find_first_of(const CharT* s, size_type pos, size_type n) const + { + const size_type sz = this->size(); + if (pos >= sz) + return npos; + else { + const pointer addr = this->priv_addr(); + pointer finish = addr + sz; + const_iterator result = std::find_first_of + (addr + pos, finish, s, s + n, Eq_traits()); + return result != finish ? result - this->begin() : npos; + } + } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_first_of(basic_string(s), pos). + size_type find_first_of(const CharT* s, size_type pos = 0) const + { return find_first_of(s, pos, Traits::length(s)); } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_first_of(basic_string(1,c), pos). + size_type find_first_of(CharT c, size_type pos = 0) const + { return find(c, pos); } + + //! Effects: Determines the highest position xpos, if possible, such that both of + //! the following conditions obtain: a) xpos <= pos and xpos < size(); b) + //! traits::eq(at(xpos), str.at(I)) for some element I of the string controlled by str. + //! + //! Throws: Nothing + //! + //! Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos. + size_type find_last_of(const basic_string& str, size_type pos = npos) const + { return find_last_of(str.c_str(), pos, str.size()); } + + //! Requires: s points to an array of at least n elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_last_of(basic_string(s, n), pos). + size_type find_last_of(const CharT* s, size_type pos, size_type n) const + { + const size_type len = this->size(); + + if (len < 1) + return npos; + else { + const pointer addr = this->priv_addr(); + const const_iterator last = addr + container_detail::min_value(len - 1, pos) + 1; + const const_reverse_iterator rresult = + std::find_first_of(const_reverse_iterator(last), rend(), + s, s + n, Eq_traits()); + return rresult != rend() ? (rresult.base() - 1) - addr : npos; + } + } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_last_of(basic_string(1,c),pos). + size_type find_last_of(const CharT* s, size_type pos = npos) const + { return find_last_of(s, pos, Traits::length(s)); } + + //! Throws: Nothing + //! + //! Returns: find_last_of(basic_string(s), pos). + size_type find_last_of(CharT c, size_type pos = npos) const + { return rfind(c, pos); } + + //! Effects: Determines the lowest position xpos, if possible, such that + //! both of the following conditions obtain: + //! a) pos <= xpos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for no + //! element I of the string controlled by str. + //! + //! Throws: Nothing + //! + //! Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos. + size_type find_first_not_of(const basic_string& str, size_type pos = 0) const + { return find_first_not_of(str.c_str(), pos, str.size()); } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_first_not_of(basic_string(s, n), pos). + size_type find_first_not_of(const CharT* s, size_type pos, size_type n) const + { + if (pos > this->size()) + return npos; + else { + const pointer addr = this->priv_addr(); + const pointer finish = addr + this->priv_size(); + const const_iterator result = std::find_if + (addr + pos, finish, Not_within_traits(s, s + n)); + return result != finish ? result - addr : npos; + } + } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_first_not_of(basic_string(s), pos). + size_type find_first_not_of(const CharT* s, size_type pos = 0) const + { return find_first_not_of(s, pos, Traits::length(s)); } + + //! Throws: Nothing + //! + //! Returns: find_first_not_of(basic_string(1, c), pos). + size_type find_first_not_of(CharT c, size_type pos = 0) const + { + if (pos > this->size()) + return npos; + else { + const pointer addr = this->priv_addr(); + const pointer finish = addr + this->priv_size(); + const const_iterator result + = std::find_if(addr + pos, finish, + std::not1(std::bind2nd(Eq_traits(), c))); + return result != finish ? result - begin() : npos; + } + } + + //! Effects: Determines the highest position xpos, if possible, such that + //! both of the following conditions obtain: a) xpos <= pos and xpos < size(); + //! b) traits::eq(at(xpos), str.at(I)) for no element I of the string controlled by str. + //! + //! Throws: Nothing + //! + //! Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos. + size_type find_last_not_of(const basic_string& str, size_type pos = npos) const + { return find_last_not_of(str.c_str(), pos, str.size()); } + + //! Requires: s points to an array of at least n elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_last_not_of(basic_string(s, n), pos). + size_type find_last_not_of(const CharT* s, size_type pos, size_type n) const + { + const size_type len = this->size(); + + if (len < 1) + return npos; + else { + const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1; + const const_reverse_iterator rresult = + std::find_if(const_reverse_iterator(last), rend(), + Not_within_traits(s, s + n)); + return rresult != rend() ? (rresult.base() - 1) - begin() : npos; + } + } + + //! Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Throws: Nothing + //! + //! Returns: find_last_not_of(basic_string(s), pos). + size_type find_last_not_of(const CharT* s, size_type pos = npos) const + { return find_last_not_of(s, pos, Traits::length(s)); } + + //! Throws: Nothing + //! + //! Returns: find_last_not_of(basic_string(1, c), pos). + size_type find_last_not_of(CharT c, size_type pos = npos) const + { + const size_type len = this->size(); + + if (len < 1) + return npos; + else { + const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1; + const const_reverse_iterator rresult = + std::find_if(const_reverse_iterator(last), rend(), + std::not1(std::bind2nd(Eq_traits(), c))); + return rresult != rend() ? (rresult.base() - 1) - begin() : npos; + } + } + + //! Requires: Requires: pos <= size() + //! + //! Effects: Determines the effective length rlen of the string to copy as + //! the smaller of n and size() - pos. + //! + //! Throws: If memory allocation throws or out_of_range if pos > size(). + //! + //! Returns: basic_string(data()+pos,rlen). + basic_string substr(size_type pos = 0, size_type n = npos) const + { + if (pos > this->size()) + throw_out_of_range("basic_string::substr out of range position"); + const pointer addr = this->priv_addr(); + return basic_string(addr + pos, + addr + pos + container_detail::min_value(n, size() - pos), this->alloc()); + } + + //! Effects: Determines the effective length rlen of the string to copy as + //! the smaller of size() and str.size(). The function then compares the two strings by + //! calling traits::compare(data(), str.data(), rlen). + //! + //! Throws: Nothing + //! + //! Returns: The nonzero result if the result of the comparison is nonzero. + //! Otherwise, returns a value < 0 if size() < str.size(), a 0 value if size() == str.size(), + //! and value > 0 if size() > str.size() + int compare(const basic_string& str) const + { + const pointer addr = this->priv_addr(); + const pointer str_addr = str.priv_addr(); + return s_compare(addr, addr + this->priv_size(), str_addr, str_addr + str.priv_size()); + } + + //! Requires: pos1 <= size() + //! + //! Effects: Determines the effective length rlen of the string to copy as + //! the smaller of + //! + //! Throws: out_of_range if pos1 > size() + //! + //! Returns:basic_string(*this,pos1,n1).compare(str). + int compare(size_type pos1, size_type n1, const basic_string& str) const + { + if (pos1 > this->size()) + throw_out_of_range("basic_string::compare out of range position"); + const pointer addr = this->priv_addr(); + const pointer str_addr = str.priv_addr(); + return s_compare(addr + pos1, + addr + pos1 + container_detail::min_value(n1, this->size() - pos1), + str_addr, str_addr + str.priv_size()); + } + + //! Requires: pos1 <= size() and pos2 <= str.size() + //! + //! Effects: Determines the effective length rlen of the string to copy as + //! the smaller of + //! + //! Throws: out_of_range if pos1 > size() or pos2 > str.size() + //! + //! Returns: basic_string(*this, pos1, n1).compare(basic_string(str, pos2, n2)). + int compare(size_type pos1, size_type n1, const basic_string& str, size_type pos2, size_type n2) const + { + if (pos1 > this->size() || pos2 > str.size()) + throw_out_of_range("basic_string::compare out of range position"); + const pointer addr = this->priv_addr(); + const pointer str_addr = str.priv_addr(); + return s_compare(addr + pos1, + addr + pos1 + container_detail::min_value(n1, this->size() - pos1), + str_addr + pos2, + str_addr + pos2 + container_detail::min_value(n2, str.size() - pos2)); + } + + //! Throws: Nothing + //! + //! Returns: compare(basic_string(s)). + int compare(const CharT* s) const + { + const pointer addr = this->priv_addr(); + return s_compare(addr, addr + this->priv_size(), s, s + Traits::length(s)); + } + + + //! Requires: pos1 > size() and s points to an array of at least n2 elements of CharT. + //! + //! Throws: out_of_range if pos1 > size() + //! + //! Returns: basic_string(*this, pos, n1).compare(basic_string(s, n2)). + int compare(size_type pos1, size_type n1, const CharT* s, size_type n2) const + { + if (pos1 > this->size()) + throw_out_of_range("basic_string::compare out of range position"); + const pointer addr = this->priv_addr(); + return s_compare( addr + pos1, + addr + pos1 + container_detail::min_value(n1, this->size() - pos1), + s, s + n2); + } + + //! Requires: pos1 > size() and s points to an array of at least traits::length(s) + 1 elements of CharT. + //! + //! Throws: out_of_range if pos1 > size() + //! + //! Returns: basic_string(*this, pos, n1).compare(basic_string(s, n2)). + int compare(size_type pos1, size_type n1, const CharT* s) const + { return this->compare(pos1, n1, s, Traits::length(s)); } + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + void priv_reserve(size_type res_arg, const bool null_terminate = true) + { + if (res_arg > this->max_size()){ + throw_length_error("basic_string::reserve max_size() exceeded"); + } + + if (this->capacity() < res_arg){ + size_type n = container_detail::max_value(res_arg, this->size()) + 1; + size_type new_cap = this->next_capacity(n); + pointer new_start = this->allocation_command + (allocate_new, n, new_cap, new_cap).first; + size_type new_length = 0; + + const pointer addr = this->priv_addr(); + new_length += priv_uninitialized_copy + (addr, addr + this->priv_size(), new_start); + if(null_terminate){ + this->priv_construct_null(new_start + new_length); + } + this->deallocate_block(); + this->is_short(false); + this->priv_long_addr(new_start); + this->priv_long_size(new_length); + this->priv_storage(new_cap); + } + } + + static int s_compare(const_pointer f1, const_pointer l1, + const_pointer f2, const_pointer l2) + { + const difference_type n1 = l1 - f1; + const difference_type n2 = l2 - f2; + const int cmp = Traits::compare(container_detail::to_raw_pointer(f1), + container_detail::to_raw_pointer(f2), + container_detail::min_value(n1, n2)); + return cmp != 0 ? cmp : (n1 < n2 ? -1 : (n1 > n2 ? 1 : 0)); + } + + template + void priv_shrink_to_fit_dynamic_buffer + ( AllocVersion + , typename container_detail::enable_if >::type* = 0) + { + //Allocate a new buffer. + size_type real_cap = 0; + const pointer long_addr = this->priv_long_addr(); + const size_type long_size = this->priv_long_size(); + const size_type long_storage = this->priv_long_storage(); + //We can make this nothrow as chars are always NoThrowCopyables + AUTOBOOST_TRY{ + const std::pair ret = this->allocation_command + (allocate_new, long_size+1, long_size+1, real_cap, long_addr); + //Copy and update + Traits::copy( container_detail::to_raw_pointer(ret.first) + , container_detail::to_raw_pointer(this->priv_long_addr()) + , long_size+1); + this->priv_long_addr(ret.first); + this->priv_storage(real_cap); + //And release old buffer + this->alloc().deallocate(long_addr, long_storage); + } + AUTOBOOST_CATCH(...){ + return; + } + AUTOBOOST_CATCH_END + } + + template + void priv_shrink_to_fit_dynamic_buffer + ( AllocVersion + , typename container_detail::enable_if >::type* = 0) + { + size_type received_size; + if(this->alloc().allocation_command + ( shrink_in_place | nothrow_allocation + , this->priv_long_storage(), this->priv_long_size()+1 + , received_size, this->priv_long_addr()).first){ + this->priv_storage(received_size); + } + } + + void priv_construct_null(pointer p) + { this->construct(p, CharT(0)); } + + // Helper functions used by constructors. It is a severe error for + // any of them to be called anywhere except from within constructors. + void priv_terminate_string() + { this->priv_construct_null(this->priv_end_addr()); } + + template inline + void priv_uninitialized_fill_n(FwdIt first, Count count, const CharT val) + { + //Save initial position + FwdIt init = first; + + AUTOBOOST_TRY{ + //Construct objects + for (; count--; ++first){ + this->construct(first, val); + } + } + AUTOBOOST_CATCH(...){ + //Call destructors + for (; init != first; ++init){ + this->destroy(init); + } + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + } + + template inline + size_type priv_uninitialized_copy(InpIt first, InpIt last, FwdIt dest) + { + //Save initial destination position + FwdIt dest_init = dest; + size_type constructed = 0; + + AUTOBOOST_TRY{ + //Try to build objects + for (; first != last; ++dest, ++first, ++constructed){ + this->construct(dest, *first); + } + } + AUTOBOOST_CATCH(...){ + //Call destructors + for (; constructed--; ++dest_init){ + this->destroy(dest_init); + } + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + return (constructed); + } + + template + void priv_copy(InputIterator first, InputIterator last, OutIterator result) + { + for ( ; first != last; ++first, ++result) + Traits::assign(*result, *first); + } + + void priv_copy(const CharT* first, const CharT* last, CharT* result) + { Traits::copy(result, first, last - first); } + + template + basic_string& priv_replace_dispatch(const_iterator first, const_iterator last, + Integer n, Integer x, + container_detail::true_) + { return this->replace(first, last, (size_type) n, (CharT) x); } + + template + basic_string& priv_replace_dispatch(const_iterator first, const_iterator last, + InputIter f, InputIter l, + container_detail::false_) + { + typedef typename std::iterator_traits::iterator_category Category; + return this->priv_replace(first, last, f, l, Category()); + } + + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +}; + +#ifdef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//!Typedef for a basic_string of +//!narrow characters +typedef basic_string + + ,std::allocator > +string; + +//!Typedef for a basic_string of +//!narrow characters +typedef basic_string + + ,std::allocator > +wstring; + +#endif + +// ------------------------------------------------------------ +// Non-member functions. + +// Operator+ + +template inline + basic_string + operator+(const basic_string& x + ,const basic_string& y) +{ + typedef basic_string str_t; + typedef typename str_t::reserve_t reserve_t; + reserve_t reserve; + str_t result(reserve, x.size() + y.size(), x.get_stored_allocator()); + result.append(x); + result.append(y); + return result; +} + +template inline + basic_string operator+ + ( AUTOBOOST_RV_REF_BEG basic_string AUTOBOOST_RV_REF_END mx + , AUTOBOOST_RV_REF_BEG basic_string AUTOBOOST_RV_REF_END my) +{ + mx += my; + return autoboost::move(mx); +} + +template inline + basic_string operator+ + ( AUTOBOOST_RV_REF_BEG basic_string AUTOBOOST_RV_REF_END mx + , const basic_string& y) +{ + mx += y; + return autoboost::move(mx); +} + +template inline + basic_string operator+ + (const basic_string& x + ,AUTOBOOST_RV_REF_BEG basic_string AUTOBOOST_RV_REF_END my) +{ + my.insert(my.begin(), x.begin(), x.end()); + return autoboost::move(my); +} + +template inline + basic_string operator+ + (const CharT* s, basic_string y) +{ + y.insert(y.begin(), s, s + Traits::length(s)); + return y; +} + +template inline + basic_string operator+ + (basic_string x, const CharT* s) +{ + x += s; + return x; +} + +template inline + basic_string operator+ + (CharT c, basic_string y) +{ + y.insert(y.begin(), c); + return y; +} + +template inline + basic_string operator+ + (basic_string x, const CharT c) +{ + x += c; + return x; +} + +// Operator== and operator!= + +template +inline bool +operator==(const basic_string& x, + const basic_string& y) +{ + return x.size() == y.size() && + Traits::compare(x.data(), y.data(), x.size()) == 0; +} + +template +inline bool +operator==(const CharT* s, const basic_string& y) +{ + typename basic_string::size_type n = Traits::length(s); + return n == y.size() && Traits::compare(s, y.data(), n) == 0; +} + +template +inline bool +operator==(const basic_string& x, const CharT* s) +{ + typename basic_string::size_type n = Traits::length(s); + return x.size() == n && Traits::compare(x.data(), s, n) == 0; +} + +template +inline bool +operator!=(const basic_string& x, + const basic_string& y) + { return !(x == y); } + +template +inline bool +operator!=(const CharT* s, const basic_string& y) + { return !(s == y); } + +template +inline bool +operator!=(const basic_string& x, const CharT* s) + { return !(x == s); } + + +// Operator< (and also >, <=, and >=). + +template +inline bool +operator<(const basic_string& x, const basic_string& y) +{ + return x.compare(y) < 0; +// return basic_string +// ::s_compare(x.begin(), x.end(), y.begin(), y.end()) < 0; +} + +template +inline bool +operator<(const CharT* s, const basic_string& y) +{ + return y.compare(s) > 0; +// basic_string::size_type n = Traits::length(s); +// return basic_string +// ::s_compare(s, s + n, y.begin(), y.end()) < 0; +} + +template +inline bool +operator<(const basic_string& x, + const CharT* s) +{ + return x.compare(s) < 0; +// basic_string::size_type n = Traits::length(s); +// return basic_string +// ::s_compare(x.begin(), x.end(), s, s + n) < 0; +} + +template +inline bool +operator>(const basic_string& x, + const basic_string& y) { + return y < x; +} + +template +inline bool +operator>(const CharT* s, const basic_string& y) { + return y < s; +} + +template +inline bool +operator>(const basic_string& x, const CharT* s) +{ + return s < x; +} + +template +inline bool +operator<=(const basic_string& x, + const basic_string& y) +{ + return !(y < x); +} + +template +inline bool +operator<=(const CharT* s, const basic_string& y) + { return !(y < s); } + +template +inline bool +operator<=(const basic_string& x, const CharT* s) + { return !(s < x); } + +template +inline bool +operator>=(const basic_string& x, + const basic_string& y) + { return !(x < y); } + +template +inline bool +operator>=(const CharT* s, const basic_string& y) + { return !(s < y); } + +template +inline bool +operator>=(const basic_string& x, const CharT* s) + { return !(x < s); } + +// Swap. +template +inline void swap(basic_string& x, basic_string& y) +{ x.swap(y); } + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +// I/O. +namespace container_detail { + +template +inline bool +string_fill(std::basic_ostream& os, + std::basic_streambuf* buf, + std::size_t n) +{ + CharT f = os.fill(); + std::size_t i; + bool ok = true; + + for (i = 0; i < n; i++) + ok = ok && !Traits::eq_int_type(buf->sputc(f), Traits::eof()); + return ok; +} + +} //namespace container_detail { +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +template +std::basic_ostream& +operator<<(std::basic_ostream& os, const basic_string& s) +{ + typename std::basic_ostream::sentry sentry(os); + bool ok = false; + + if (sentry) { + ok = true; + typename basic_string::size_type n = s.size(); + typename basic_string::size_type pad_len = 0; + const bool left = (os.flags() & std::ios::left) != 0; + const std::size_t w = os.width(0); + std::basic_streambuf* buf = os.rdbuf(); + + if (w != 0 && n < w) + pad_len = w - n; + + if (!left) + ok = container_detail::string_fill(os, buf, pad_len); + + ok = ok && + buf->sputn(s.data(), std::streamsize(n)) == std::streamsize(n); + + if (left) + ok = ok && container_detail::string_fill(os, buf, pad_len); + } + + if (!ok) + os.setstate(std::ios_base::failbit); + + return os; +} + + +template +std::basic_istream& +operator>>(std::basic_istream& is, basic_string& s) +{ + typename std::basic_istream::sentry sentry(is); + + if (sentry) { + std::basic_streambuf* buf = is.rdbuf(); + const std::ctype& ctype = std::use_facet >(is.getloc()); + + s.clear(); + std::size_t n = is.width(0); + if (n == 0) + n = static_cast(-1); + else + s.reserve(n); + + while (n-- > 0) { + typename Traits::int_type c1 = buf->sbumpc(); + + if (Traits::eq_int_type(c1, Traits::eof())) { + is.setstate(std::ios_base::eofbit); + break; + } + else { + CharT c = Traits::to_char_type(c1); + + if (ctype.is(std::ctype::space, c)) { + if (Traits::eq_int_type(buf->sputbackc(c), Traits::eof())) + is.setstate(std::ios_base::failbit); + break; + } + else + s.push_back(c); + } + } + + // If we have read no characters, then set failbit. + if (s.size() == 0) + is.setstate(std::ios_base::failbit); + } + else + is.setstate(std::ios_base::failbit); + + return is; +} + +template +std::basic_istream& +getline(std::istream& is, basic_string& s,CharT delim) +{ + typename basic_string::size_type nread = 0; + typename std::basic_istream::sentry sentry(is, true); + if (sentry) { + std::basic_streambuf* buf = is.rdbuf(); + s.clear(); + + while (nread < s.max_size()) { + int c1 = buf->sbumpc(); + if (Traits::eq_int_type(c1, Traits::eof())) { + is.setstate(std::ios_base::eofbit); + break; + } + else { + ++nread; + CharT c = Traits::to_char_type(c1); + if (!Traits::eq(c, delim)) + s.push_back(c); + else + break; // Character is extracted but not appended. + } + } + } + if (nread == 0 || nread >= s.max_size()) + is.setstate(std::ios_base::failbit); + + return is; +} + +template +inline std::basic_istream& +getline(std::basic_istream& is, basic_string& s) +{ + return getline(is, s, '\n'); +} + +template +inline std::size_t hash_value(basic_string, Allocator> const& v) +{ + return hash_range(v.begin(), v.end()); +} + +}} + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +namespace autoboost { + +template +struct has_trivial_destructor_after_move; + +//!has_trivial_destructor_after_move<> == true_type +//!specialization for optimizations +template +struct has_trivial_destructor_after_move > + : public ::autoboost::has_trivial_destructor_after_move +{}; + +} + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +#include + +#endif // AUTOBOOST_CONTAINER_STRING_HPP diff --git a/contrib/autoboost/autoboost/container/throw_exception.hpp b/contrib/autoboost/autoboost/container/throw_exception.hpp new file mode 100644 index 000000000..c4fd33b5f --- /dev/null +++ b/contrib/autoboost/autoboost/container/throw_exception.hpp @@ -0,0 +1,166 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2012-2013. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_THROW_EXCEPTION_HPP +#define AUTOBOOST_CONTAINER_THROW_EXCEPTION_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#ifndef AUTOBOOST_NO_EXCEPTIONS + #include //for std exception types + #include //for std::bad_alloc +#else + #include + #include //for std::abort +#endif + +namespace autoboost { +namespace container { + +#if defined(AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS) + //The user must provide definitions for the following functions + + void throw_bad_alloc(); + + void throw_out_of_range(const char* str); + + void throw_length_error(const char* str); + + void throw_logic_error(const char* str); + + void throw_runtime_error(const char* str); + +#elif defined(AUTOBOOST_NO_EXCEPTIONS) + + inline void throw_bad_alloc() + { + AUTOBOOST_ASSERT(!"autoboost::container bad_alloc thrown"); + std::abort(); + } + + inline void throw_out_of_range(const char* str) + { + AUTOBOOST_ASSERT_MSG(!"autoboost::container out_of_range thrown", str); + std::abort(); + } + + inline void throw_length_error(const char* str) + { + AUTOBOOST_ASSERT_MSG(!"autoboost::container length_error thrown", str); + std::abort(); + } + + inline void throw_logic_error(const char* str) + { + AUTOBOOST_ASSERT_MSG(!"autoboost::container logic_error thrown", str); + std::abort(); + } + + inline void throw_runtime_error(const char* str) + { + AUTOBOOST_ASSERT_MSG(!"autoboost::container runtime_error thrown", str); + std::abort(); + } + +#else //defined(AUTOBOOST_NO_EXCEPTIONS) + + //! Exception callback called by Boost.Container when fails to allocate the requested storage space. + //!
    + //!
  • If AUTOBOOST_NO_EXCEPTIONS is NOT defined std::bad_alloc() is thrown.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS is defined and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS + //! is NOT defined AUTOBOOST_ASSERT(!"autoboost::container bad_alloc thrown") is called + //! and std::abort() if the former returns.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS are defined + //! the user must provide an implementation and the function should not return.
  • + //!
+ inline void throw_bad_alloc() + { + throw std::bad_alloc(); + } + + //! Exception callback called by Boost.Container to signal arguments out of range. + //!
    + //!
  • If AUTOBOOST_NO_EXCEPTIONS is NOT defined std::out_of_range(str) is thrown.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS is defined and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS + //! is NOT defined AUTOBOOST_ASSERT_MSG(!"autoboost::container out_of_range thrown", str) is called + //! and std::abort() if the former returns.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS are defined + //! the user must provide an implementation and the function should not return.
  • + //!
+ inline void throw_out_of_range(const char* str) + { + throw std::out_of_range(str); + } + + //! Exception callback called by Boost.Container to signal errors resizing. + //!
    + //!
  • If AUTOBOOST_NO_EXCEPTIONS is NOT defined std::length_error(str) is thrown.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS is defined and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS + //! is NOT defined AUTOBOOST_ASSERT_MSG(!"autoboost::container length_error thrown", str) is called + //! and std::abort() if the former returns.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS are defined + //! the user must provide an implementation and the function should not return.
  • + //!
+ inline void throw_length_error(const char* str) + { + throw std::length_error(str); + } + + //! Exception callback called by Boost.Container to report errors in the internal logical + //! of the program, such as violation of logical preconditions or class invariants. + //!
    + //!
  • If AUTOBOOST_NO_EXCEPTIONS is NOT defined std::logic_error(str) is thrown.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS is defined and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS + //! is NOT defined AUTOBOOST_ASSERT_MSG(!"autoboost::container logic_error thrown", str) is called + //! and std::abort() if the former returns.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS are defined + //! the user must provide an implementation and the function should not return.
  • + //!
+ inline void throw_logic_error(const char* str) + { + throw std::logic_error(str); + } + + //! Exception callback called by Boost.Container to report errors that can only be detected during runtime. + //!
    + //!
  • If AUTOBOOST_NO_EXCEPTIONS is NOT defined std::runtime_error(str) is thrown.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS is defined and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS + //! is NOT defined AUTOBOOST_ASSERT_MSG(!"autoboost::container runtime_error thrown", str) is called + //! and std::abort() if the former returns.
  • + //! + //!
  • If AUTOBOOST_NO_EXCEPTIONS and AUTOBOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS are defined + //! the user must provide an implementation and the function should not return.
  • + //!
+ inline void throw_runtime_error(const char* str) + { + throw std::runtime_error(str); + } + +#endif + +}} //namespace autoboost { namespace container { + +#include + +#endif //#ifndef AUTOBOOST_CONTAINER_THROW_EXCEPTION_HPP diff --git a/contrib/autoboost/autoboost/container/vector.hpp b/contrib/autoboost/autoboost/container/vector.hpp new file mode 100644 index 000000000..e4fad2229 --- /dev/null +++ b/contrib/autoboost/autoboost/container/vector.hpp @@ -0,0 +1,2984 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2014. 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/libs/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONTAINER_CONTAINER_VECTOR_HPP +#define AUTOBOOST_CONTAINER_CONTAINER_VECTOR_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include + +//#include //Already included by container_fwd.hpp +#include //for std::allocator +#include //for std::random_access_iterator_tag +#include //for std::pair,std::distance +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) +#include //for std::initializer_list +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace container { + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//#define AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +namespace container_detail { + +#ifndef AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +template +class vec_iterator +{ + public: + typedef std::random_access_iterator_tag iterator_category; + typedef typename autoboost::intrusive::pointer_traits::element_type value_type; + typedef typename autoboost::intrusive::pointer_traits::difference_type difference_type; + typedef typename if_c + < IsConst + , typename autoboost::intrusive::pointer_traits::template + rebind_pointer::type + , Pointer + >::type pointer; + typedef typename autoboost::intrusive::pointer_traits ptr_traits; + typedef typename ptr_traits::reference reference; + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + Pointer m_ptr; + + public: + const Pointer &get_ptr() const AUTOBOOST_CONTAINER_NOEXCEPT + { return m_ptr; } + + Pointer &get_ptr() AUTOBOOST_CONTAINER_NOEXCEPT + { return m_ptr; } + + explicit vec_iterator(Pointer ptr) AUTOBOOST_CONTAINER_NOEXCEPT + : m_ptr(ptr) + {} + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + public: + + //Constructors + vec_iterator() AUTOBOOST_CONTAINER_NOEXCEPT + : m_ptr() //Value initialization to achieve "null iterators" (N3644) + {} + + vec_iterator(vec_iterator const& other) AUTOBOOST_CONTAINER_NOEXCEPT + : m_ptr(other.get_ptr()) + {} + + //Pointer like operators + reference operator*() const AUTOBOOST_CONTAINER_NOEXCEPT + { return *m_ptr; } + + pointer operator->() const AUTOBOOST_CONTAINER_NOEXCEPT + { return ::autoboost::intrusive::pointer_traits::pointer_to(this->operator*()); } + + reference operator[](difference_type off) const AUTOBOOST_CONTAINER_NOEXCEPT + { return m_ptr[off]; } + + //Increment / Decrement + vec_iterator& operator++() AUTOBOOST_CONTAINER_NOEXCEPT + { ++m_ptr; return *this; } + + vec_iterator operator++(int) AUTOBOOST_CONTAINER_NOEXCEPT + { return vec_iterator(m_ptr++); } + + vec_iterator& operator--() AUTOBOOST_CONTAINER_NOEXCEPT + { --m_ptr; return *this; } + + vec_iterator operator--(int) AUTOBOOST_CONTAINER_NOEXCEPT + { return vec_iterator(m_ptr--); } + + //Arithmetic + vec_iterator& operator+=(difference_type off) AUTOBOOST_CONTAINER_NOEXCEPT + { m_ptr += off; return *this; } + + vec_iterator& operator-=(difference_type off) AUTOBOOST_CONTAINER_NOEXCEPT + { m_ptr -= off; return *this; } + + friend vec_iterator operator+(const vec_iterator &x, difference_type off) AUTOBOOST_CONTAINER_NOEXCEPT + { return vec_iterator(x.m_ptr+off); } + + friend vec_iterator operator+(difference_type off, vec_iterator right) AUTOBOOST_CONTAINER_NOEXCEPT + { right.m_ptr += off; return right; } + + friend vec_iterator operator-(vec_iterator left, difference_type off) AUTOBOOST_CONTAINER_NOEXCEPT + { left.m_ptr -= off; return left; } + + friend difference_type operator-(const vec_iterator &left, const vec_iterator& right) AUTOBOOST_CONTAINER_NOEXCEPT + { return left.m_ptr - right.m_ptr; } + + //Comparison operators + friend bool operator== (const vec_iterator& l, const vec_iterator& r) AUTOBOOST_CONTAINER_NOEXCEPT + { return l.m_ptr == r.m_ptr; } + + friend bool operator!= (const vec_iterator& l, const vec_iterator& r) AUTOBOOST_CONTAINER_NOEXCEPT + { return l.m_ptr != r.m_ptr; } + + friend bool operator< (const vec_iterator& l, const vec_iterator& r) AUTOBOOST_CONTAINER_NOEXCEPT + { return l.m_ptr < r.m_ptr; } + + friend bool operator<= (const vec_iterator& l, const vec_iterator& r) AUTOBOOST_CONTAINER_NOEXCEPT + { return l.m_ptr <= r.m_ptr; } + + friend bool operator> (const vec_iterator& l, const vec_iterator& r) AUTOBOOST_CONTAINER_NOEXCEPT + { return l.m_ptr > r.m_ptr; } + + friend bool operator>= (const vec_iterator& l, const vec_iterator& r) AUTOBOOST_CONTAINER_NOEXCEPT + { return l.m_ptr >= r.m_ptr; } +}; + +} //namespace container_detail { + +template +const Pointer &vector_iterator_get_ptr(const container_detail::vec_iterator &it) AUTOBOOST_CONTAINER_NOEXCEPT +{ return it.get_ptr(); } + +template +Pointer &get_ptr(container_detail::vec_iterator &it) AUTOBOOST_CONTAINER_NOEXCEPT +{ return it.get_ptr(); } + +namespace container_detail { + +#else //ifndef AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +template< class MaybeConstPointer + , bool ElementTypeIsConst + = is_const< typename autoboost::intrusive::pointer_traits::element_type>::value > +struct vector_get_ptr_pointer_to_non_const +{ + typedef MaybeConstPointer const_pointer; + typedef autoboost::intrusive::pointer_traits pointer_traits_t; + typedef typename pointer_traits_t::element_type element_type; + typedef typename remove_const::type non_const_element_type; + typedef typename pointer_traits_t + ::template rebind_pointer::type return_type; + + static return_type get_ptr(const const_pointer &ptr) AUTOBOOST_CONTAINER_NOEXCEPT + { return autoboost::intrusive::pointer_traits::const_cast_from(ptr); } +}; + +template +struct vector_get_ptr_pointer_to_non_const +{ + typedef const Pointer & return_type; + static return_type get_ptr(const Pointer &ptr) AUTOBOOST_CONTAINER_NOEXCEPT + { return ptr; } +}; + +} //namespace container_detail { + +template +typename container_detail::vector_get_ptr_pointer_to_non_const::return_type + vector_iterator_get_ptr(const MaybeConstPointer &ptr) AUTOBOOST_CONTAINER_NOEXCEPT +{ + return container_detail::vector_get_ptr_pointer_to_non_const::get_ptr(ptr); +} + +namespace container_detail { + +#endif //#ifndef AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +struct uninitialized_size_t {}; +static const uninitialized_size_t uninitialized_size = uninitialized_size_t(); + +template +struct vector_value_traits_base +{ + static const bool trivial_dctr = autoboost::has_trivial_destructor::value; + static const bool trivial_dctr_after_move = ::autoboost::has_trivial_destructor_after_move::value; + static const bool trivial_copy = has_trivial_copy::value; + static const bool nothrow_copy = has_nothrow_copy::value || trivial_copy; + static const bool trivial_assign = has_trivial_assign::value; + static const bool nothrow_assign = has_nothrow_assign::value || trivial_assign; +}; + + +template +struct vector_value_traits + : public vector_value_traits_base +{ + typedef vector_value_traits_base base_t; + //This is the anti-exception array destructor + //to deallocate values already constructed + typedef typename container_detail::if_c + + ,container_detail::scoped_destructor_n + >::type ArrayDestructor; + //This is the anti-exception array deallocator + typedef container_detail::scoped_array_deallocator ArrayDeallocator; +}; + +//!This struct deallocates and allocated memory +template < class Allocator + , class AllocatorVersion = typename container_detail::version::type + > +struct vector_alloc_holder + : public Allocator +{ + private: + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(vector_alloc_holder) + + public: + typedef autoboost::container::allocator_traits allocator_traits_type; + typedef typename allocator_traits_type::pointer pointer; + typedef typename allocator_traits_type::size_type size_type; + typedef typename allocator_traits_type::value_type value_type; + + //Constructor, does not throw + vector_alloc_holder() + AUTOBOOST_CONTAINER_NOEXCEPT_IF(::autoboost::has_nothrow_default_constructor::value) + : Allocator(), m_start(), m_size(), m_capacity() + {} + + //Constructor, does not throw + template + explicit vector_alloc_holder(AUTOBOOST_FWD_REF(AllocConvertible) a) AUTOBOOST_CONTAINER_NOEXCEPT + : Allocator(autoboost::forward(a)), m_start(), m_size(), m_capacity() + {} + + //Constructor, does not throw + template + vector_alloc_holder(uninitialized_size_t, AUTOBOOST_FWD_REF(AllocConvertible) a, size_type initial_size) + : Allocator(autoboost::forward(a)) + , m_start() + , m_size(initial_size) //Size is initialized here so vector should only call uninitialized_xxx after this + , m_capacity() + { + if(initial_size){ + m_start = this->allocation_command(allocate_new, initial_size, initial_size, m_capacity, m_start).first; + } + } + + //Constructor, does not throw + vector_alloc_holder(uninitialized_size_t, size_type initial_size) + : Allocator() + , m_start() + , m_size(initial_size) //Size is initialized here so vector should only call uninitialized_xxx after this + , m_capacity() + { + if(initial_size){ + m_start = this->allocation_command + (allocate_new, initial_size, initial_size, m_capacity, m_start).first; + } + } + + vector_alloc_holder(AUTOBOOST_RV_REF(vector_alloc_holder) holder) AUTOBOOST_CONTAINER_NOEXCEPT + : Allocator(autoboost::move(static_cast(holder))) + , m_start(holder.m_start) + , m_size(holder.m_size) + , m_capacity(holder.m_capacity) + { + holder.m_start = pointer(); + holder.m_size = holder.m_capacity = 0; + } + + void first_allocation(size_type cap) + { + if(cap){ + m_start = this->allocation_command + (allocate_new, cap, cap, m_capacity, m_start).first; + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_alloc; + #endif + } + } + + void first_allocation_same_allocator_type(size_type cap) + { this->first_allocation(cap); } + + ~vector_alloc_holder() AUTOBOOST_CONTAINER_NOEXCEPT + { + if(this->m_capacity){ + this->alloc().deallocate(this->m_start, this->m_capacity); + } + } + + std::pair + allocation_command(autoboost::container::allocation_type command, + size_type limit_size, + size_type preferred_size, + size_type &received_size, const pointer &reuse = pointer()) + { + return allocator_version_traits::allocation_command + (this->alloc(), command, limit_size, preferred_size, received_size, reuse); + } + + size_type next_capacity(size_type additional_objects) const + { + return next_capacity_calculator + ::get( allocator_traits_type::max_size(this->alloc()) + , this->m_capacity, additional_objects ); + } + + pointer m_start; + size_type m_size; + size_type m_capacity; + + void swap(vector_alloc_holder &x) AUTOBOOST_CONTAINER_NOEXCEPT + { + autoboost::container::swap_dispatch(this->m_start, x.m_start); + autoboost::container::swap_dispatch(this->m_size, x.m_size); + autoboost::container::swap_dispatch(this->m_capacity, x.m_capacity); + } + + void move_from_empty(vector_alloc_holder &x) AUTOBOOST_CONTAINER_NOEXCEPT + { + //this->m_size was previously initialized + this->m_start = x.m_start; + this->m_capacity = x.m_capacity; + x.m_start = pointer(); + x.m_size = x.m_capacity = 0; + } + + Allocator &alloc() AUTOBOOST_CONTAINER_NOEXCEPT + { return *this; } + + const Allocator &alloc() const AUTOBOOST_CONTAINER_NOEXCEPT + { return *this; } + + const pointer &start() const AUTOBOOST_CONTAINER_NOEXCEPT { return m_start; } + const size_type &capacity() const AUTOBOOST_CONTAINER_NOEXCEPT { return m_capacity; } + void start(const pointer &p) AUTOBOOST_CONTAINER_NOEXCEPT { m_start = p; } + void capacity(const size_type &c) AUTOBOOST_CONTAINER_NOEXCEPT { m_capacity = c; } +}; + +//!This struct deallocates and allocated memory +template +struct vector_alloc_holder > + : public Allocator +{ + private: + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(vector_alloc_holder) + + public: + typedef autoboost::container::allocator_traits allocator_traits_type; + typedef typename allocator_traits_type::pointer pointer; + typedef typename allocator_traits_type::size_type size_type; + typedef typename allocator_traits_type::value_type value_type; + + template + friend struct vector_alloc_holder; + + //Constructor, does not throw + vector_alloc_holder() + AUTOBOOST_CONTAINER_NOEXCEPT_IF(::autoboost::has_nothrow_default_constructor::value) + : Allocator(), m_size() + {} + + //Constructor, does not throw + template + explicit vector_alloc_holder(AUTOBOOST_FWD_REF(AllocConvertible) a) AUTOBOOST_CONTAINER_NOEXCEPT + : Allocator(autoboost::forward(a)), m_size() + {} + + //Constructor, does not throw + template + vector_alloc_holder(uninitialized_size_t, AUTOBOOST_FWD_REF(AllocConvertible) a, size_type initial_size) + : Allocator(autoboost::forward(a)) + , m_size(initial_size) //Size is initialized here... + { + //... and capacity here, so vector, must call uninitialized_xxx in the derived constructor + this->first_allocation(initial_size); + } + + //Constructor, does not throw + vector_alloc_holder(uninitialized_size_t, size_type initial_size) + : Allocator() + , m_size(initial_size) //Size is initialized here... + { + //... and capacity here, so vector, must call uninitialized_xxx in the derived constructor + this->first_allocation(initial_size); + } + + vector_alloc_holder(AUTOBOOST_RV_REF(vector_alloc_holder) holder) + : Allocator(autoboost::move(static_cast(holder))) + , m_size(holder.m_size) //Size is initialized here so vector should only call uninitialized_xxx after this + { + ::autoboost::container::uninitialized_move_alloc_n + (this->alloc(), container_detail::to_raw_pointer(holder.start()), m_size, container_detail::to_raw_pointer(this->start())); + } + + template + vector_alloc_holder(AUTOBOOST_RV_REF_BEG vector_alloc_holder AUTOBOOST_RV_REF_END holder) + : Allocator() + , m_size(holder.m_size) //Initialize it to m_size as first_allocation can only succeed or abort + { + //Different allocator type so we must check we have enough storage + const size_type n = holder.m_size; + this->first_allocation(n); + ::autoboost::container::uninitialized_move_alloc_n + (this->alloc(), container_detail::to_raw_pointer(holder.start()), n, container_detail::to_raw_pointer(this->start())); + } + + void first_allocation(size_type cap) + { + if(cap > Allocator::internal_capacity){ + throw_bad_alloc(); + } + } + + void first_allocation_same_allocator_type(size_type) AUTOBOOST_CONTAINER_NOEXCEPT + {} + + //Destructor + ~vector_alloc_holder() AUTOBOOST_CONTAINER_NOEXCEPT + {} + + void swap(vector_alloc_holder &x) + { + this->priv_swap_members_impl(x); + } + + template + void swap(vector_alloc_holder &x) + { + if(this->m_size > OtherAllocator::internal_capacity || x.m_size > Allocator::internal_capacity){ + throw_bad_alloc(); + } + this->priv_swap_members_impl(x); + } + + void move_from_empty(vector_alloc_holder &) + { //Containers with version 0 allocators can't be moved without move elements one by one + throw_bad_alloc(); + } + + Allocator &alloc() AUTOBOOST_CONTAINER_NOEXCEPT + { return *this; } + + const Allocator &alloc() const AUTOBOOST_CONTAINER_NOEXCEPT + { return *this; } + + pointer start() const AUTOBOOST_CONTAINER_NOEXCEPT { return Allocator::internal_storage(); } + size_type capacity() const AUTOBOOST_CONTAINER_NOEXCEPT { return Allocator::internal_capacity; } + size_type m_size; + + private: + + template + void priv_swap_members_impl(vector_alloc_holder &x) + { + const std::size_t MaxTmpStorage = sizeof(value_type)*Allocator::internal_capacity; + value_type *const first_this = container_detail::to_raw_pointer(this->start()); + value_type *const first_x = container_detail::to_raw_pointer(x.start()); + + if(this->m_size < x.m_size){ + autoboost::container::deep_swap_alloc_n(this->alloc(), first_this, this->m_size, first_x, x.m_size); + } + else{ + autoboost::container::deep_swap_alloc_n(this->alloc(), first_x, x.m_size, first_this, this->m_size); + } + autoboost::container::swap_dispatch(this->m_size, x.m_size); + } +}; + +} //namespace container_detail { + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +//! A vector is a sequence that supports random access to elements, constant +//! time insertion and removal of elements at the end, and linear time insertion +//! and removal of elements at the beginning or in the middle. The number of +//! elements in a vector may vary dynamically; memory management is automatic. +//! +//! \tparam T The type of object that is stored in the vector +//! \tparam Allocator The allocator used for all internal memory management +template ) > +class vector +{ + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + typedef typename container_detail::version::type alloc_version; + autoboost::container::container_detail::vector_alloc_holder + m_holder; + typedef allocator_traits allocator_traits_type; + template + friend class vector; + + typedef typename ::autoboost::container::allocator_traits + ::pointer pointer_impl; + typedef container_detail::vec_iterator iterator_impl; + typedef container_detail::vec_iterator const_iterator_impl; + + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + public: + ////////////////////////////////////////////// + // + // types + // + ////////////////////////////////////////////// + + typedef T value_type; + typedef typename ::autoboost::container::allocator_traits::pointer pointer; + typedef typename ::autoboost::container::allocator_traits::const_pointer const_pointer; + typedef typename ::autoboost::container::allocator_traits::reference reference; + typedef typename ::autoboost::container::allocator_traits::const_reference const_reference; + typedef typename ::autoboost::container::allocator_traits::size_type size_type; + typedef typename ::autoboost::container::allocator_traits::difference_type difference_type; + typedef Allocator allocator_type; + typedef Allocator stored_allocator_type; + #if defined AUTOBOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + typedef AUTOBOOST_CONTAINER_IMPDEF(pointer) iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(const_pointer) const_iterator; + #else + typedef AUTOBOOST_CONTAINER_IMPDEF(iterator_impl) iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(const_iterator_impl) const_iterator; + #endif + typedef AUTOBOOST_CONTAINER_IMPDEF(container_detail::reverse_iterator) reverse_iterator; + typedef AUTOBOOST_CONTAINER_IMPDEF(container_detail::reverse_iterator) const_reverse_iterator; + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + private: + AUTOBOOST_COPYABLE_AND_MOVABLE(vector) + typedef container_detail::vector_value_traits value_traits; + + typedef container_detail::integral_constant allocator_v0; + typedef container_detail::integral_constant allocator_v1; + typedef container_detail::integral_constant allocator_v2; + + typedef constant_iterator cvalue_iterator; + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + public: + ////////////////////////////////////////////// + // + // construct/copy/destroy + // + ////////////////////////////////////////////// + + //! Effects: Constructs a vector taking the allocator as parameter. + //! + //! Throws: If allocator_type's default constructor throws. + //! + //! Complexity: Constant. + vector() + AUTOBOOST_CONTAINER_NOEXCEPT_IF(::autoboost::has_nothrow_default_constructor::value) + : m_holder() + {} + + //! Effects: Constructs a vector taking the allocator as parameter. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + explicit vector(const Allocator& a) AUTOBOOST_CONTAINER_NOEXCEPT + : m_holder(a) + {} + + //! Effects: Constructs a vector that will use a copy of allocator a + //! and inserts n value initialized values. + //! + //! Throws: If allocator_type's default constructor or allocation + //! throws or T's value initialization throws. + //! + //! Complexity: Linear to n. + explicit vector(size_type n) + : m_holder(container_detail::uninitialized_size, n) + { + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += n != 0; + #endif + autoboost::container::uninitialized_value_init_alloc_n + (this->m_holder.alloc(), n, container_detail::to_raw_pointer(this->m_holder.start())); + } + + //! Effects: Constructs a vector that will use a copy of allocator a + //! and inserts n default initialized values. + //! + //! Throws: If allocator_type's default constructor or allocation + //! throws or T's default initialization throws. + //! + //! Complexity: Linear to n. + //! + //! Note: Non-standard extension + vector(size_type n, default_init_t) + : m_holder(container_detail::uninitialized_size, n) + { + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += n != 0; + #endif + autoboost::container::uninitialized_default_init_alloc_n + (this->m_holder.alloc(), n, container_detail::to_raw_pointer(this->m_holder.start())); + } + + //! Effects: Constructs a vector + //! and inserts n copies of value. + //! + //! Throws: If allocator_type's default constructor or allocation + //! throws or T's copy constructor throws. + //! + //! Complexity: Linear to n. + vector(size_type n, const T& value) + : m_holder(container_detail::uninitialized_size, n) + { + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += n != 0; + #endif + autoboost::container::uninitialized_fill_alloc_n + (this->m_holder.alloc(), value, n, container_detail::to_raw_pointer(this->m_holder.start())); + } + + //! Effects: Constructs a vector that will use a copy of allocator a + //! and inserts n copies of value. + //! + //! Throws: If allocation + //! throws or T's copy constructor throws. + //! + //! Complexity: Linear to n. + vector(size_type n, const T& value, const allocator_type& a) + : m_holder(container_detail::uninitialized_size, a, n) + { + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += n != 0; + #endif + autoboost::container::uninitialized_fill_alloc_n + (this->m_holder.alloc(), value, n, container_detail::to_raw_pointer(this->m_holder.start())); + } + + //! Effects: Constructs a vector + //! and inserts a copy of the range [first, last) in the vector. + //! + //! Throws: If allocator_type's default constructor or allocation + //! throws or T's constructor taking a dereferenced InIt throws. + //! + //! Complexity: Linear to the range [first, last). + template + vector(InIt first, InIt last) + : m_holder() + { this->insert(this->cend(), first, last); } + + //! Effects: Constructs a vector that will use a copy of allocator a + //! and inserts a copy of the range [first, last) in the vector. + //! + //! Throws: If allocator_type's default constructor or allocation + //! throws or T's constructor taking a dereferenced InIt throws. + //! + //! Complexity: Linear to the range [first, last). + template + vector(InIt first, InIt last, const allocator_type& a) + : m_holder(a) + { this->insert(this->cend(), first, last); } + + //! Effects: Copy constructs a vector. + //! + //! Postcondition: x == *this. + //! + //! Throws: If allocator_type's default constructor or allocation + //! throws or T's copy constructor throws. + //! + //! Complexity: Linear to the elements x contains. + vector(const vector &x) + : m_holder( container_detail::uninitialized_size + , allocator_traits_type::select_on_container_copy_construction(x.m_holder.alloc()) + , x.size()) + { + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += x.size() != 0; + #endif + ::autoboost::container::uninitialized_copy_alloc_n + ( this->m_holder.alloc(), container_detail::to_raw_pointer(x.m_holder.start()) + , x.size(), container_detail::to_raw_pointer(this->m_holder.start())); + } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Constructs a vector that will use a copy of allocator a + //! and inserts a copy of the range [il.begin(), il.last()) in the vector + //! + //! Throws: If allocator_type's default constructor + //! throws or T's constructor taking a dereferenced initializer_list iterator throws. + //! + //! Complexity: Linear to the range [il.begin(), il.end()). + vector(std::initializer_list il, const allocator_type& a = allocator_type()) + : m_holder(a) + { + insert(cend(), il.begin(), il.end()); + } +#endif + + + //! Effects: Move constructor. Moves x's resources to *this. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + vector(AUTOBOOST_RV_REF(vector) x) AUTOBOOST_CONTAINER_NOEXCEPT + : m_holder(autoboost::move(x.m_holder)) + {} + + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: Move constructor. Moves x's resources to *this. + //! + //! Throws: If T's move constructor or allocation throws + //! + //! Complexity: Linear. + //! + //! Note: Non-standard extension to support static_vector + template + vector(AUTOBOOST_RV_REF_BEG vector AUTOBOOST_RV_REF_END x + , typename container_detail::enable_if_c + < container_detail::is_version::value>::type * = 0 + ) + : m_holder(autoboost::move(x.m_holder)) + {} + + #endif //!defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: Copy constructs a vector using the specified allocator. + //! + //! Postcondition: x == *this. + //! + //! Throws: If allocation + //! throws or T's copy constructor throws. + //! + //! Complexity: Linear to the elements x contains. + vector(const vector &x, const allocator_type &a) + : m_holder(container_detail::uninitialized_size, a, x.size()) + { + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += x.size() != 0; + #endif + ::autoboost::container::uninitialized_copy_alloc_n_source + ( this->m_holder.alloc(), container_detail::to_raw_pointer(x.m_holder.start()) + , x.size(), container_detail::to_raw_pointer(this->m_holder.start())); + } + + //! Effects: Move constructor using the specified allocator. + //! Moves x's resources to *this if a == allocator_type(). + //! Otherwise copies values from x to *this. + //! + //! Throws: If allocation or T's copy constructor throws. + //! + //! Complexity: Constant if a == x.get_allocator(), linear otherwise. + vector(AUTOBOOST_RV_REF(vector) x, const allocator_type &a) + : m_holder(container_detail::uninitialized_size, a, x.size()) + { + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += x.size() != 0; + #endif + if(x.m_holder.alloc() == a){ + this->m_holder.move_from_empty(x.m_holder); + } + else{ + const size_type n = x.size(); + this->m_holder.first_allocation_same_allocator_type(n); + ::autoboost::container::uninitialized_move_alloc_n_source + ( this->m_holder.alloc(), container_detail::to_raw_pointer(x.m_holder.start()) + , n, container_detail::to_raw_pointer(this->m_holder.start())); + } + } + + //! Effects: Destroys the vector. All stored values are destroyed + //! and used memory is deallocated. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the number of elements. + ~vector() AUTOBOOST_CONTAINER_NOEXCEPT + { + autoboost::container::destroy_alloc_n + (this->get_stored_allocator(), container_detail::to_raw_pointer(this->m_holder.start()), this->m_holder.m_size); + //vector_alloc_holder deallocates the data + } + + //! Effects: Makes *this contain the same elements as x. + //! + //! Postcondition: this->size() == x.size(). *this contains a copy + //! of each of x's elements. + //! + //! Throws: If memory allocation throws or T's copy/move constructor/assignment throws. + //! + //! Complexity: Linear to the number of elements in x. + vector& operator=(AUTOBOOST_COPY_ASSIGN_REF(vector) x) + { + if (&x != this){ + this->priv_copy_assign(x); + } + return *this; + } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Make *this container contains elements from il. + //! + //! Complexity: Linear to the range [il.begin(), il.end()). + vector& operator=(std::initializer_list il) + { + assign(il.begin(), il.end()); + return *this; + } +#endif + + //! Effects: Move assignment. All x's values are transferred to *this. + //! + //! Postcondition: x.empty(). *this contains a the elements x had + //! before the function. + //! + //! Throws: If allocator_traits_type::propagate_on_container_move_assignment + //! is false and (allocation throws or value_type's move constructor throws) + //! + //! Complexity: Constant if allocator_traits_type:: + //! propagate_on_container_move_assignment is true or + //! this->get>allocator() == x.get_allocator(). Linear otherwise. + vector& operator=(AUTOBOOST_RV_REF(vector) x) + AUTOBOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value) + { + this->priv_move_assign(autoboost::move(x)); + return *this; + } + + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + + //! Effects: Move assignment. All x's values are transferred to *this. + //! + //! Postcondition: x.empty(). *this contains a the elements x had + //! before the function. + //! + //! Throws: If move constructor/assignment of T throws or allocation throws + //! + //! Complexity: Linear. + //! + //! Note: Non-standard extension to support static_vector + template + typename container_detail::enable_if_c + < container_detail::is_version::value && + !container_detail::is_same::value + , vector& >::type + operator=(AUTOBOOST_RV_REF_BEG vector AUTOBOOST_RV_REF_END x) + { + this->priv_move_assign(autoboost::move(x)); + return *this; + } + + //! Effects: Copy assignment. All x's values are copied to *this. + //! + //! Postcondition: x.empty(). *this contains a the elements x had + //! before the function. + //! + //! Throws: If move constructor/assignment of T throws or allocation throws + //! + //! Complexity: Linear. + //! + //! Note: Non-standard extension to support static_vector + template + typename container_detail::enable_if_c + < container_detail::is_version::value && + !container_detail::is_same::value + , vector& >::type + operator=(const vector &x) + { + this->priv_copy_assign(x); + return *this; + } + + #endif + + //! Effects: Assigns the the range [first, last) to *this. + //! + //! Throws: If memory allocation throws or T's copy/move constructor/assignment or + //! T's constructor/assignment from dereferencing InpIt throws. + //! + //! Complexity: Linear to n. + template + void assign(InIt first, InIt last + AUTOBOOST_CONTAINER_DOCIGN(AUTOBOOST_CONTAINER_I typename container_detail::enable_if_c + < !container_detail::is_convertible::value && + ( container_detail::is_input_iterator::value || + container_detail::is_same::value ) + >::type * = 0) ) + { + //Overwrite all elements we can from [first, last) + iterator cur = this->begin(); + const iterator end_it = this->end(); + for ( ; first != last && cur != end_it; ++cur, ++first){ + *cur = *first; + } + + if (first == last){ + //There are no more elements in the sequence, erase remaining + T* const end_pos = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size; + const size_type n = static_cast(end_pos - container_detail::iterator_to_raw_pointer(cur)); + this->priv_destroy_last_n(n); + } + else{ + //There are more elements in the range, insert the remaining ones + this->insert(this->cend(), first, last); + } + } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Effects: Assigns the the range [il.begin(), il.end()) to *this. + //! + //! Throws: If memory allocation throws or + //! T's constructor from dereferencing iniializer_list iterator throws. + //! + void assign(std::initializer_list il) + { + assign(il.begin(), il.end()); + } +#endif + + //! Effects: Assigns the the range [first, last) to *this. + //! + //! Throws: If memory allocation throws or T's copy/move constructor/assignment or + //! T's constructor/assignment from dereferencing InpIt throws. + //! + //! Complexity: Linear to n. + template + void assign(FwdIt first, FwdIt last + AUTOBOOST_CONTAINER_DOCIGN(AUTOBOOST_CONTAINER_I typename container_detail::enable_if_c + < !container_detail::is_convertible::value && + ( !container_detail::is_input_iterator::value && + !container_detail::is_same::value ) + >::type * = 0) + ) + { + //For Fwd iterators the standard only requires EmplaceConstructible and assignable from *first + //so we can't do any backwards allocation + const size_type input_sz = static_cast(std::distance(first, last)); + const size_type old_capacity = this->capacity(); + if(input_sz > old_capacity){ //If input range is too big, we need to reallocate + size_type real_cap = 0; + std::pair ret = + this->m_holder.allocation_command(allocate_new|expand_fwd, input_sz, input_sz, real_cap, this->m_holder.start()); + if(!ret.second){ //New allocation, just emplace new values + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_alloc; + #endif + pointer const old_p = this->m_holder.start(); + if(old_p){ + this->priv_destroy_all(); + this->m_holder.alloc().deallocate(old_p, old_capacity); + } + this->m_holder.start(ret.first); + this->m_holder.capacity(real_cap); + this->m_holder.m_size = 0; + this->priv_uninitialized_construct_at_end(first, last); + return; + } + else{ + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_expand_fwd; + #endif + this->m_holder.capacity(real_cap); + //Forward expansion, use assignment + back deletion/construction that comes later + } + } + //Overwrite all elements we can from [first, last) + iterator cur = this->begin(); + const iterator end_it = this->end(); + for ( ; first != last && cur != end_it; ++cur, ++first){ + *cur = *first; + } + + if (first == last){ + //There are no more elements in the sequence, erase remaining + this->priv_destroy_last_n(this->size() - input_sz); + } + else{ + //Uninitialized construct at end the remaining range + this->priv_uninitialized_construct_at_end(first, last); + } + } + + //! Effects: Assigns the n copies of val to *this. + //! + //! Throws: If memory allocation throws or + //! T's copy/move constructor/assignment throws. + //! + //! Complexity: Linear to n. + void assign(size_type n, const value_type& val) + { this->assign(cvalue_iterator(val, n), cvalue_iterator()); } + + //! Effects: Returns a copy of the internal allocator. + //! + //! Throws: If allocator's copy constructor throws. + //! + //! Complexity: Constant. + allocator_type get_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.alloc(); } + + //! Effects: Returns a reference to the internal allocator. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Non-standard extension. + stored_allocator_type &get_stored_allocator() AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.alloc(); } + + //! Effects: Returns a reference to the internal allocator. + //! + //! Throws: Nothing + //! + //! Complexity: Constant. + //! + //! Note: Non-standard extension. + const stored_allocator_type &get_stored_allocator() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.alloc(); } + + ////////////////////////////////////////////// + // + // iterators + // + ////////////////////////////////////////////// + + //! Effects: Returns an iterator to the first element contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + iterator begin() AUTOBOOST_CONTAINER_NOEXCEPT + { return iterator(this->m_holder.start()); } + + //! Effects: Returns a const_iterator to the first element contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator begin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_iterator(this->m_holder.start()); } + + //! Effects: Returns an iterator to the end of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + iterator end() AUTOBOOST_CONTAINER_NOEXCEPT + { return iterator(this->m_holder.start() + this->m_holder.m_size); } + + //! Effects: Returns a const_iterator to the end of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator end() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->cend(); } + + //! Effects: Returns a reverse_iterator pointing to the beginning + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reverse_iterator rbegin() AUTOBOOST_CONTAINER_NOEXCEPT + { return reverse_iterator(this->end()); } + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator rbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->crbegin(); } + + //! Effects: Returns a reverse_iterator pointing to the end + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reverse_iterator rend() AUTOBOOST_CONTAINER_NOEXCEPT + { return reverse_iterator(this->begin()); } + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator rend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->crend(); } + + //! Effects: Returns a const_iterator to the first element contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_iterator(this->m_holder.start()); } + + //! Effects: Returns a const_iterator to the end of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_iterator cend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_iterator(this->m_holder.start() + this->m_holder.m_size); } + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crbegin() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_reverse_iterator(this->end());} + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reverse_iterator crend() const AUTOBOOST_CONTAINER_NOEXCEPT + { return const_reverse_iterator(this->begin()); } + + ////////////////////////////////////////////// + // + // capacity + // + ////////////////////////////////////////////// + + //! Effects: Returns true if the vector contains no elements. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + bool empty() const AUTOBOOST_CONTAINER_NOEXCEPT + { return !this->m_holder.m_size; } + + //! Effects: Returns the number of the elements contained in the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type size() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.m_size; } + + //! Effects: Returns the largest possible size of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type max_size() const AUTOBOOST_CONTAINER_NOEXCEPT + { return allocator_traits_type::max_size(this->m_holder.alloc()); } + + //! Effects: Inserts or erases elements at the end such that + //! the size becomes n. New elements are value initialized. + //! + //! Throws: If memory allocation throws, or T's copy/move or value initialization throws. + //! + //! Complexity: Linear to the difference between size() and new_size. + void resize(size_type new_size) + { this->priv_resize(new_size, value_init); } + + //! Effects: Inserts or erases elements at the end such that + //! the size becomes n. New elements are default initialized. + //! + //! Throws: If memory allocation throws, or T's copy/move or default initialization throws. + //! + //! Complexity: Linear to the difference between size() and new_size. + //! + //! Note: Non-standard extension + void resize(size_type new_size, default_init_t) + { this->priv_resize(new_size, default_init); } + + //! Effects: Inserts or erases elements at the end such that + //! the size becomes n. New elements are copy constructed from x. + //! + //! Throws: If memory allocation throws, or T's copy/move constructor throws. + //! + //! Complexity: Linear to the difference between size() and new_size. + void resize(size_type new_size, const T& x) + { this->priv_resize(new_size, x); } + + //! Effects: Number of elements for which memory has been allocated. + //! capacity() is always greater than or equal to size(). + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + size_type capacity() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.capacity(); } + + //! Effects: If n is less than or equal to capacity(), this call has no + //! effect. Otherwise, it is a request for allocation of additional memory. + //! If the request is successful, then capacity() is greater than or equal to + //! n; otherwise, capacity() is unchanged. In either case, size() is unchanged. + //! + //! Throws: If memory allocation allocation throws or T's copy/move constructor throws. + void reserve(size_type new_cap) + { + if (this->capacity() < new_cap){ + this->priv_reserve(new_cap, alloc_version()); + } + } + + //! Effects: Tries to deallocate the excess of memory created + //! with previous allocations. The size of the vector is unchanged + //! + //! Throws: If memory allocation throws, or T's copy/move constructor throws. + //! + //! Complexity: Linear to size(). + void shrink_to_fit() + { this->priv_shrink_to_fit(alloc_version()); } + + ////////////////////////////////////////////// + // + // element access + // + ////////////////////////////////////////////// + + //! Requires: !empty() + //! + //! Effects: Returns a reference to the first + //! element of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reference front() AUTOBOOST_CONTAINER_NOEXCEPT + { return *this->m_holder.start(); } + + //! Requires: !empty() + //! + //! Effects: Returns a const reference to the first + //! element of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reference front() const AUTOBOOST_CONTAINER_NOEXCEPT + { return *this->m_holder.start(); } + + //! Requires: !empty() + //! + //! Effects: Returns a reference to the last + //! element of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reference back() AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.start()[this->m_holder.m_size - 1]; } + + //! Requires: !empty() + //! + //! Effects: Returns a const reference to the last + //! element of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reference back() const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.start()[this->m_holder.m_size - 1]; } + + //! Requires: size() > n. + //! + //! Effects: Returns a reference to the nth element + //! from the beginning of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + reference operator[](size_type n) AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.start()[n]; } + + //! Requires: size() > n. + //! + //! Effects: Returns a const reference to the nth element + //! from the beginning of the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const_reference operator[](size_type n) const AUTOBOOST_CONTAINER_NOEXCEPT + { return this->m_holder.start()[n]; } + + //! Requires: size() > n. + //! + //! Effects: Returns a reference to the nth element + //! from the beginning of the container. + //! + //! Throws: std::range_error if n >= size() + //! + //! Complexity: Constant. + reference at(size_type n) + { this->priv_check_range(n); return this->m_holder.start()[n]; } + + //! Requires: size() > n. + //! + //! Effects: Returns a const reference to the nth element + //! from the beginning of the container. + //! + //! Throws: std::range_error if n >= size() + //! + //! Complexity: Constant. + const_reference at(size_type n) const + { this->priv_check_range(n); return this->m_holder.start()[n]; } + + ////////////////////////////////////////////// + // + // data access + // + ////////////////////////////////////////////// + + //! Returns: Allocator pointer such that [data(),data() + size()) is a valid range. + //! For a non-empty vector, data() == &front(). + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + T* data() AUTOBOOST_CONTAINER_NOEXCEPT + { return container_detail::to_raw_pointer(this->m_holder.start()); } + + //! Returns: Allocator pointer such that [data(),data() + size()) is a valid range. + //! For a non-empty vector, data() == &front(). + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + const T * data() const AUTOBOOST_CONTAINER_NOEXCEPT + { return container_detail::to_raw_pointer(this->m_holder.start()); } + + ////////////////////////////////////////////// + // + // modifiers + // + ////////////////////////////////////////////// + + #if defined(AUTOBOOST_CONTAINER_PERFECT_FORWARDING) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... in the end of the vector. + //! + //! Throws: If memory allocation throws or the in-place constructor throws or + //! T's copy/move constructor throws. + //! + //! Complexity: Amortized constant time. + template + void emplace_back(Args &&...args) + { + if (AUTOBOOST_LIKELY(this->m_holder.m_size < this->m_holder.capacity())){ + T* const back_pos = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size; + //There is more memory, just construct a new object at the end + allocator_traits_type::construct(this->m_holder.alloc(), back_pos, ::autoboost::forward(args)...); + ++this->m_holder.m_size; + } + else{ + typedef container_detail::insert_emplace_proxy type; + this->priv_forward_range_insert_no_capacity + (vector_iterator_get_ptr(this->cend()), 1, type(::autoboost::forward(args)...), alloc_version()); + } + } + + //! Requires: position must be a valid iterator of *this. + //! + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... before position + //! + //! Throws: If memory allocation throws or the in-place constructor throws or + //! T's copy/move constructor/assignment throws. + //! + //! Complexity: If position is end(), amortized constant time + //! Linear time otherwise. + template + iterator emplace(const_iterator position, Args && ...args) + { + //Just call more general insert(pos, size, value) and return iterator + typedef container_detail::insert_emplace_proxy type; + return this->priv_forward_range_insert( vector_iterator_get_ptr(position), 1 + , type(::autoboost::forward(args)...), alloc_version()); + } + + #else + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + void emplace_back(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + T* const back_pos = container_detail::to_raw_pointer \ + (this->m_holder.start()) + this->m_holder.m_size; \ + if (AUTOBOOST_LIKELY(this->m_holder.m_size < this->m_holder.capacity())){ \ + allocator_traits_type::construct (this->m_holder.alloc() \ + , back_pos AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \ + ++this->m_holder.m_size; \ + } \ + else{ \ + typedef container_detail::AUTOBOOST_PP_CAT(insert_emplace_proxy_arg, n) \ + type; \ + this->priv_forward_range_insert_no_capacity \ + ( vector_iterator_get_ptr(this->cend()), 1 \ + , type(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)), alloc_version()); \ + } \ + } \ + \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + iterator emplace(const_iterator pos \ + AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + typedef container_detail::AUTOBOOST_PP_CAT(insert_emplace_proxy_arg, n) \ + type; \ + return this->priv_forward_range_insert \ + ( container_detail::to_raw_pointer(vector_iterator_get_ptr(pos)), 1 \ + , type(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _)), alloc_version()); \ + } \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + //! Effects: Inserts a copy of x at the end of the vector. + //! + //! Throws: If memory allocation throws or + //! T's copy/move constructor throws. + //! + //! Complexity: Amortized constant time. + void push_back(const T &x); + + //! Effects: Constructs a new element in the end of the vector + //! and moves the resources of x to this new element. + //! + //! Throws: If memory allocation throws or + //! T's copy/move constructor throws. + //! + //! Complexity: Amortized constant time. + void push_back(T &&x); + #else + AUTOBOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back) + #endif + + #if defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + //! Requires: position must be a valid iterator of *this. + //! + //! Effects: Insert a copy of x before position. + //! + //! Throws: If memory allocation throws or T's copy/move constructor/assignment throws. + //! + //! Complexity: If position is end(), amortized constant time + //! Linear time otherwise. + iterator insert(const_iterator position, const T &x); + + //! Requires: position must be a valid iterator of *this. + //! + //! Effects: Insert a new element before position with x's resources. + //! + //! Throws: If memory allocation throws. + //! + //! Complexity: If position is end(), amortized constant time + //! Linear time otherwise. + iterator insert(const_iterator position, T &&x); + #else + AUTOBOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG(insert, T, iterator, priv_insert, const_iterator, const_iterator) + #endif + + //! Requires: p must be a valid iterator of *this. + //! + //! Effects: Insert n copies of x before pos. + //! + //! Returns: an iterator to the first inserted element or p if n is 0. + //! + //! Throws: If memory allocation throws or T's copy/move constructor throws. + //! + //! Complexity: Linear to n. + iterator insert(const_iterator p, size_type n, const T& x) + { + container_detail::insert_n_copies_proxy proxy(x); + return this->priv_forward_range_insert(vector_iterator_get_ptr(p), n, proxy, alloc_version()); + } + + //! Requires: p must be a valid iterator of *this. + //! + //! Effects: Insert a copy of the [first, last) range before pos. + //! + //! Returns: an iterator to the first inserted element or pos if first == last. + //! + //! Throws: If memory allocation throws, T's constructor from a + //! dereferenced InpIt throws or T's copy/move constructor/assignment throws. + //! + //! Complexity: Linear to std::distance [first, last). + template + iterator insert(const_iterator pos, InIt first, InIt last + AUTOBOOST_CONTAINER_DOCIGN(AUTOBOOST_CONTAINER_I typename container_detail::enable_if_c + < !container_detail::is_convertible::value + && container_detail::is_input_iterator::value + >::type * = 0) + ) + { + const size_type n_pos = pos - this->cbegin(); + iterator it(vector_iterator_get_ptr(pos)); + for(;first != last; ++first){ + it = this->emplace(it, *first); + ++it; + } + return iterator(this->m_holder.start() + n_pos); + } + + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + template + iterator insert(const_iterator pos, FwdIt first, FwdIt last + , typename container_detail::enable_if_c + < !container_detail::is_convertible::value + && !container_detail::is_input_iterator::value + >::type * = 0 + ) + { + container_detail::insert_range_proxy proxy(first); + return this->priv_forward_range_insert(vector_iterator_get_ptr(pos), std::distance(first, last), proxy, alloc_version()); + } + #endif + + //! Requires: p must be a valid iterator of *this. num, must + //! be equal to std::distance(first, last) + //! + //! Effects: Insert a copy of the [first, last) range before pos. + //! + //! Returns: an iterator to the first inserted element or pos if first == last. + //! + //! Throws: If memory allocation throws, T's constructor from a + //! dereferenced InpIt throws or T's copy/move constructor/assignment throws. + //! + //! Complexity: Linear to std::distance [first, last). + //! + //! Note: This function avoids a linear operation to calculate std::distance[first, last) + //! for forward and bidirectional iterators, and a one by one insertion for input iterators. This is a + //! a non-standard extension. + #if !defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + template + iterator insert(const_iterator pos, size_type num, InIt first, InIt last) + { + AUTOBOOST_ASSERT(container_detail::is_input_iterator::value || + num == static_cast(std::distance(first, last))); + (void)last; + container_detail::insert_range_proxy proxy(first); + return this->priv_forward_range_insert(vector_iterator_get_ptr(pos), num, proxy, alloc_version()); + } + #endif + +#if !defined(AUTOBOOST_NO_CXX11_HDR_INITIALIZER_LIST) + //! Requires: position must be a valid iterator of *this. + //! + //! Effects: Insert a copy of the [il.begin(), il.end()) range before position. + //! + //! Returns: an iterator to the first inserted element or position if first == last. + //! + //! Complexity: Linear to the range [il.begin(), il.end()). + iterator insert(const_iterator position, std::initializer_list il) + { + return insert(position, il.begin(), il.end()); + } +#endif + + //! Effects: Removes the last element from the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant time. + void pop_back() AUTOBOOST_CONTAINER_NOEXCEPT + { + //Destroy last element + this->priv_destroy_last(); + } + + //! Effects: Erases the element at position pos. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the elements between pos and the + //! last element. Constant if pos is the last element. + iterator erase(const_iterator position) + { + const pointer p = vector_iterator_get_ptr(position); + T *const pos_ptr = container_detail::to_raw_pointer(p); + T *const beg_ptr = container_detail::to_raw_pointer(this->m_holder.start()); + T *const new_end_ptr = ::autoboost::move(pos_ptr + 1, beg_ptr + this->m_holder.m_size, pos_ptr); + //Move elements forward and destroy last + this->priv_destroy_last(pos_ptr == new_end_ptr); + return iterator(p); + } + + //! Effects: Erases the elements pointed by [first, last). + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the distance between first and last + //! plus linear to the elements between pos and the last element. + iterator erase(const_iterator first, const_iterator last) + { + if (first != last){ + T* const old_end_ptr = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size; + T* const first_ptr = container_detail::to_raw_pointer(vector_iterator_get_ptr(first)); + T* const last_ptr = container_detail::to_raw_pointer(vector_iterator_get_ptr(last)); + T* const ptr = container_detail::to_raw_pointer(autoboost::move(last_ptr, old_end_ptr, first_ptr)); + this->priv_destroy_last_n(old_end_ptr - ptr, last_ptr == old_end_ptr); + } + return iterator(vector_iterator_get_ptr(first)); + } + + //! Effects: Swaps the contents of *this and x. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + void swap(vector& x) AUTOBOOST_CONTAINER_NOEXCEPT_IF((!container_detail::is_version::value)) + { + //Just swap internals in case of !allocator_v0. Otherwise, deep swap + this->m_holder.swap(x.m_holder); + //And now the allocator + container_detail::bool_ flag; + container_detail::swap_alloc(this->m_holder.alloc(), x.m_holder.alloc(), flag); + } + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + //! Effects: Swaps the contents of *this and x. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear + //! + //! Note: Non-standard extension to support static_vector + template + void swap(vector & x + , typename container_detail::enable_if_c + < container_detail::is_version::value && + !container_detail::is_same::value >::type * = 0 + ) + { this->m_holder.swap(x.m_holder); } + + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + + //! Effects: Erases all the elements of the vector. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the number of elements in the container. + void clear() AUTOBOOST_CONTAINER_NOEXCEPT + { this->priv_destroy_all(); } + + //! Effects: Returns true if x and y are equal + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator==(const vector& x, const vector& y) + { + if(x.size() != y.size()){ + return false; + } + else{ + const_iterator first1(x.cbegin()), first2(y.cbegin()); + const const_iterator last1(x.cend()); + for (; first1 != last1; ++first1, ++first2) { + if (!(*first1 != *first2)) { + return false; + } + } + return true; + } + } + + //! Effects: Returns true if x and y are unequal + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator!=(const vector& x, const vector& y) + { return !(x == y); } + + //! Effects: Returns true if x is less than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator<(const vector& x, const vector& y) + { + const_iterator first1(x.cbegin()), first2(y.cbegin()); + const const_iterator last1(x.cend()), last2(y.cend()); + for ( ; (first1 != last1) && (first2 != last2); ++first1, ++first2 ) { + if (*first1 < *first2) return true; + if (*first2 < *first1) return false; + } + return (first1 == last1) && (first2 != last2); + } + + //! Effects: Returns true if x is greater than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator>(const vector& x, const vector& y) + { return y < x; } + + //! Effects: Returns true if x is equal or less than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator<=(const vector& x, const vector& y) + { return !(y < x); } + + //! Effects: Returns true if x is equal or greater than y + //! + //! Complexity: Linear to the number of elements in the container. + friend bool operator>=(const vector& x, const vector& y) + { return !(x < y); } + + //! Effects: x.swap(y) + //! + //! Complexity: Constant. + friend void swap(vector& x, vector& y) + { x.swap(y); } + + #ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + //! Effects: If n is less than or equal to capacity(), this call has no + //! effect. Otherwise, it is a request for allocation of additional memory + //! (memory expansion) that will not invalidate iterators. + //! If the request is successful, then capacity() is greater than or equal to + //! n; otherwise, capacity() is unchanged. In either case, size() is unchanged. + //! + //! Throws: If memory allocation allocation throws or T's copy/move constructor throws. + //! + //! Note: Non-standard extension. + bool stable_reserve(size_type new_cap) + { + const bool room_enough = this->capacity() < new_cap; + if(!room_enough && alloc_version::value < 2){ + return false; + } + else{ + //There is not enough memory, try to expand the old one + size_type real_cap = 0; + std::pair ret = this->m_holder.allocation_command + (expand_fwd, new_cap, new_cap, real_cap, this->m_holder.start()); + //Check for forward expansion + if(ret.second){ + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_expand_fwd; + #endif + this->m_holder.capacity(real_cap); + } + return ret.second; + } + } + + //Absolutely experimental. This function might change, disappear or simply crash! + template + void insert_ordered_at(const size_type element_count, BiDirPosConstIt last_position_it, BiDirValueIt last_value_it) + { + const size_type old_size_pos = this->size(); + this->reserve(old_size_pos + element_count); + T* const begin_ptr = container_detail::to_raw_pointer(this->m_holder.start()); + size_type insertions_left = element_count; + size_type next_pos = old_size_pos; + size_type hole_size = element_count; + + //Exception rollback. If any copy throws before the hole is filled, values + //already inserted/copied at the end of the buffer will be destroyed. + typename value_traits::ArrayDestructor past_hole_values_destroyer + (begin_ptr + old_size_pos + element_count, this->m_holder.alloc(), size_type(0u)); + //Loop for each insertion backwards, first moving the elements after the insertion point, + //then inserting the element. + while(insertions_left){ + size_type pos = static_cast(*(--last_position_it)); + while(pos == size_type(-1)){ + --last_value_it; + pos = static_cast(*(--last_position_it)); + } + + AUTOBOOST_ASSERT(pos != size_type(-1) && pos <= old_size_pos); + //If needed shift the range after the insertion point and the previous insertion point. + //Function will take care if the shift crosses the size() boundary, using copy/move + //or uninitialized copy/move if necessary. + size_type new_hole_size = (pos != next_pos) + ? priv_insert_ordered_at_shift_range(pos, next_pos, this->size(), insertions_left) + : hole_size + ; + if(new_hole_size > 0){ + //The hole was reduced by priv_insert_ordered_at_shift_range so expand exception rollback range backwards + past_hole_values_destroyer.increment_size_backwards(next_pos - pos); + //Insert the new value in the hole + allocator_traits_type::construct(this->m_holder.alloc(), begin_ptr + pos + insertions_left - 1, *(--last_value_it)); + --new_hole_size; + if(new_hole_size == 0){ + //Hole was just filled, disable exception rollback and change vector size + past_hole_values_destroyer.release(); + this->m_holder.m_size += element_count; + } + else{ + //The hole was reduced by the new insertion by one + past_hole_values_destroyer.increment_size_backwards(size_type(1u)); + } + } + else{ + if(hole_size){ + //Hole was just filled by priv_insert_ordered_at_shift_range, disable exception rollback and change vector size + past_hole_values_destroyer.release(); + this->m_holder.m_size += element_count; + } + //Insert the new value in the already constructed range + begin_ptr[pos + insertions_left - 1] = *(--last_value_it); + } + --insertions_left; + hole_size = new_hole_size; + next_pos = pos; + } + } + + #if defined(AUTOBOOST_CONTAINER_PERFECT_FORWARDING) || defined(AUTOBOOST_CONTAINER_DOXYGEN_INVOKED) + //! Effects: Inserts an object of type T constructed with + //! std::forward(args)... in the end of the vector. + //! + //! Throws: If memory allocation throws or the in-place constructor throws or + //! T's copy/move constructor throws. + //! + //! Complexity: Amortized constant time. + template + bool stable_emplace_back(Args &&...args) + { + const bool room_enough = this->m_holder.m_size < this->m_holder.capacity(); + if (AUTOBOOST_LIKELY(room_enough)){ + T* const back_pos = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size; + //There is more memory, just construct a new object at the end + allocator_traits_type::construct(this->m_holder.alloc(), back_pos, ::autoboost::forward(args)...); + ++this->m_holder.m_size; + } + return room_enough; + } + + #else + + #define AUTOBOOST_PP_LOCAL_MACRO(n) \ + AUTOBOOST_PP_EXPR_IF(n, template<) AUTOBOOST_PP_ENUM_PARAMS(n, class P) AUTOBOOST_PP_EXPR_IF(n, >) \ + bool stable_emplace_back(AUTOBOOST_PP_ENUM(n, AUTOBOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { \ + const bool room_enough = this->m_holder.m_size < this->m_holder.capacity(); \ + if (AUTOBOOST_LIKELY(room_enough)){ \ + T* const back_pos = container_detail::to_raw_pointer \ + (this->m_holder.start()) + this->m_holder.m_size; \ + allocator_traits_type::construct (this->m_holder.alloc() \ + , back_pos AUTOBOOST_PP_ENUM_TRAILING(n, AUTOBOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \ + ++this->m_holder.m_size; \ + } \ + return room_enough; \ + } \ + //! + #define AUTOBOOST_PP_LOCAL_LIMITS (0, AUTOBOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) + #include AUTOBOOST_PP_LOCAL_ITERATE() + + #endif //#ifdef AUTOBOOST_CONTAINER_PERFECT_FORWARDING + + private: + + template + void priv_move_assign(AUTOBOOST_RV_REF_BEG vector AUTOBOOST_RV_REF_END x + , typename container_detail::enable_if_c + < container_detail::is_version::value >::type * = 0) + { + if(!container_detail::is_same::value && + this->capacity() < x.size()){ + throw_bad_alloc(); + } + T* const this_start = container_detail::to_raw_pointer(m_holder.start()); + T* const other_start = container_detail::to_raw_pointer(x.m_holder.start()); + const size_type this_sz = m_holder.m_size; + const size_type other_sz = static_cast(x.m_holder.m_size); + autoboost::container::move_assign_range_alloc_n(this->m_holder.alloc(), other_start, other_sz, this_start, this_sz); + this->m_holder.m_size = other_sz; + } + + template + void priv_move_assign(AUTOBOOST_RV_REF_BEG vector AUTOBOOST_RV_REF_END x + , typename container_detail::enable_if_c + < !container_detail::is_version::value && + container_detail::is_same::value>::type * = 0) + { + //for move constructor, no aliasing (&x != this) is assummed. + AUTOBOOST_ASSERT(this != &x); + allocator_type &this_alloc = this->m_holder.alloc(); + allocator_type &x_alloc = x.m_holder.alloc(); + const bool propagate_alloc = allocator_traits_type:: + propagate_on_container_move_assignment::value; + container_detail::bool_ flag; + const bool allocators_equal = this_alloc == x_alloc; (void)allocators_equal; + //Resources can be transferred if both allocators are + //going to be equal after this function (either propagated or already equal) + if(propagate_alloc || allocators_equal){ + //Destroy objects but retain memory in case x reuses it in the future + this->clear(); + //Move allocator if needed + container_detail::move_alloc(this_alloc, x_alloc, flag); + //Nothrow swap + this->m_holder.swap(x.m_holder); + } + //Else do a one by one move + else{ + this->assign( autoboost::make_move_iterator(x.begin()) + , autoboost::make_move_iterator(x.end())); + } + } + + template + void priv_copy_assign(const vector &x + , typename container_detail::enable_if_c + < container_detail::is_version::value >::type * = 0) + { + if(!container_detail::is_same::value && + this->capacity() < x.size()){ + throw_bad_alloc(); + } + T* const this_start = container_detail::to_raw_pointer(m_holder.start()); + T* const other_start = container_detail::to_raw_pointer(x.m_holder.start()); + const size_type this_sz = m_holder.m_size; + const size_type other_sz = static_cast(x.m_holder.m_size); + autoboost::container::copy_assign_range_alloc_n(this->m_holder.alloc(), other_start, other_sz, this_start, this_sz); + this->m_holder.m_size = other_sz; + } + + template + void priv_copy_assign(const vector &x + , typename container_detail::enable_if_c + < !container_detail::is_version::value && + container_detail::is_same::value >::type * = 0) + { + allocator_type &this_alloc = this->m_holder.alloc(); + const allocator_type &x_alloc = x.m_holder.alloc(); + container_detail::bool_ flag; + if(flag && this_alloc != x_alloc){ + this->clear(); + this->shrink_to_fit(); + } + container_detail::assign_alloc(this_alloc, x_alloc, flag); + this->assign( container_detail::to_raw_pointer(x.m_holder.start()) + , container_detail::to_raw_pointer(x.m_holder.start() + x.m_holder.m_size)); + } + + void priv_reserve(size_type, allocator_v0) + { throw_bad_alloc(); } + + container_detail::insert_range_proxy, T*> priv_dummy_empty_proxy() + { + return container_detail::insert_range_proxy, T*> + (::autoboost::make_move_iterator((T *)0)); + } + + void priv_reserve(size_type new_cap, allocator_v1) + { + //There is not enough memory, allocate a new buffer + pointer p = this->m_holder.allocate(new_cap); + //We will reuse insert code, so create a dummy input iterator + this->priv_forward_range_insert_new_allocation + ( container_detail::to_raw_pointer(p), new_cap + , container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size + , 0, this->priv_dummy_empty_proxy()); + } + + void priv_reserve(size_type new_cap, allocator_v2) + { + //There is not enough memory, allocate a new + //buffer or expand the old one. + bool same_buffer_start; + size_type real_cap = 0; + std::pair ret = this->m_holder.allocation_command + (allocate_new | expand_fwd | expand_bwd, new_cap, new_cap, real_cap, this->m_holder.start()); + + //Check for forward expansion + same_buffer_start = ret.second && this->m_holder.start() == ret.first; + if(same_buffer_start){ + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_expand_fwd; + #endif + this->m_holder.capacity(real_cap); + } + else{ //If there is no forward expansion, move objects, we will reuse insertion code + T * const new_mem = container_detail::to_raw_pointer(ret.first); + T * const ins_pos = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size; + if(ret.second){ //Backwards (and possibly forward) expansion + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_expand_bwd; + #endif + this->priv_forward_range_insert_expand_backwards + ( new_mem , real_cap, ins_pos, 0, this->priv_dummy_empty_proxy()); + } + else{ //New buffer + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_alloc; + #endif + this->priv_forward_range_insert_new_allocation + ( new_mem, real_cap, ins_pos, 0, this->priv_dummy_empty_proxy()); + } + } + } + + void priv_destroy_last() AUTOBOOST_CONTAINER_NOEXCEPT + { + if(!value_traits::trivial_dctr){ + value_type* const p = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size - 1; + allocator_traits_type::destroy(this->get_stored_allocator(), p); + } + --this->m_holder.m_size; + } + + void priv_destroy_last(const bool moved) AUTOBOOST_CONTAINER_NOEXCEPT + { + (void)moved; + if(!(value_traits::trivial_dctr || (value_traits::trivial_dctr_after_move && moved))){ + value_type* const p = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size - 1; + allocator_traits_type::destroy(this->get_stored_allocator(), p); + } + --this->m_holder.m_size; + } + + void priv_destroy_last_n(const size_type n) AUTOBOOST_CONTAINER_NOEXCEPT + { + AUTOBOOST_ASSERT(n <= this->m_holder.m_size); + if(!value_traits::trivial_dctr){ + T* const destroy_pos = container_detail::to_raw_pointer(this->m_holder.start()) + (this->m_holder.m_size-n); + autoboost::container::destroy_alloc_n(this->get_stored_allocator(), destroy_pos, n); + } + this->m_holder.m_size -= n; + } + + void priv_destroy_last_n(const size_type n, const bool moved) AUTOBOOST_CONTAINER_NOEXCEPT + { + AUTOBOOST_ASSERT(n <= this->m_holder.m_size); + (void)moved; + if(!(value_traits::trivial_dctr || (value_traits::trivial_dctr_after_move && moved))){ + T* const destroy_pos = container_detail::to_raw_pointer(this->m_holder.start()) + (this->m_holder.m_size-n); + autoboost::container::destroy_alloc_n(this->get_stored_allocator(), destroy_pos, n); + } + this->m_holder.m_size -= n; + } + + template + void priv_uninitialized_construct_at_end(InpIt first, InpIt last) + { + T* const old_end_pos = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size; + T* const new_end_pos = autoboost::container::uninitialized_copy_alloc(this->m_holder.alloc(), first, last, old_end_pos); + this->m_holder.m_size += new_end_pos - old_end_pos; + } + + void priv_destroy_all() AUTOBOOST_CONTAINER_NOEXCEPT + { + autoboost::container::destroy_alloc_n + (this->get_stored_allocator(), container_detail::to_raw_pointer(this->m_holder.start()), this->m_holder.m_size); + this->m_holder.m_size = 0; + } + + template + iterator priv_insert(const const_iterator &p, AUTOBOOST_FWD_REF(U) x) + { + return this->priv_forward_range_insert + ( vector_iterator_get_ptr(p), 1, container_detail::get_insert_value_proxy + (::autoboost::forward(x)), alloc_version()); + } + + container_detail::insert_copy_proxy priv_single_insert_proxy(const T &x) + { return container_detail::insert_copy_proxy (x); } + + container_detail::insert_move_proxy priv_single_insert_proxy(AUTOBOOST_RV_REF(T) x) + { return container_detail::insert_move_proxy (x); } + + template + void priv_push_back(AUTOBOOST_FWD_REF(U) u) + { + if (AUTOBOOST_LIKELY(this->m_holder.m_size < this->m_holder.capacity())){ + //There is more memory, just construct a new object at the end + allocator_traits_type::construct + ( this->m_holder.alloc() + , container_detail::to_raw_pointer(this->m_holder.start() + this->m_holder.m_size) + , ::autoboost::forward(u) ); + ++this->m_holder.m_size; + } + else{ + this->priv_forward_range_insert_no_capacity + ( vector_iterator_get_ptr(this->cend()), 1 + , this->priv_single_insert_proxy(::autoboost::forward(u)), alloc_version()); + } + } + + container_detail::insert_n_copies_proxy priv_resize_proxy(const T &x) + { return container_detail::insert_n_copies_proxy(x); } + + container_detail::insert_default_initialized_n_proxy priv_resize_proxy(default_init_t) + { return container_detail::insert_default_initialized_n_proxy(); } + + container_detail::insert_value_initialized_n_proxy priv_resize_proxy(value_init_t) + { return container_detail::insert_value_initialized_n_proxy(); } + + template + void priv_resize(size_type new_size, const U& u) + { + const size_type sz = this->size(); + if (new_size < sz){ + //Destroy last elements + this->priv_destroy_last_n(sz - new_size); + } + else{ + const size_type n = new_size - this->size(); + this->priv_forward_range_insert_at_end(n, this->priv_resize_proxy(u), alloc_version()); + } + } + + void priv_shrink_to_fit(allocator_v0) AUTOBOOST_CONTAINER_NOEXCEPT + {} + + void priv_shrink_to_fit(allocator_v1) + { + const size_type cp = this->m_holder.capacity(); + if(cp){ + const size_type sz = this->size(); + if(!sz){ + this->m_holder.alloc().deallocate(this->m_holder.m_start, cp); + this->m_holder.m_start = pointer(); + this->m_holder.m_capacity = 0; + } + else if(sz < cp){ + //Allocate a new buffer. + pointer p = this->m_holder.allocate(sz); + + //We will reuse insert code, so create a dummy input iterator + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_alloc; + #endif + this->priv_forward_range_insert_new_allocation + ( container_detail::to_raw_pointer(p), sz + , container_detail::to_raw_pointer(this->m_holder.start()) + , 0, this->priv_dummy_empty_proxy()); + } + } + } + + void priv_shrink_to_fit(allocator_v2) AUTOBOOST_CONTAINER_NOEXCEPT + { + const size_type cp = this->m_holder.capacity(); + if(cp){ + const size_type sz = this->size(); + if(!sz){ + this->m_holder.alloc().deallocate(this->m_holder.m_start, cp); + this->m_holder.m_start = pointer(); + this->m_holder.m_capacity = 0; + } + else{ + size_type received_size; + if(this->m_holder.allocation_command + ( shrink_in_place | nothrow_allocation + , cp, sz, received_size, this->m_holder.start()).first){ + this->m_holder.capacity(received_size); + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_shrink; + #endif + } + } + } + } + + template + iterator priv_forward_range_insert_no_capacity + (const pointer &pos, const size_type, const InsertionProxy , allocator_v0) + { + throw_bad_alloc(); + return iterator(pos); + } + + template + iterator priv_forward_range_insert_no_capacity + (const pointer &pos, const size_type n, const InsertionProxy insert_range_proxy, allocator_v1) + { + //Check if we have enough memory or try to expand current memory + const size_type n_pos = pos - this->m_holder.start(); + T *const raw_pos = container_detail::to_raw_pointer(pos); + + const size_type new_cap = this->m_holder.next_capacity(n); + T * new_buf = container_detail::to_raw_pointer(this->m_holder.alloc().allocate(new_cap)); + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_alloc; + #endif + this->priv_forward_range_insert_new_allocation + ( new_buf, new_cap, raw_pos, n, insert_range_proxy); + return iterator(this->m_holder.start() + n_pos); + } + + template + iterator priv_forward_range_insert_no_capacity + (const pointer &pos, const size_type n, const InsertionProxy insert_range_proxy, allocator_v2) + { + //Check if we have enough memory or try to expand current memory + T *const raw_pos = container_detail::to_raw_pointer(pos); + const size_type n_pos = raw_pos - container_detail::to_raw_pointer(this->m_holder.start()); + + size_type real_cap = 0; + //There is not enough memory, allocate a new + //buffer or expand the old one. + std::pair ret = (this->m_holder.allocation_command + (allocate_new | expand_fwd | expand_bwd, + this->m_holder.m_size + n, this->m_holder.next_capacity(n), real_cap, this->m_holder.start())); + + //Buffer reallocated + if(ret.second){ + //Forward expansion, delay insertion + if(this->m_holder.start() == ret.first){ + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_expand_fwd; + #endif + this->m_holder.capacity(real_cap); + //Expand forward + this->priv_forward_range_insert_expand_forward(raw_pos, n, insert_range_proxy); + } + //Backwards (and possibly forward) expansion + else{ + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_expand_bwd; + #endif + this->priv_forward_range_insert_expand_backwards + ( container_detail::to_raw_pointer(ret.first) + , real_cap, raw_pos, n, insert_range_proxy); + } + } + //New buffer + else{ + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + ++this->num_alloc; + #endif + this->priv_forward_range_insert_new_allocation + ( container_detail::to_raw_pointer(ret.first) + , real_cap, raw_pos, n, insert_range_proxy); + } + + return iterator(this->m_holder.start() + n_pos); + } + + template + iterator priv_forward_range_insert + (const pointer &pos, const size_type n, const InsertionProxy insert_range_proxy, allocator_v0) + { + //Check if we have enough memory or try to expand current memory + const size_type remaining = this->m_holder.capacity() - this->m_holder.m_size; + + if (n > remaining){ + //This will trigger an error + throw_bad_alloc(); + } + const size_type n_pos = pos - this->m_holder.start(); + T *const raw_pos = container_detail::to_raw_pointer(pos); + this->priv_forward_range_insert_expand_forward(raw_pos, n, insert_range_proxy); + return iterator(this->m_holder.start() + n_pos); + } + + template + iterator priv_forward_range_insert + (const pointer &pos, const size_type n, const InsertionProxy insert_range_proxy, allocator_v1) + { + //Check if we have enough memory or try to expand current memory + const size_type remaining = this->m_holder.capacity() - this->m_holder.m_size; + T *const raw_pos = container_detail::to_raw_pointer(pos); + + if (n <= remaining){ + const size_type n_pos = raw_pos - container_detail::to_raw_pointer(this->m_holder.start()); + this->priv_forward_range_insert_expand_forward(raw_pos, n, insert_range_proxy); + return iterator(this->m_holder.start() + n_pos); + } + else{ + return this->priv_forward_range_insert_no_capacity(pos, n, insert_range_proxy, alloc_version()); + } + } + + template + iterator priv_forward_range_insert + (const pointer &pos, const size_type n, const InsertionProxy insert_range_proxy, allocator_v2) + { + AUTOBOOST_ASSERT(this->m_holder.capacity() >= this->m_holder.m_size); + //Check if we have enough memory or try to expand current memory + const size_type remaining = this->m_holder.capacity() - this->m_holder.m_size; + + bool same_buffer_start = n <= remaining; + if (!same_buffer_start){ + return priv_forward_range_insert_no_capacity(pos, n, insert_range_proxy, alloc_version()); + } + else{ + //Expand forward + T *const raw_pos = container_detail::to_raw_pointer(pos); + const size_type n_pos = raw_pos - container_detail::to_raw_pointer(this->m_holder.start()); + this->priv_forward_range_insert_expand_forward(raw_pos, n, insert_range_proxy); + return iterator(this->m_holder.start() + n_pos); + } + } + + template + iterator priv_forward_range_insert_at_end + (const size_type n, const InsertionProxy insert_range_proxy, allocator_v0) + { + //Check if we have enough memory or try to expand current memory + const size_type remaining = this->m_holder.capacity() - this->m_holder.m_size; + + if (n > remaining){ + //This will trigger an error + throw_bad_alloc(); + } + this->priv_forward_range_insert_at_end_expand_forward(n, insert_range_proxy); + return this->end(); + } + + template + iterator priv_forward_range_insert_at_end + (const size_type n, const InsertionProxy insert_range_proxy, allocator_v1) + { + return this->priv_forward_range_insert(vector_iterator_get_ptr(this->cend()), n, insert_range_proxy, allocator_v1()); + } + + template + iterator priv_forward_range_insert_at_end + (const size_type n, const InsertionProxy insert_range_proxy, allocator_v2) + { + return this->priv_forward_range_insert(vector_iterator_get_ptr(this->cend()), n, insert_range_proxy, allocator_v2()); + } + + //Absolutely experimental. This function might change, disappear or simply crash! + template + void priv_insert_ordered_at( size_type element_count, BiDirPosConstIt last_position_it + , bool do_skip, BiDirSkipConstIt last_skip_it, BiDirValueIt last_value_it) + { + const size_type old_size_pos = this->size(); + this->reserve(old_size_pos + element_count); + T* const begin_ptr = container_detail::to_raw_pointer(this->m_holder.start()); + size_type insertions_left = element_count; + size_type next_pos = old_size_pos; + size_type hole_size = element_count; + + //Exception rollback. If any copy throws before the hole is filled, values + //already inserted/copied at the end of the buffer will be destroyed. + typename value_traits::ArrayDestructor past_hole_values_destroyer + (begin_ptr + old_size_pos + element_count, this->m_holder.alloc(), size_type(0u)); + //Loop for each insertion backwards, first moving the elements after the insertion point, + //then inserting the element. + while(insertions_left){ + if(do_skip){ + size_type n = *(--last_skip_it); + std::advance(last_value_it, -difference_type(n)); + } + const size_type pos = static_cast(*(--last_position_it)); + AUTOBOOST_ASSERT(pos <= old_size_pos); + //If needed shift the range after the insertion point and the previous insertion point. + //Function will take care if the shift crosses the size() boundary, using copy/move + //or uninitialized copy/move if necessary. + size_type new_hole_size = (pos != next_pos) + ? priv_insert_ordered_at_shift_range(pos, next_pos, this->size(), insertions_left) + : hole_size + ; + if(new_hole_size > 0){ + //The hole was reduced by priv_insert_ordered_at_shift_range so expand exception rollback range backwards + past_hole_values_destroyer.increment_size_backwards(next_pos - pos); + //Insert the new value in the hole + allocator_traits_type::construct(this->m_holder.alloc(), begin_ptr + pos + insertions_left - 1, *(--last_value_it)); + --new_hole_size; + if(new_hole_size == 0){ + //Hole was just filled, disable exception rollback and change vector size + past_hole_values_destroyer.release(); + this->m_holder.m_size += element_count; + } + else{ + //The hole was reduced by the new insertion by one + past_hole_values_destroyer.increment_size_backwards(size_type(1u)); + } + } + else{ + if(hole_size){ + //Hole was just filled by priv_insert_ordered_at_shift_range, disable exception rollback and change vector size + past_hole_values_destroyer.release(); + this->m_holder.m_size += element_count; + } + //Insert the new value in the already constructed range + begin_ptr[pos + insertions_left - 1] = *(--last_value_it); + } + --insertions_left; + hole_size = new_hole_size; + next_pos = pos; + } + } + + //Takes the range pointed by [first_pos, last_pos) and shifts it to the right + //by 'shift_count'. 'limit_pos' marks the end of constructed elements. + // + //Precondition: first_pos <= last_pos <= limit_pos + // + //The shift operation might cross limit_pos so elements to moved beyond limit_pos + //are uninitialized_moved with an allocator. Other elements are moved. + // + //The shift operation might left uninitialized elements after limit_pos + //and the number of uninitialized elements is returned by the function. + // + //Old situation: + // first_pos last_pos old_limit + // | | | + // ____________V_______V__________________V_____________ + //| prefix | range | suffix |raw_mem ~ + //|____________|_______|__________________|_____________~ + // + //New situation in Case Allocator (hole_size == 0): + // range is moved through move assignments + // + // first_pos last_pos limit_pos + // | | | + // ____________V_______V__________________V_____________ + //| prefix' | | | range |suffix'|raw_mem ~ + //|________________+______|___^___|_______|_____________~ + // | | + // |_>_>_>_>_>^ + // + // + //New situation in Case B (hole_size > 0): + // range is moved through uninitialized moves + // + // first_pos last_pos limit_pos + // | | | + // ____________V_______V__________________V________________ + //| prefix' | | | [hole] | range | + //|_______________________________________|________|___^___| + // | | + // |_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_^ + // + //New situation in Case C (hole_size == 0): + // range is moved through move assignments and uninitialized moves + // + // first_pos last_pos limit_pos + // | | | + // ____________V_______V__________________V___ + //| prefix' | | | range | + //|___________________________________|___^___| + // | | + // |_>_>_>_>_>_>_>_>_>_>_>^ + size_type priv_insert_ordered_at_shift_range + (size_type first_pos, size_type last_pos, size_type limit_pos, size_type shift_count) + { + AUTOBOOST_ASSERT(first_pos <= last_pos); + AUTOBOOST_ASSERT(last_pos <= limit_pos); + // + T* const begin_ptr = container_detail::to_raw_pointer(this->m_holder.start()); + T* const first_ptr = begin_ptr + first_pos; + T* const last_ptr = begin_ptr + last_pos; + + size_type hole_size = 0; + //Case A: + if((last_pos + shift_count) <= limit_pos){ + //All move assigned + autoboost::move_backward(first_ptr, last_ptr, last_ptr + shift_count); + } + //Case B: + else if((first_pos + shift_count) >= limit_pos){ + //All uninitialized_moved + ::autoboost::container::uninitialized_move_alloc + (this->m_holder.alloc(), first_ptr, last_ptr, first_ptr + shift_count); + hole_size = last_pos + shift_count - limit_pos; + } + //Case C: + else{ + //Some uninitialized_moved + T* const limit_ptr = begin_ptr + limit_pos; + T* const boundary_ptr = limit_ptr - shift_count; + ::autoboost::container::uninitialized_move_alloc(this->m_holder.alloc(), boundary_ptr, last_ptr, limit_ptr); + //The rest is move assigned + autoboost::move_backward(first_ptr, boundary_ptr, limit_ptr); + } + return hole_size; + } + + private: + template + void priv_forward_range_insert_at_end_expand_forward(const size_type n, InsertionProxy insert_range_proxy) + { + T* const old_finish = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size; + insert_range_proxy.uninitialized_copy_n_and_update(this->m_holder.alloc(), old_finish, n); + this->m_holder.m_size += n; + } + + template + void priv_forward_range_insert_expand_forward(T* const pos, const size_type n, InsertionProxy insert_range_proxy) + { + //n can't be 0, because there is nothing to do in that case + if(!n) return; + //There is enough memory + T* const old_finish = container_detail::to_raw_pointer(this->m_holder.start()) + this->m_holder.m_size; + const size_type elems_after = old_finish - pos; + + if (!elems_after){ + insert_range_proxy.uninitialized_copy_n_and_update(this->m_holder.alloc(), old_finish, n); + this->m_holder.m_size += n; + } + else if (elems_after >= n){ + //New elements can be just copied. + //Move to uninitialized memory last objects + ::autoboost::container::uninitialized_move_alloc + (this->m_holder.alloc(), old_finish - n, old_finish, old_finish); + this->m_holder.m_size += n; + //Copy previous to last objects to the initialized end + autoboost::move_backward(pos, old_finish - n, old_finish); + //Insert new objects in the pos + insert_range_proxy.copy_n_and_update(this->m_holder.alloc(), pos, n); + } + else { + //The new elements don't fit in the [pos, end()) range. + + //Copy old [pos, end()) elements to the uninitialized memory (a gap is created) + ::autoboost::container::uninitialized_move_alloc(this->m_holder.alloc(), pos, old_finish, pos + n); + AUTOBOOST_TRY{ + //Copy first new elements in pos (gap is still there) + insert_range_proxy.copy_n_and_update(this->m_holder.alloc(), pos, elems_after); + //Copy to the beginning of the unallocated zone the last new elements (the gap is closed). + insert_range_proxy.uninitialized_copy_n_and_update(this->m_holder.alloc(), old_finish, n - elems_after); + this->m_holder.m_size += n; + } + AUTOBOOST_CATCH(...){ + autoboost::container::destroy_alloc_n(this->get_stored_allocator(), pos + n, elems_after); + AUTOBOOST_RETHROW + } + AUTOBOOST_CATCH_END + } + } + + template + void priv_forward_range_insert_new_allocation + (T* const new_start, size_type new_cap, T* const pos, const size_type n, InsertionProxy insert_range_proxy) + { + //n can be zero, if we want to reallocate! + T *new_finish = new_start; + T *old_finish; + //Anti-exception rollbacks + typename value_traits::ArrayDeallocator new_buffer_deallocator(new_start, this->m_holder.alloc(), new_cap); + typename value_traits::ArrayDestructor new_values_destroyer(new_start, this->m_holder.alloc(), 0u); + + //Initialize with [begin(), pos) old buffer + //the start of the new buffer + T * const old_buffer = container_detail::to_raw_pointer(this->m_holder.start()); + if(old_buffer){ + new_finish = ::autoboost::container::uninitialized_move_alloc + (this->m_holder.alloc(), container_detail::to_raw_pointer(this->m_holder.start()), pos, old_finish = new_finish); + new_values_destroyer.increment_size(new_finish - old_finish); + } + //Initialize new objects, starting from previous point + old_finish = new_finish; + insert_range_proxy.uninitialized_copy_n_and_update(this->m_holder.alloc(), old_finish, n); + new_finish += n; + new_values_destroyer.increment_size(new_finish - old_finish); + //Initialize from the rest of the old buffer, + //starting from previous point + if(old_buffer){ + new_finish = ::autoboost::container::uninitialized_move_alloc + (this->m_holder.alloc(), pos, old_buffer + this->m_holder.m_size, new_finish); + //Destroy and deallocate old elements + //If there is allocated memory, destroy and deallocate + if(!value_traits::trivial_dctr_after_move) + autoboost::container::destroy_alloc_n(this->get_stored_allocator(), old_buffer, this->m_holder.m_size); + this->m_holder.alloc().deallocate(this->m_holder.start(), this->m_holder.capacity()); + } + this->m_holder.start(new_start); + this->m_holder.m_size = new_finish - new_start; + this->m_holder.capacity(new_cap); + //All construction successful, disable rollbacks + new_values_destroyer.release(); + new_buffer_deallocator.release(); + } + + template + void priv_forward_range_insert_expand_backwards + (T* const new_start, const size_type new_capacity, + T* const pos, const size_type n, InsertionProxy insert_range_proxy) + { + //n can be zero to just expand capacity + //Backup old data + T* const old_start = container_detail::to_raw_pointer(this->m_holder.start()); + const size_type old_size = this->m_holder.m_size; + T* const old_finish = old_start + old_size; + + //We can have 8 possibilities: + const size_type elemsbefore = static_cast(pos - old_start); + const size_type s_before = static_cast(old_start - new_start); + const size_type before_plus_new = elemsbefore + n; + + //Update the vector buffer information to a safe state + this->m_holder.start(new_start); + this->m_holder.capacity(new_capacity); + this->m_holder.m_size = 0; + + //If anything goes wrong, this object will destroy + //all the old objects to fulfill previous vector state + typename value_traits::ArrayDestructor old_values_destroyer(old_start, this->m_holder.alloc(), old_size); + //Check if s_before is big enough to hold the beginning of old data + new data + if(s_before >= before_plus_new){ + //Copy first old values before pos, after that the new objects + T *const new_elem_pos = + ::autoboost::container::uninitialized_move_alloc(this->m_holder.alloc(), old_start, pos, new_start); + this->m_holder.m_size = elemsbefore; + insert_range_proxy.uninitialized_copy_n_and_update(this->m_holder.alloc(), new_elem_pos, n); + this->m_holder.m_size = before_plus_new; + const size_type new_size = old_size + n; + //Check if s_before is so big that even copying the old data + new data + //there is a gap between the new data and the old data + if(s_before >= new_size){ + //Old situation: + // _________________________________________________________ + //| raw_mem | old_begin | old_end | + //| __________________________________|___________|_________| + // + //New situation: + // _________________________________________________________ + //| old_begin | new | old_end | raw_mem | + //|___________|__________|_________|________________________| + // + //Now initialize the rest of memory with the last old values + if(before_plus_new != new_size){ //Special case to avoid operations in back insertion + ::autoboost::container::uninitialized_move_alloc + (this->m_holder.alloc(), pos, old_finish, new_start + before_plus_new); + //All new elements correctly constructed, avoid new element destruction + this->m_holder.m_size = new_size; + } + //Old values destroyed automatically with "old_values_destroyer" + //when "old_values_destroyer" goes out of scope unless the have trivial + //destructor after move. + if(value_traits::trivial_dctr_after_move) + old_values_destroyer.release(); + } + //s_before is so big that divides old_end + else{ + //Old situation: + // __________________________________________________ + //| raw_mem | old_begin | old_end | + //| ___________________________|___________|_________| + // + //New situation: + // __________________________________________________ + //| old_begin | new | old_end | raw_mem | + //|___________|__________|_________|_________________| + // + //Now initialize the rest of memory with the last old values + //All new elements correctly constructed, avoid new element destruction + const size_type raw_gap = s_before - before_plus_new; + if(!value_traits::trivial_dctr){ + //Now initialize the rest of s_before memory with the + //first of elements after new values + ::autoboost::container::uninitialized_move_alloc_n + (this->m_holder.alloc(), pos, raw_gap, new_start + before_plus_new); + //Now we have a contiguous buffer so program trailing element destruction + //and update size to the final size. + old_values_destroyer.shrink_forward(new_size-s_before); + this->m_holder.m_size = new_size; + //Now move remaining last objects in the old buffer begin + ::autoboost::move(pos + raw_gap, old_finish, old_start); + //Once moved, avoid calling the destructors if trivial after move + if(value_traits::trivial_dctr_after_move){ + old_values_destroyer.release(); + } + } + else{ //If trivial destructor, we can uninitialized copy + copy in a single uninitialized copy + ::autoboost::container::uninitialized_move_alloc_n + (this->m_holder.alloc(), pos, old_finish - pos, new_start + before_plus_new); + this->m_holder.m_size = new_size; + old_values_destroyer.release(); + } + } + } + else{ + //Check if we have to do the insertion in two phases + //since maybe s_before is not big enough and + //the buffer was expanded both sides + // + //Old situation: + // _________________________________________________ + //| raw_mem | old_begin + old_end | raw_mem | + //|_________|_____________________|_________________| + // + //New situation with do_after: + // _________________________________________________ + //| old_begin + new + old_end | raw_mem | + //|___________________________________|_____________| + // + //New without do_after: + // _________________________________________________ + //| old_begin + new + old_end | raw_mem | + //|____________________________|____________________| + // + const bool do_after = n > s_before; + + //Now we can have two situations: the raw_mem of the + //beginning divides the old_begin, or the new elements: + if (s_before <= elemsbefore) { + //The raw memory divides the old_begin group: + // + //If we need two phase construction (do_after) + //new group is divided in new = new_beg + new_end groups + //In this phase only new_beg will be inserted + // + //Old situation: + // _________________________________________________ + //| raw_mem | old_begin | old_end | raw_mem | + //|_________|___________|_________|_________________| + // + //New situation with do_after(1): + //This is not definitive situation, the second phase + //will include + // _________________________________________________ + //| old_begin | new_beg | old_end | raw_mem | + //|___________|_________|_________|_________________| + // + //New situation without do_after: + // _________________________________________________ + //| old_begin | new | old_end | raw_mem | + //|___________|_____|_________|_____________________| + // + //Copy the first part of old_begin to raw_mem + ::autoboost::container::uninitialized_move_alloc_n + (this->m_holder.alloc(), old_start, s_before, new_start); + //The buffer is all constructed until old_end, + //so program trailing destruction and assign final size + //if !do_after, s_before+n otherwise. + size_type new_1st_range; + if(do_after){ + new_1st_range = s_before; + //release destroyer and update size + old_values_destroyer.release(); + } + else{ + new_1st_range = n; + if(value_traits::trivial_dctr_after_move) + old_values_destroyer.release(); + else{ + old_values_destroyer.shrink_forward(old_size - (s_before - n)); + } + } + this->m_holder.m_size = old_size + new_1st_range; + //Now copy the second part of old_begin overwriting itself + T *const next = ::autoboost::move(old_start + s_before, pos, old_start); + //Now copy the new_beg elements + insert_range_proxy.copy_n_and_update(this->m_holder.alloc(), next, new_1st_range); + + //If there is no after work and the last old part needs to be moved to front, do it + if(!do_after && (n != s_before)){ + //Now displace old_end elements + ::autoboost::move(pos, old_finish, next + new_1st_range); + } + } + else { + //If we have to expand both sides, + //we will play if the first new values so + //calculate the upper bound of new values + + //The raw memory divides the new elements + // + //If we need two phase construction (do_after) + //new group is divided in new = new_beg + new_end groups + //In this phase only new_beg will be inserted + // + //Old situation: + // _______________________________________________________ + //| raw_mem | old_begin | old_end | raw_mem | + //|_______________|___________|_________|_________________| + // + //New situation with do_after(): + // ____________________________________________________ + //| old_begin | new_beg | old_end | raw_mem | + //|___________|_______________|_________|______________| + // + //New situation without do_after: + // ______________________________________________________ + //| old_begin | new | old_end | raw_mem | + //|___________|_____|_________|__________________________| + // + //First copy whole old_begin and part of new to raw_mem + T * const new_pos = ::autoboost::container::uninitialized_move_alloc + (this->m_holder.alloc(), old_start, pos, new_start); + this->m_holder.m_size = elemsbefore; + const size_type mid_n = s_before - elemsbefore; + insert_range_proxy.uninitialized_copy_n_and_update(this->m_holder.alloc(), new_pos, mid_n); + //The buffer is all constructed until old_end, + //release destroyer + this->m_holder.m_size = old_size + s_before; + old_values_destroyer.release(); + + if(do_after){ + //Copy new_beg part + insert_range_proxy.copy_n_and_update(this->m_holder.alloc(), old_start, elemsbefore); + } + else{ + //Copy all new elements + const size_type rest_new = n - mid_n; + insert_range_proxy.copy_n_and_update(this->m_holder.alloc(), old_start, rest_new); + T* const move_start = old_start + rest_new; + //Displace old_end + T* const move_end = ::autoboost::move(pos, old_finish, move_start); + //Destroy remaining moved elements from old_end except if they + //have trivial destructor after being moved + size_type n_destroy = s_before - n; + if(!value_traits::trivial_dctr_after_move) + autoboost::container::destroy_alloc_n(this->get_stored_allocator(), move_end, n_destroy); + this->m_holder.m_size -= n_destroy; + } + } + + //This is only executed if two phase construction is needed + if(do_after){ + //The raw memory divides the new elements + // + //Old situation: + // ______________________________________________________ + //| raw_mem | old_begin | old_end | raw_mem | + //|______________|___________|____________|______________| + // + //New situation with do_after(1): + // _______________________________________________________ + //| old_begin + new_beg | new_end |old_end | raw_mem | + //|__________________________|_________|________|_________| + // + //New situation with do_after(2): + // ______________________________________________________ + //| old_begin + new | old_end |raw | + //|_______________________________________|_________|____| + // + const size_type n_after = n - s_before; + const size_type elemsafter = old_size - elemsbefore; + + //We can have two situations: + if (elemsafter >= n_after){ + //The raw_mem from end will divide displaced old_end + // + //Old situation: + // ______________________________________________________ + //| raw_mem | old_begin | old_end | raw_mem | + //|______________|___________|____________|______________| + // + //New situation with do_after(1): + // _______________________________________________________ + //| old_begin + new_beg | new_end |old_end | raw_mem | + //|__________________________|_________|________|_________| + // + //First copy the part of old_end raw_mem + T* finish_n = old_finish - n_after; + ::autoboost::container::uninitialized_move_alloc + (this->m_holder.alloc(), finish_n, old_finish, old_finish); + this->m_holder.m_size += n_after; + //Displace the rest of old_end to the new position + autoboost::move_backward(pos, finish_n, old_finish); + //Now overwrite with new_end + //The new_end part is [first + (n - n_after), last) + insert_range_proxy.copy_n_and_update(this->m_holder.alloc(), pos, n_after); + } + else { + //The raw_mem from end will divide new_end part + // + //Old situation: + // _____________________________________________________________ + //| raw_mem | old_begin | old_end | raw_mem | + //|______________|___________|____________|_____________________| + // + //New situation with do_after(2): + // _____________________________________________________________ + //| old_begin + new_beg | new_end |old_end | raw_mem | + //|__________________________|_______________|________|_________| + // + + const size_type mid_last_dist = n_after - elemsafter; + //First initialize data in raw memory + + //Copy to the old_end part to the uninitialized zone leaving a gap. + ::autoboost::container::uninitialized_move_alloc + (this->m_holder.alloc(), pos, old_finish, old_finish + mid_last_dist); + + typename value_traits::ArrayDestructor old_end_destroyer + (old_finish + mid_last_dist, this->m_holder.alloc(), old_finish - pos); + + //Copy the first part to the already constructed old_end zone + insert_range_proxy.copy_n_and_update(this->m_holder.alloc(), pos, elemsafter); + //Copy the rest to the uninitialized zone filling the gap + insert_range_proxy.uninitialized_copy_n_and_update(this->m_holder.alloc(), old_finish, mid_last_dist); + this->m_holder.m_size += n_after; + old_end_destroyer.release(); + } + } + } + } + + void priv_check_range(size_type n) const + { + //If n is out of range, throw an out_of_range exception + if (n >= this->size()){ + throw_out_of_range("vector::at out of range"); + } + } + + #ifdef AUTOBOOST_CONTAINER_VECTOR_ALLOC_STATS + public: + unsigned int num_expand_fwd; + unsigned int num_expand_bwd; + unsigned int num_shrink; + unsigned int num_alloc; + void reset_alloc_stats() + { num_expand_fwd = num_expand_bwd = num_alloc = 0, num_shrink = 0; } + #endif + #endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED +}; + +}} + +#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +namespace autoboost { + +/* +//!has_trivial_destructor_after_move<> == true_type +//!specialization for optimizations +template +struct has_trivial_destructor_after_move > + : public ::autoboost::has_trivial_destructor_after_move +{}; +*/ +} + +//#define AUTOBOOST_CONTAINER_PUT_SWAP_OVERLOAD_IN_NAMESPACE_STD + +#ifdef AUTOBOOST_CONTAINER_PUT_SWAP_OVERLOAD_IN_NAMESPACE_STD + +namespace std { + +template +inline void swap(autoboost::container::vector& x, autoboost::container::vector& y) +{ x.swap(y); } + +} //namespace std { + +#endif + +#endif //#ifndef AUTOBOOST_CONTAINER_DOXYGEN_INVOKED + +#include + +#endif // #ifndef AUTOBOOST_CONTAINER_CONTAINER_VECTOR_HPP diff --git a/contrib/autoboost/autoboost/context/detail/config.hpp b/contrib/autoboost/autoboost/context/detail/config.hpp new file mode 100644 index 000000000..167ed4f84 --- /dev/null +++ b/contrib/autoboost/autoboost/context/detail/config.hpp @@ -0,0 +1,41 @@ + +// Copyright Oliver Kowalke 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) + +#ifndef AUTOBOOST_CONTEXT_DETAIL_CONFIG_H +#define AUTOBOOST_CONTEXT_DETAIL_CONFIG_H + +#include +#include + +#ifdef AUTOBOOST_CONTEXT_DECL +# undef AUTOBOOST_CONTEXT_DECL +#endif + +#if (defined(AUTOBOOST_ALL_DYN_LINK) || defined(AUTOBOOST_CONTEXT_DYN_LINK) ) && ! defined(AUTOBOOST_CONTEXT_STATIC_LINK) +# if defined(AUTOBOOST_CONTEXT_SOURCE) +# define AUTOBOOST_CONTEXT_DECL AUTOBOOST_SYMBOL_EXPORT +# define AUTOBOOST_CONTEXT_BUILD_DLL +# else +# define AUTOBOOST_CONTEXT_DECL AUTOBOOST_SYMBOL_IMPORT +# endif +#endif + +#if ! defined(AUTOBOOST_CONTEXT_DECL) +# define AUTOBOOST_CONTEXT_DECL +#endif + +#undef AUTOBOOST_CONTEXT_CALLDECL +#if (defined(i386) || defined(__i386__) || defined(__i386) \ + || defined(__i486__) || defined(__i586__) || defined(__i686__) \ + || defined(__X86__) || defined(_X86_) || defined(__THW_INTEL__) \ + || defined(__I86__) || defined(__INTEL__) || defined(__IA32__) \ + || defined(_M_IX86) || defined(_I86_)) && defined(AUTOBOOST_WINDOWS) +# define AUTOBOOST_CONTEXT_CALLDECL __cdecl +#else +# define AUTOBOOST_CONTEXT_CALLDECL +#endif + +#endif // AUTOBOOST_CONTEXT_DETAIL_CONFIG_H diff --git a/contrib/autoboost/autoboost/context/fcontext.hpp b/contrib/autoboost/autoboost/context/fcontext.hpp new file mode 100644 index 000000000..779a7d447 --- /dev/null +++ b/contrib/autoboost/autoboost/context/fcontext.hpp @@ -0,0 +1,45 @@ + +// Copyright Oliver Kowalke 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) + +#ifndef AUTOBOOST_CONTEXT_FCONTEXT_H +#define AUTOBOOST_CONTEXT_FCONTEXT_H + +#if defined(__PGI) +#include +#endif + +#if defined(_WIN32_WCE) +typedef int intptr_t; +#endif + +#include +#include + +#include + +#ifdef AUTOBOOST_HAS_ABI_HEADERS +# include AUTOBOOST_ABI_PREFIX +#endif + +namespace autoboost { +namespace context { + +typedef void* fcontext_t; + +extern "C" AUTOBOOST_CONTEXT_DECL +intptr_t AUTOBOOST_CONTEXT_CALLDECL jump_fcontext( fcontext_t * ofc, fcontext_t nfc, + intptr_t vp, bool preserve_fpu = true); +extern "C" AUTOBOOST_CONTEXT_DECL +fcontext_t AUTOBOOST_CONTEXT_CALLDECL make_fcontext( void * sp, std::size_t size, void (* fn)( intptr_t) ); + +}} + +#ifdef AUTOBOOST_HAS_ABI_HEADERS +# include AUTOBOOST_ABI_SUFFIX +#endif + +#endif // AUTOBOOST_CONTEXT_FCONTEXT_H + diff --git a/contrib/autoboost/autoboost/core/addressof.hpp b/contrib/autoboost/autoboost/core/addressof.hpp new file mode 100644 index 000000000..24beb4192 --- /dev/null +++ b/contrib/autoboost/autoboost/core/addressof.hpp @@ -0,0 +1,162 @@ +// Copyright (C) 2002 Brad King (brad.king@kitware.com) +// Douglas Gregor (gregod@cs.rpi.edu) +// +// Copyright (C) 2002, 2008, 2013 Peter Dimov +// +// 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) + +// For more information, see http://www.boost.org + +#ifndef AUTOBOOST_CORE_ADDRESSOF_HPP +#define AUTOBOOST_CORE_ADDRESSOF_HPP + +# include +# include +# include + +namespace autoboost +{ + +namespace detail +{ + +template struct addr_impl_ref +{ + T & v_; + + AUTOBOOST_FORCEINLINE addr_impl_ref( T & v ): v_( v ) {} + AUTOBOOST_FORCEINLINE operator T& () const { return v_; } + +private: + addr_impl_ref & operator=(const addr_impl_ref &); +}; + +template struct addressof_impl +{ + static AUTOBOOST_FORCEINLINE T * f( T & v, long ) + { + return reinterpret_cast( + &const_cast(reinterpret_cast(v))); + } + + static AUTOBOOST_FORCEINLINE T * f( T * v, int ) + { + return v; + } +}; + +#if !defined( AUTOBOOST_NO_CXX11_NULLPTR ) + +#if !defined( AUTOBOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) ) + + typedef decltype(nullptr) addr_nullptr_t; + +#else + + typedef std::nullptr_t addr_nullptr_t; + +#endif + +template<> struct addressof_impl< addr_nullptr_t > +{ + typedef addr_nullptr_t T; + + static AUTOBOOST_FORCEINLINE T * f( T & v, int ) + { + return &v; + } +}; + +template<> struct addressof_impl< addr_nullptr_t const > +{ + typedef addr_nullptr_t const T; + + static AUTOBOOST_FORCEINLINE T * f( T & v, int ) + { + return &v; + } +}; + +template<> struct addressof_impl< addr_nullptr_t volatile > +{ + typedef addr_nullptr_t volatile T; + + static AUTOBOOST_FORCEINLINE T * f( T & v, int ) + { + return &v; + } +}; + +template<> struct addressof_impl< addr_nullptr_t const volatile > +{ + typedef addr_nullptr_t const volatile T; + + static AUTOBOOST_FORCEINLINE T * f( T & v, int ) + { + return &v; + } +}; + +#endif + +} // namespace detail + +template +AUTOBOOST_FORCEINLINE +T * addressof( T & v ) +{ +#if (defined( __BORLANDC__ ) && AUTOBOOST_WORKAROUND( __BORLANDC__, AUTOBOOST_TESTED_AT( 0x610 ) ) ) || defined( __SUNPRO_CC ) + + return autoboost::detail::addressof_impl::f( v, 0 ); + +#else + + return autoboost::detail::addressof_impl::f( autoboost::detail::addr_impl_ref( v ), 0 ); + +#endif +} + +#if defined( __SUNPRO_CC ) && AUTOBOOST_WORKAROUND( __SUNPRO_CC, AUTOBOOST_TESTED_AT( 0x590 ) ) + +namespace detail +{ + +template struct addressof_addp +{ + typedef T * type; +}; + +} // namespace detail + +template< class T, std::size_t N > +AUTOBOOST_FORCEINLINE +typename detail::addressof_addp< T[N] >::type addressof( T (&t)[N] ) +{ + return &t; +} + +#endif + +// Borland doesn't like casting an array reference to a char reference +// but these overloads work around the problem. +#if defined( __BORLANDC__ ) && AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT(0x564)) +template +AUTOBOOST_FORCEINLINE +T (*addressof(T (&t)[N]))[N] +{ + return reinterpret_cast(&t); +} + +template +AUTOBOOST_FORCEINLINE +const T (*addressof(const T (&t)[N]))[N] +{ + return reinterpret_cast(&t); +} +#endif + +} // namespace autoboost + +#endif // AUTOBOOST_CORE_ADDRESSOF_HPP diff --git a/contrib/autoboost/autoboost/core/checked_delete.hpp b/contrib/autoboost/autoboost/core/checked_delete.hpp new file mode 100644 index 000000000..7d90cb65c --- /dev/null +++ b/contrib/autoboost/autoboost/core/checked_delete.hpp @@ -0,0 +1,69 @@ +#ifndef AUTOBOOST_CORE_CHECKED_DELETE_HPP +#define AUTOBOOST_CORE_CHECKED_DELETE_HPP + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// boost/checked_delete.hpp +// +// Copyright (c) 2002, 2003 Peter Dimov +// Copyright (c) 2003 Daniel Frey +// Copyright (c) 2003 Howard Hinnant +// +// 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/libs/core/doc/html/core/checked_delete.html for documentation. +// + +namespace autoboost +{ + +// verify that types are complete for increased safety + +template inline void checked_delete(T * x) +{ + // intentionally complex - simplification causes regressions + typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; + (void) sizeof(type_must_be_complete); + delete x; +} + +template inline void checked_array_delete(T * x) +{ + typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; + (void) sizeof(type_must_be_complete); + delete [] x; +} + +template struct checked_deleter +{ + typedef void result_type; + typedef T * argument_type; + + void operator()(T * x) const + { + // autoboost:: disables ADL + autoboost::checked_delete(x); + } +}; + +template struct checked_array_deleter +{ + typedef void result_type; + typedef T * argument_type; + + void operator()(T * x) const + { + autoboost::checked_array_delete(x); + } +}; + +} // namespace autoboost + +#endif // #ifndef AUTOBOOST_CORE_CHECKED_DELETE_HPP diff --git a/contrib/autoboost/autoboost/core/demangle.hpp b/contrib/autoboost/autoboost/core/demangle.hpp new file mode 100644 index 000000000..75ac3396c --- /dev/null +++ b/contrib/autoboost/autoboost/core/demangle.hpp @@ -0,0 +1,121 @@ +#ifndef AUTOBOOST_CORE_DEMANGLE_HPP_INCLUDED +#define AUTOBOOST_CORE_DEMANGLE_HPP_INCLUDED + +// core::demangle +// +// Copyright 2014 Peter Dimov +// Copyright 2014 Andrey Semashev +// +// 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 + +#include +#include + +#if defined(AUTOBOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif + +#if defined( __clang__ ) && defined( __has_include ) +# if __has_include() +# define AUTOBOOST_CORE_HAS_CXXABI_H +# endif +#elif defined( __GLIBCXX__ ) || defined( __GLIBCPP__ ) +# define AUTOBOOST_CORE_HAS_CXXABI_H +#endif + +#if defined( AUTOBOOST_CORE_HAS_CXXABI_H ) +# include +# include +# include +#endif + +namespace autoboost +{ + +namespace core +{ + +inline char const * demangle_alloc( char const * name ) AUTOBOOST_NOEXCEPT; +inline void demangle_free( char const * name ) AUTOBOOST_NOEXCEPT; + +class scoped_demangled_name +{ +private: + char const * m_p; + +public: + explicit scoped_demangled_name( char const * name ) AUTOBOOST_NOEXCEPT : + m_p( demangle_alloc( name ) ) + { + } + + ~scoped_demangled_name() AUTOBOOST_NOEXCEPT + { + demangle_free( m_p ); + } + + char const * get() const AUTOBOOST_NOEXCEPT + { + return m_p; + } + + AUTOBOOST_DELETED_FUNCTION(scoped_demangled_name( scoped_demangled_name const& )) + AUTOBOOST_DELETED_FUNCTION(scoped_demangled_name& operator= ( scoped_demangled_name const& )) +}; + + +#if defined( AUTOBOOST_CORE_HAS_CXXABI_H ) + +inline char const * demangle_alloc( char const * name ) AUTOBOOST_NOEXCEPT +{ + int status = 0; + std::size_t size = 0; + return abi::__cxa_demangle( name, NULL, &size, &status ); +} + +inline void demangle_free( char const * name ) AUTOBOOST_NOEXCEPT +{ + std::free( const_cast< char* >( name ) ); +} + +inline std::string demangle( char const * name ) +{ + scoped_demangled_name demangled_name( name ); + char const * const p = demangled_name.get(); + if( p ) + { + return p; + } + else + { + return name; + } +} + +#else + +inline char const * demangle_alloc( char const * name ) AUTOBOOST_NOEXCEPT +{ + return name; +} + +inline void demangle_free( char const * ) AUTOBOOST_NOEXCEPT +{ +} + +inline std::string demangle( char const * name ) +{ + return name; +} + +#endif + +} // namespace core + +} // namespace autoboost + +#undef AUTOBOOST_CORE_HAS_CXXABI_H + +#endif // #ifndef AUTOBOOST_CORE_DEMANGLE_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/core/enable_if.hpp b/contrib/autoboost/autoboost/core/enable_if.hpp new file mode 100644 index 000000000..21256c220 --- /dev/null +++ b/contrib/autoboost/autoboost/core/enable_if.hpp @@ -0,0 +1,119 @@ +// Boost enable_if library + +// Copyright 2003 (c) The Trustees of Indiana University. + +// Use, modification, and distribution is subject to 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) + +// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu) +// Jeremiah Willcock (jewillco at osl.iu.edu) +// Andrew Lumsdaine (lums at osl.iu.edu) + + +#ifndef AUTOBOOST_CORE_ENABLE_IF_HPP +#define AUTOBOOST_CORE_ENABLE_IF_HPP + +#include "autoboost/config.hpp" + +// Even the definition of enable_if causes problems on some compilers, +// so it's macroed out for all compilers that do not support SFINAE + +#ifndef AUTOBOOST_NO_SFINAE + +namespace autoboost +{ + + template + struct enable_if_c { + typedef T type; + }; + + template + struct enable_if_c {}; + + template + struct enable_if : public enable_if_c {}; + + template + struct lazy_enable_if_c { + typedef typename T::type type; + }; + + template + struct lazy_enable_if_c {}; + + template + struct lazy_enable_if : public lazy_enable_if_c {}; + + + template + struct disable_if_c { + typedef T type; + }; + + template + struct disable_if_c {}; + + template + struct disable_if : public disable_if_c {}; + + template + struct lazy_disable_if_c { + typedef typename T::type type; + }; + + template + struct lazy_disable_if_c {}; + + template + struct lazy_disable_if : public lazy_disable_if_c {}; + +} // namespace autoboost + +#else + +namespace autoboost { + + namespace detail { typedef void enable_if_default_T; } + + template + struct enable_if_does_not_work_on_this_compiler; + + template + struct enable_if_c : enable_if_does_not_work_on_this_compiler + { }; + + template + struct disable_if_c : enable_if_does_not_work_on_this_compiler + { }; + + template + struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler + { }; + + template + struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler + { }; + + template + struct enable_if : enable_if_does_not_work_on_this_compiler + { }; + + template + struct disable_if : enable_if_does_not_work_on_this_compiler + { }; + + template + struct lazy_enable_if : enable_if_does_not_work_on_this_compiler + { }; + + template + struct lazy_disable_if : enable_if_does_not_work_on_this_compiler + { }; + +} // namespace autoboost + +#endif // AUTOBOOST_NO_SFINAE + +#endif diff --git a/contrib/autoboost/autoboost/core/explicit_operator_bool.hpp b/contrib/autoboost/autoboost/core/explicit_operator_bool.hpp new file mode 100644 index 000000000..28698ec7e --- /dev/null +++ b/contrib/autoboost/autoboost/core/explicit_operator_bool.hpp @@ -0,0 +1,154 @@ +/* + * Copyright Andrey Semashev 2007 - 2013. + * 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) + */ + +/*! + * \file explicit_operator_bool.hpp + * \author Andrey Semashev + * \date 08.03.2009 + * + * This header defines a compatibility macro that implements an unspecified + * \c bool operator idiom, which is superseded with explicit conversion operators in + * C++11. + */ + +#ifndef AUTOBOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP +#define AUTOBOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if !defined(AUTOBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) + +/*! + * \brief The macro defines an explicit operator of conversion to \c bool + * + * The macro should be used inside the definition of a class that has to + * support the conversion. The class should also implement operator!, + * in terms of which the conversion operator will be implemented. + */ +#define AUTOBOOST_EXPLICIT_OPERATOR_BOOL()\ + AUTOBOOST_FORCEINLINE explicit operator bool () const\ + {\ + return !this->operator! ();\ + } + +/*! + * \brief The macro defines a noexcept explicit operator of conversion to \c bool + * + * The macro should be used inside the definition of a class that has to + * support the conversion. The class should also implement operator!, + * in terms of which the conversion operator will be implemented. + */ +#define AUTOBOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\ + AUTOBOOST_FORCEINLINE explicit operator bool () const AUTOBOOST_NOEXCEPT\ + {\ + return !this->operator! ();\ + } + +/*! + * \brief The macro defines a constexpr explicit operator of conversion to \c bool + * + * The macro should be used inside the definition of a class that has to + * support the conversion. The class should also implement operator!, + * in terms of which the conversion operator will be implemented. + */ +#define AUTOBOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\ + AUTOBOOST_FORCEINLINE AUTOBOOST_CONSTEXPR explicit operator bool () const AUTOBOOST_NOEXCEPT\ + {\ + return !this->operator! ();\ + } + +#else // !defined(AUTOBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) + +#if (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(AUTOBOOST_NO_COMPILER_CONFIG) +// Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it +#define AUTOBOOST_NO_UNSPECIFIED_BOOL +#endif // (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(AUTOBOOST_NO_COMPILER_CONFIG) + +#if !defined(AUTOBOOST_NO_UNSPECIFIED_BOOL) + +namespace autoboost { + +namespace detail { + +#if !defined(_MSC_VER) && !defined(__IBMCPP__) + + struct unspecified_bool + { + // NOTE TO THE USER: If you see this in error messages then you tried + // to apply an unsupported operator on the object that supports + // explicit conversion to bool. + struct OPERATORS_NOT_ALLOWED; + static void true_value(OPERATORS_NOT_ALLOWED*) {} + }; + typedef void (*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*); + +#else + + // MSVC and VACPP are too eager to convert pointer to function to void* even though they shouldn't + struct unspecified_bool + { + // NOTE TO THE USER: If you see this in error messages then you tried + // to apply an unsupported operator on the object that supports + // explicit conversion to bool. + struct OPERATORS_NOT_ALLOWED; + void true_value(OPERATORS_NOT_ALLOWED*) {} + }; + typedef void (unspecified_bool::*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*); + +#endif + +} // namespace detail + +} // namespace autoboost + +#define AUTOBOOST_EXPLICIT_OPERATOR_BOOL()\ + AUTOBOOST_FORCEINLINE operator autoboost::detail::unspecified_bool_type () const\ + {\ + return (!this->operator! () ? &autoboost::detail::unspecified_bool::true_value : (autoboost::detail::unspecified_bool_type)0);\ + } + +#define AUTOBOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\ + AUTOBOOST_FORCEINLINE operator autoboost::detail::unspecified_bool_type () const AUTOBOOST_NOEXCEPT\ + {\ + return (!this->operator! () ? &autoboost::detail::unspecified_bool::true_value : (autoboost::detail::unspecified_bool_type)0);\ + } + +#define AUTOBOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\ + AUTOBOOST_FORCEINLINE AUTOBOOST_CONSTEXPR operator autoboost::detail::unspecified_bool_type () const AUTOBOOST_NOEXCEPT\ + {\ + return (!this->operator! () ? &autoboost::detail::unspecified_bool::true_value : (autoboost::detail::unspecified_bool_type)0);\ + } + +#else // !defined(AUTOBOOST_NO_UNSPECIFIED_BOOL) + +#define AUTOBOOST_EXPLICIT_OPERATOR_BOOL()\ + AUTOBOOST_FORCEINLINE operator bool () const\ + {\ + return !this->operator! ();\ + } + +#define AUTOBOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\ + AUTOBOOST_FORCEINLINE operator bool () const AUTOBOOST_NOEXCEPT\ + {\ + return !this->operator! ();\ + } + +#define AUTOBOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\ + AUTOBOOST_FORCEINLINE AUTOBOOST_CONSTEXPR operator bool () const AUTOBOOST_NOEXCEPT\ + {\ + return !this->operator! ();\ + } + +#endif // !defined(AUTOBOOST_NO_UNSPECIFIED_BOOL) + +#endif // !defined(AUTOBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) + +#endif // AUTOBOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP diff --git a/contrib/autoboost/boost/core/ignore_unused.hpp b/contrib/autoboost/autoboost/core/ignore_unused.hpp similarity index 87% rename from contrib/autoboost/boost/core/ignore_unused.hpp rename to contrib/autoboost/autoboost/core/ignore_unused.hpp index e5da37659..891e57f70 100644 --- a/contrib/autoboost/boost/core/ignore_unused.hpp +++ b/contrib/autoboost/autoboost/core/ignore_unused.hpp @@ -4,14 +4,14 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_CORE_IGNORE_UNUSED_HPP -#define BOOST_CORE_IGNORE_UNUSED_HPP +#ifndef AUTOBOOST_CORE_IGNORE_UNUSED_HPP +#define AUTOBOOST_CORE_IGNORE_UNUSED_HPP -#include +#include namespace autoboost { -#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES +#ifndef AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES template inline void ignore_unused(Ts const& ...) @@ -67,4 +67,4 @@ inline void ignore_unused() } // namespace autoboost -#endif // BOOST_CORE_IGNORE_UNUSED_HPP +#endif // AUTOBOOST_CORE_IGNORE_UNUSED_HPP diff --git a/contrib/autoboost/autoboost/core/lightweight_test.hpp b/contrib/autoboost/autoboost/core/lightweight_test.hpp new file mode 100644 index 000000000..725493360 --- /dev/null +++ b/contrib/autoboost/autoboost/core/lightweight_test.hpp @@ -0,0 +1,171 @@ +#ifndef AUTOBOOST_CORE_LIGHTWEIGHT_TEST_HPP +#define AUTOBOOST_CORE_LIGHTWEIGHT_TEST_HPP + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) +# pragma once +#endif + +// +// boost/core/lightweight_test.hpp - lightweight test library +// +// Copyright (c) 2002, 2009, 2014 Peter Dimov +// Copyright (2) Beman Dawes 2010, 2011 +// Copyright (3) Ion Gaztanaga 2013 +// +// 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 +// + +#include +#include +#include +#include + +// IDE's like Visual Studio perform better if output goes to std::cout or +// some other stream, so allow user to configure output stream: +#ifndef AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM +# define AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM std::cerr +#endif + +namespace autoboost +{ + +namespace detail +{ + +struct report_errors_reminder +{ + bool called_report_errors_function; + + report_errors_reminder() : called_report_errors_function(false) {} + + ~report_errors_reminder() + { + AUTOBOOST_ASSERT(called_report_errors_function); // verify report_errors() was called + } +}; + +inline report_errors_reminder& report_errors_remind() +{ + static report_errors_reminder r; + return r; +} + +inline int & test_errors() +{ + static int x = 0; + report_errors_remind(); + return x; +} + +inline void test_failed_impl(char const * expr, char const * file, int line, char const * function) +{ + AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): test '" << expr << "' failed in function '" + << function << "'" << std::endl; + ++test_errors(); +} + +inline void error_impl(char const * msg, char const * file, int line, char const * function) +{ + AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): " << msg << " in function '" + << function << "'" << std::endl; + ++test_errors(); +} + +inline void throw_failed_impl(char const * excep, char const * file, int line, char const * function) +{ + AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): Exception '" << excep << "' not thrown in function '" + << function << "'" << std::endl; + ++test_errors(); +} + +template 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 ) + { + report_errors_remind(); + } + else + { + AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): test '" << expr1 << " == " << expr2 + << "' failed in function '" << function << "': " + << "'" << t << "' != '" << u << "'" << std::endl; + ++test_errors(); + } +} + +template inline void test_ne_impl( char const * expr1, char const * expr2, + char const * file, int line, char const * function, T const & t, U const & u ) +{ + if( t != u ) + { + report_errors_remind(); + } + else + { + AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): test '" << expr1 << " != " << expr2 + << "' failed in function '" << function << "': " + << "'" << t << "' == '" << u << "'" << std::endl; + ++test_errors(); + } +} + +} // namespace detail + +inline int report_errors() +{ + detail::report_errors_remind().called_report_errors_function = true; + + int errors = detail::test_errors(); + + if( errors == 0 ) + { + AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM + << "No errors detected." << std::endl; + return 0; + } + else + { + AUTOBOOST_LIGHTWEIGHT_TEST_OSTREAM + << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl; + return 1; + } +} + +} // namespace autoboost + +#define AUTOBOOST_TEST(expr) ((expr)? (void)0: ::autoboost::detail::test_failed_impl(#expr, __FILE__, __LINE__, AUTOBOOST_CURRENT_FUNCTION)) + +#define AUTOBOOST_ERROR(msg) ( ::autoboost::detail::error_impl(msg, __FILE__, __LINE__, AUTOBOOST_CURRENT_FUNCTION) ) + +#define AUTOBOOST_TEST_EQ(expr1,expr2) ( ::autoboost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, AUTOBOOST_CURRENT_FUNCTION, expr1, expr2) ) +#define AUTOBOOST_TEST_NE(expr1,expr2) ( ::autoboost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, AUTOBOOST_CURRENT_FUNCTION, expr1, expr2) ) + +#ifndef AUTOBOOST_NO_EXCEPTIONS + #define AUTOBOOST_TEST_THROWS( EXPR, EXCEP ) \ + try { \ + EXPR; \ + ::autoboost::detail::throw_failed_impl \ + (#EXCEP, __FILE__, __LINE__, AUTOBOOST_CURRENT_FUNCTION); \ + } \ + catch(EXCEP const&) { \ + } \ + catch(...) { \ + ::autoboost::detail::throw_failed_impl \ + (#EXCEP, __FILE__, __LINE__, AUTOBOOST_CURRENT_FUNCTION); \ + } \ + // +#else + #define AUTOBOOST_TEST_THROWS( EXPR, EXCEP ) +#endif + +#endif // #ifndef AUTOBOOST_CORE_LIGHTWEIGHT_TEST_HPP diff --git a/contrib/autoboost/autoboost/core/no_exceptions_support.hpp b/contrib/autoboost/autoboost/core/no_exceptions_support.hpp new file mode 100644 index 000000000..7bfd3c9cd --- /dev/null +++ b/contrib/autoboost/autoboost/core/no_exceptions_support.hpp @@ -0,0 +1,44 @@ +#ifndef AUTOBOOST_CORE_NO_EXCEPTIONS_SUPPORT_HPP +#define AUTOBOOST_CORE_NO_EXCEPTIONS_SUPPORT_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +//---------------------------------------------------------------------- +// (C) Copyright 2004 Pavel Vozenilek. +// Use, modification and distribution is subject to 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) +// +// +// This file contains helper macros used when exception support may be +// disabled (as indicated by macro AUTOBOOST_NO_EXCEPTIONS). +// +// Before picking up these macros you may consider using RAII techniques +// to deal with exceptions - their syntax can be always the same with +// or without exception support enabled. +//---------------------------------------------------------------------- + +#include +#include + +#if !(defined AUTOBOOST_NO_EXCEPTIONS) +# define AUTOBOOST_TRY { try +# define AUTOBOOST_CATCH(x) catch(x) +# define AUTOBOOST_RETHROW throw; +# define AUTOBOOST_CATCH_END } +#else +# if AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT(0x564)) +# define AUTOBOOST_TRY { if ("") +# define AUTOBOOST_CATCH(x) else if (!"") +# else +# define AUTOBOOST_TRY { if (true) +# define AUTOBOOST_CATCH(x) else if (false) +# endif +# define AUTOBOOST_RETHROW +# define AUTOBOOST_CATCH_END } +#endif + + +#endif diff --git a/contrib/autoboost/autoboost/core/noncopyable.hpp b/contrib/autoboost/autoboost/core/noncopyable.hpp new file mode 100644 index 000000000..c27a7c256 --- /dev/null +++ b/contrib/autoboost/autoboost/core/noncopyable.hpp @@ -0,0 +1,48 @@ +// Boost noncopyable.hpp header file --------------------------------------// + +// (C) Copyright Beman Dawes 1999-2003. 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/libs/utility for documentation. + +#ifndef AUTOBOOST_CORE_NONCOPYABLE_HPP +#define AUTOBOOST_CORE_NONCOPYABLE_HPP + +#include + +namespace autoboost { + +// Private copy constructor and copy assignment ensure classes derived from +// class noncopyable cannot be copied. + +// Contributed by Dave Abrahams + +namespace noncopyable_ // protection from unintended ADL +{ + class noncopyable + { + protected: +#if !defined(AUTOBOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(AUTOBOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS) + AUTOBOOST_CONSTEXPR noncopyable() = default; + ~noncopyable() = default; +#else + noncopyable() {} + ~noncopyable() {} +#endif +#if !defined(AUTOBOOST_NO_CXX11_DELETED_FUNCTIONS) + noncopyable( const noncopyable& ) = delete; + noncopyable& operator=( const noncopyable& ) = delete; +#else + private: // emphasize the following members are private + noncopyable( const noncopyable& ); + noncopyable& operator=( const noncopyable& ); +#endif + }; +} + +typedef noncopyable_::noncopyable noncopyable; + +} // namespace autoboost + +#endif // AUTOBOOST_CORE_NONCOPYABLE_HPP diff --git a/contrib/autoboost/autoboost/core/null_deleter.hpp b/contrib/autoboost/autoboost/core/null_deleter.hpp new file mode 100644 index 000000000..1444223ef --- /dev/null +++ b/contrib/autoboost/autoboost/core/null_deleter.hpp @@ -0,0 +1,44 @@ +/* + * Copyright Andrey Semashev 2007 - 2014. + * 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) + */ +/*! + * \file null_deleter.hpp + * \author Andrey Semashev + * \date 22.04.2007 + * + * This header contains a \c null_deleter implementation. This is an empty + * function object that receives a pointer and does nothing with it. + * Such empty deletion strategy may be convenient, for example, when + * constructing shared_ptrs that point to some object that should not be + * deleted (i.e. a variable on the stack or some global singleton, like std::cout). + */ + +#ifndef AUTOBOOST_CORE_NULL_DELETER_HPP +#define AUTOBOOST_CORE_NULL_DELETER_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { + +//! A function object that does nothing and can be used as an empty deleter for \c shared_ptr +struct null_deleter +{ + //! Function object result type + typedef void result_type; + /*! + * Does nothing + */ + template< typename T > + void operator() (T*) const AUTOBOOST_NOEXCEPT {} +}; + +} // namespace autoboost + +#endif // AUTOBOOST_CORE_NULL_DELETER_HPP diff --git a/contrib/autoboost/autoboost/core/ref.hpp b/contrib/autoboost/autoboost/core/ref.hpp new file mode 100644 index 000000000..56edf4a95 --- /dev/null +++ b/contrib/autoboost/autoboost/core/ref.hpp @@ -0,0 +1,301 @@ +#ifndef AUTOBOOST_CORE_REF_HPP +#define AUTOBOOST_CORE_REF_HPP + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#include +#include +#include + +// +// ref.hpp - ref/cref, useful helper functions +// +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2001, 2002 Peter Dimov +// Copyright (C) 2002 David Abrahams +// +// Copyright (C) 2014 Glen Joseph Fernandes +// glenfe at live dot com +// Copyright (C) 2014 Agustin Berge +// +// 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/libs/core/doc/html/core/ref.html for documentation. +// + +/** + @file +*/ + +/** + Boost namespace. +*/ +namespace autoboost +{ + +#if defined( AUTOBOOST_MSVC ) && AUTOBOOST_WORKAROUND( AUTOBOOST_MSVC, == 1600 ) + + struct ref_workaround_tag {}; + +#endif + +// reference_wrapper + +/** + @brief Contains a reference to an object of type `T`. + + `reference_wrapper` is primarily used to "feed" references to + function templates (algorithms) that take their parameter by + value. It provides an implicit conversion to `T&`, which + usually allows the function templates to work on references + unmodified. +*/ +template class reference_wrapper +{ +public: + /** + Type `T`. + */ + typedef T type; + + /** + Constructs a `reference_wrapper` object that stores a + reference to `t`. + + @remark Does not throw. + */ + AUTOBOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(autoboost::addressof(t)) {} + +#if defined( AUTOBOOST_MSVC ) && AUTOBOOST_WORKAROUND( AUTOBOOST_MSVC, == 1600 ) + + AUTOBOOST_FORCEINLINE explicit reference_wrapper( T & t, ref_workaround_tag ): t_( autoboost::addressof( t ) ) {} + +#endif + +#if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + /** + @remark Construction from a temporary object is disabled. + */ + AUTOBOOST_DELETED_FUNCTION(reference_wrapper(T&& t)) +public: +#endif + + /** + @return The stored reference. + @remark Does not throw. + */ + AUTOBOOST_FORCEINLINE operator T& () const { return *t_; } + + /** + @return The stored reference. + @remark Does not throw. + */ + AUTOBOOST_FORCEINLINE T& get() const { return *t_; } + + /** + @return A pointer to the object referenced by the stored + reference. + @remark Does not throw. + */ + AUTOBOOST_FORCEINLINE T* get_pointer() const { return t_; } + +private: + + T* t_; +}; + +// ref + +/** + @cond +*/ +#if defined( __BORLANDC__ ) && AUTOBOOST_WORKAROUND( __BORLANDC__, AUTOBOOST_TESTED_AT(0x581) ) +# define AUTOBOOST_REF_CONST +#else +# define AUTOBOOST_REF_CONST const +#endif +/** + @endcond +*/ + +/** + @return `reference_wrapper(t)` + @remark Does not throw. +*/ +template AUTOBOOST_FORCEINLINE reference_wrapper AUTOBOOST_REF_CONST ref( T & t ) +{ +#if defined( AUTOBOOST_MSVC ) && AUTOBOOST_WORKAROUND( AUTOBOOST_MSVC, == 1600 ) + + return reference_wrapper( t, ref_workaround_tag() ); + +#else + + return reference_wrapper( t ); + +#endif +} + +// cref + +/** + @return `reference_wrapper(t)` + @remark Does not throw. +*/ +template AUTOBOOST_FORCEINLINE reference_wrapper AUTOBOOST_REF_CONST cref( T const & t ) +{ + return reference_wrapper(t); +} + +#undef AUTOBOOST_REF_CONST + +#if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + +/** + @cond +*/ +#if defined(AUTOBOOST_NO_CXX11_DELETED_FUNCTIONS) +# define AUTOBOOST_REF_DELETE +#else +# define AUTOBOOST_REF_DELETE = delete +#endif +/** + @endcond +*/ + +/** + @remark Construction from a temporary object is disabled. +*/ +template void ref(T const&&) AUTOBOOST_REF_DELETE; + +/** + @remark Construction from a temporary object is disabled. +*/ +template void cref(T const&&) AUTOBOOST_REF_DELETE; + +#undef AUTOBOOST_REF_DELETE + +#endif + +// is_reference_wrapper + +/** + @brief Determine if a type `T` is an instantiation of + `reference_wrapper`. + + The value static constant will be true if the type `T` is a + specialization of `reference_wrapper`. +*/ +template struct is_reference_wrapper +{ + AUTOBOOST_STATIC_CONSTANT( bool, value = false ); +}; + +/** + @cond +*/ +template struct is_reference_wrapper< reference_wrapper > +{ + AUTOBOOST_STATIC_CONSTANT( bool, value = true ); +}; + +#if !defined(AUTOBOOST_NO_CV_SPECIALIZATIONS) + +template struct is_reference_wrapper< reference_wrapper const > +{ + AUTOBOOST_STATIC_CONSTANT( bool, value = true ); +}; + +template struct is_reference_wrapper< reference_wrapper volatile > +{ + AUTOBOOST_STATIC_CONSTANT( bool, value = true ); +}; + +template struct is_reference_wrapper< reference_wrapper const volatile > +{ + AUTOBOOST_STATIC_CONSTANT( bool, value = true ); +}; + +#endif // !defined(AUTOBOOST_NO_CV_SPECIALIZATIONS) + +/** + @endcond +*/ + + +// unwrap_reference + +/** + @brief Find the type in a `reference_wrapper`. + + The `typedef` type is `T::type` if `T` is a + `reference_wrapper`, `T` otherwise. +*/ +template struct unwrap_reference +{ + typedef T type; +}; + +/** + @cond +*/ +template struct unwrap_reference< reference_wrapper > +{ + typedef T type; +}; + +#if !defined(AUTOBOOST_NO_CV_SPECIALIZATIONS) + +template struct unwrap_reference< reference_wrapper const > +{ + typedef T type; +}; + +template struct unwrap_reference< reference_wrapper volatile > +{ + typedef T type; +}; + +template struct unwrap_reference< reference_wrapper const volatile > +{ + typedef T type; +}; + +#endif // !defined(AUTOBOOST_NO_CV_SPECIALIZATIONS) + +/** + @endcond +*/ + +// unwrap_ref + +/** + @return `unwrap_reference::type&(t)` + @remark Does not throw. +*/ +template AUTOBOOST_FORCEINLINE typename unwrap_reference::type& unwrap_ref( T & t ) +{ + return t; +} + +// get_pointer + +/** + @cond +*/ +template AUTOBOOST_FORCEINLINE T* get_pointer( reference_wrapper const & r ) +{ + return r.get_pointer(); +} +/** + @endcond +*/ + +} // namespace autoboost + +#endif // #ifndef AUTOBOOST_CORE_REF_HPP diff --git a/contrib/autoboost/autoboost/core/scoped_enum.hpp b/contrib/autoboost/autoboost/core/scoped_enum.hpp new file mode 100644 index 000000000..68f2d1dde --- /dev/null +++ b/contrib/autoboost/autoboost/core/scoped_enum.hpp @@ -0,0 +1,192 @@ +// scoped_enum.hpp ---------------------------------------------------------// + +// Copyright Beman Dawes, 2009 +// Copyright (C) 2011-2012 Vicente J. Botet Escriba +// Copyright (C) 2012 Anthony Williams + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef AUTOBOOST_CORE_SCOPED_ENUM_HPP +#define AUTOBOOST_CORE_SCOPED_ENUM_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ + +#ifdef AUTOBOOST_NO_CXX11_SCOPED_ENUMS + + /** + * Meta-function to get the native enum type associated to an enum class or its emulation. + */ + template + struct native_type + { + /** + * The member typedef type names the native enum type associated to the scoped enum, + * which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum. + */ + typedef typename EnumType::enum_type type; + }; + + /** + * Casts a scoped enum to its underlying type. + * + * This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type. + * @param v A scoped enum. + * @returns The underlying type. + * @throws No-throws. + */ + template + UnderlyingType underlying_cast(EnumType v) + { + return v.get_underlying_value_(); + } + + /** + * Casts a scoped enum to its native enum type. + * + * This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can. + * + * EnumType the scoped enum type + * + * @param v A scoped enum. + * @returns The native enum value. + * @throws No-throws. + */ + template + inline + typename EnumType::enum_type native_value(EnumType e) + { + return e.get_native_value_(); + } + +#else // AUTOBOOST_NO_CXX11_SCOPED_ENUMS + + template + struct native_type + { + typedef EnumType type; + }; + + template + UnderlyingType underlying_cast(EnumType v) + { + return static_cast(v); + } + + template + inline + EnumType native_value(EnumType e) + { + return e; + } + +#endif // AUTOBOOST_NO_CXX11_SCOPED_ENUMS +} + + +#ifdef AUTOBOOST_NO_CXX11_SCOPED_ENUMS + +#ifndef AUTOBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS + +#define AUTOBOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ + explicit operator underlying_type() const AUTOBOOST_NOEXCEPT { return get_underlying_value_(); } + +#else + +#define AUTOBOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR + +#endif + +/** + * Start a declaration of a scoped enum. + * + * @param EnumType The new scoped enum. + * @param UnderlyingType The underlying type. + */ +#define AUTOBOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \ + struct EnumType { \ + typedef void is_boost_scoped_enum_tag; \ + typedef UnderlyingType underlying_type; \ + EnumType() AUTOBOOST_NOEXCEPT {} \ + explicit EnumType(underlying_type v) AUTOBOOST_NOEXCEPT : v_(v) {} \ + underlying_type get_underlying_value_() const AUTOBOOST_NOEXCEPT { return v_; } \ + AUTOBOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ + private: \ + underlying_type v_; \ + typedef EnumType self_type; \ + public: \ + enum enum_type + +#define AUTOBOOST_SCOPED_ENUM_DECLARE_END2() \ + enum_type get_native_value_() const AUTOBOOST_NOEXCEPT { return enum_type(v_); } \ + friend bool operator ==(self_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \ + friend bool operator ==(self_type lhs, enum_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \ + friend bool operator ==(enum_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \ + friend bool operator !=(self_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \ + friend bool operator !=(self_type lhs, enum_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \ + friend bool operator !=(enum_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \ + friend bool operator <(self_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)(self_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \ + friend bool operator >(self_type lhs, enum_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \ + friend bool operator >(enum_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \ + friend bool operator >=(self_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \ + friend bool operator >=(self_type lhs, enum_type rhs) AUTOBOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \ + friend bool operator >=(enum_type lhs, self_type rhs) AUTOBOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \ + }; + +#define AUTOBOOST_SCOPED_ENUM_DECLARE_END(EnumType) \ + ; \ + EnumType(enum_type v) AUTOBOOST_NOEXCEPT : v_(v) {} \ + AUTOBOOST_SCOPED_ENUM_DECLARE_END2() + +/** + * Starts a declaration of a scoped enum with the default int underlying type. + * + * @param EnumType The new scoped enum. + */ +#define AUTOBOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \ + AUTOBOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int) + +/** + * Name of the native enum type. + * + * @param EnumType The new scoped enum. + */ +#define AUTOBOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type +/** + * Forward declares an scoped enum. + * + * @param EnumType The scoped enum. + */ +#define AUTOBOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType + +#else // AUTOBOOST_NO_CXX11_SCOPED_ENUMS + +#define AUTOBOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType : UnderlyingType +#define AUTOBOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType +#define AUTOBOOST_SCOPED_ENUM_DECLARE_END2() +#define AUTOBOOST_SCOPED_ENUM_DECLARE_END(EnumType) ; + +#define AUTOBOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType +#define AUTOBOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType + +#endif // AUTOBOOST_NO_CXX11_SCOPED_ENUMS + +// Deprecated macros +#define AUTOBOOST_SCOPED_ENUM_START(name) AUTOBOOST_SCOPED_ENUM_DECLARE_BEGIN(name) +#define AUTOBOOST_SCOPED_ENUM_END AUTOBOOST_SCOPED_ENUM_DECLARE_END2() +#define AUTOBOOST_SCOPED_ENUM(name) AUTOBOOST_SCOPED_ENUM_NATIVE(name) + +#endif // AUTOBOOST_CORE_SCOPED_ENUM_HPP diff --git a/contrib/autoboost/autoboost/core/swap.hpp b/contrib/autoboost/autoboost/core/swap.hpp new file mode 100644 index 000000000..78cc1ed5b --- /dev/null +++ b/contrib/autoboost/autoboost/core/swap.hpp @@ -0,0 +1,60 @@ +// Copyright (C) 2007, 2008 Steven Watanabe, Joseph Gauterin, Niels Dekker +// +// 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) +// For more information, see http://www.boost.org + + +#ifndef AUTOBOOST_CORE_SWAP_HPP +#define AUTOBOOST_CORE_SWAP_HPP + +// Note: the implementation of this utility contains various workarounds: +// - swap_impl is put outside the boost namespace, to avoid infinite +// recursion (causing stack overflow) when swapping objects of a primitive +// type. +// - swap_impl has a using-directive, rather than a using-declaration, +// because some compilers (including MSVC 7.1, Borland 5.9.3, and +// Intel 8.1) don't do argument-dependent lookup when it has a +// using-declaration instead. +// - autoboost::swap has two template arguments, instead of one, to +// avoid ambiguity when swapping objects of a Boost type that does +// not have its own autoboost::swap overload. + +#include //for std::swap (C++11) +#include //for std::swap (C++98) +#include //for std::size_t +#include + +namespace autoboost_swap_impl +{ + template + AUTOBOOST_GPU_ENABLED + void swap_impl(T& left, T& right) + { + using namespace std;//use std::swap if argument dependent lookup fails + swap(left,right); + } + + template + AUTOBOOST_GPU_ENABLED + void swap_impl(T (& left)[N], T (& right)[N]) + { + for (std::size_t i = 0; i < N; ++i) + { + ::autoboost_swap_impl::swap_impl(left[i], right[i]); + } + } +} + +namespace autoboost +{ + template + AUTOBOOST_GPU_ENABLED + void swap(T1& left, T2& right) + { + ::autoboost_swap_impl::swap_impl(left, right); + } +} + +#endif diff --git a/contrib/autoboost/boost/core/typeinfo.hpp b/contrib/autoboost/autoboost/core/typeinfo.hpp similarity index 80% rename from contrib/autoboost/boost/core/typeinfo.hpp rename to contrib/autoboost/autoboost/core/typeinfo.hpp index 8d8d6fc5b..e0878df0f 100644 --- a/contrib/autoboost/boost/core/typeinfo.hpp +++ b/contrib/autoboost/autoboost/core/typeinfo.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_CORE_TYPEINFO_HPP_INCLUDED -#define BOOST_CORE_TYPEINFO_HPP_INCLUDED +#ifndef AUTOBOOST_CORE_TYPEINFO_HPP_INCLUDED +#define AUTOBOOST_CORE_TYPEINFO_HPP_INCLUDED // MS compatible compilers support #pragma once @@ -7,7 +7,7 @@ # pragma once #endif -// core::typeinfo, BOOST_CORE_TYPEID +// core::typeinfo, AUTOBOOST_CORE_TYPEID // // Copyright 2007, 2014 Peter Dimov // @@ -15,11 +15,11 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include +#include -#if defined( BOOST_NO_TYPEID ) +#if defined( AUTOBOOST_NO_TYPEID ) -#include +#include #include namespace autoboost @@ -80,7 +80,7 @@ template struct core_typeid_ static char const * name() { - return BOOST_CURRENT_FUNCTION; + return AUTOBOOST_CURRENT_FUNCTION; } }; @@ -112,11 +112,11 @@ template struct core_typeid_< T const volatile >: core_typeid_< T > } // namespace autoboost -#define BOOST_CORE_TYPEID(T) (autoboost::detail::core_typeid_::ti_) +#define AUTOBOOST_CORE_TYPEID(T) (autoboost::detail::core_typeid_::ti_) #else -#include +#include #include namespace autoboost @@ -125,7 +125,7 @@ namespace autoboost namespace core { -#if defined( BOOST_NO_STD_TYPEINFO ) +#if defined( AUTOBOOST_NO_STD_TYPEINFO ) typedef ::type_info typeinfo; @@ -144,8 +144,8 @@ inline std::string demangled_name( core::typeinfo const & ti ) } // namespace autoboost -#define BOOST_CORE_TYPEID(T) typeid(T) +#define AUTOBOOST_CORE_TYPEID(T) typeid(T) #endif -#endif // #ifndef BOOST_CORE_TYPEINFO_HPP_INCLUDED +#endif // #ifndef AUTOBOOST_CORE_TYPEINFO_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/cregex.hpp b/contrib/autoboost/autoboost/cregex.hpp new file mode 100644 index 000000000..e812d03b4 --- /dev/null +++ b/contrib/autoboost/autoboost/cregex.hpp @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 1998-2002 + * John Maddock + * + * Use, modification and distribution are subject to 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) + * + */ + + /* + * LOCATION: see http://www.boost.org/libs/regex for most recent version. + * FILE cregex.cpp + * VERSION see + * DESCRIPTION: Declares POSIX API functions + * + autoboost::RegEx high level wrapper. + */ + +#ifndef AUTOBOOST_RE_CREGEX_HPP +#define AUTOBOOST_RE_CREGEX_HPP + +#ifndef AUTOBOOST_REGEX_CONFIG_HPP +#include +#endif + +#include + +#endif /* include guard */ + + + + + + + + + + diff --git a/contrib/autoboost/autoboost/cstdint.hpp b/contrib/autoboost/autoboost/cstdint.hpp new file mode 100644 index 000000000..eb0091f04 --- /dev/null +++ b/contrib/autoboost/autoboost/cstdint.hpp @@ -0,0 +1,545 @@ +// boost cstdint.hpp header file ------------------------------------------// + +// (C) Copyright Beman Dawes 1999. +// (C) Copyright Jens Mauer 2001 +// (C) Copyright John Maddock 2001 +// 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/libs/integer for documentation. + +// Revision History +// 31 Oct 01 use AUTOBOOST_HAS_LONG_LONG to check for "long long" (Jens M.) +// 16 Apr 01 check LONGLONG_MAX when looking for "long long" (Jens Maurer) +// 23 Jan 01 prefer "long" over "int" for int32_t and intmax_t (Jens Maurer) +// 12 Nov 00 Merged (Jens Maurer) +// 23 Sep 00 Added INTXX_C macro support (John Maddock). +// 22 Sep 00 Better 64-bit support (John Maddock) +// 29 Jun 00 Reimplement to avoid including stdint.h within namespace autoboost +// 8 Aug 99 Initial version (Beman Dawes) + + +#ifndef AUTOBOOST_CSTDINT_HPP +#define AUTOBOOST_CSTDINT_HPP + +// +// Since we always define the INT#_C macros as per C++0x, +// define __STDC_CONSTANT_MACROS so that does the right +// thing if possible, and so that the user knows that the macros +// are actually defined as per C99. +// +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +#endif + +#include + +// +// Note that GLIBC is a bit inconsistent about whether int64_t is defined or not +// depending upon what headers happen to have been included first... +// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG. +// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990 +// +#if defined(AUTOBOOST_HAS_STDINT_H) \ + && (!defined(__GLIBC__) \ + || defined(__GLIBC_HAVE_LONG_LONG) \ + || (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17))))) + +// The following #include is an implementation artifact; not part of interface. +# ifdef __hpux +// HP-UX has a vaguely nice in a non-standard location +# include +# ifdef __STDC_32_MODE__ + // this is triggered with GCC, because it defines __cplusplus < 199707L +# define AUTOBOOST_NO_INT64_T +# endif +# elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX) +# include +# else +# include + +// There is a bug in Cygwin two _C macros +# if defined(__STDC_CONSTANT_MACROS) && defined(__CYGWIN__) +# undef INTMAX_C +# undef UINTMAX_C +# define INTMAX_C(c) c##LL +# define UINTMAX_C(c) c##ULL +# endif + +# endif + +#ifdef __QNX__ + +// QNX (Dinkumware stdlib) defines these as non-standard names. +// Reflect to the standard names. + +typedef ::intleast8_t int_least8_t; +typedef ::intfast8_t int_fast8_t; +typedef ::uintleast8_t uint_least8_t; +typedef ::uintfast8_t uint_fast8_t; + +typedef ::intleast16_t int_least16_t; +typedef ::intfast16_t int_fast16_t; +typedef ::uintleast16_t uint_least16_t; +typedef ::uintfast16_t uint_fast16_t; + +typedef ::intleast32_t int_least32_t; +typedef ::intfast32_t int_fast32_t; +typedef ::uintleast32_t uint_least32_t; +typedef ::uintfast32_t uint_fast32_t; + +# ifndef AUTOBOOST_NO_INT64_T + +typedef ::intleast64_t int_least64_t; +typedef ::intfast64_t int_fast64_t; +typedef ::uintleast64_t uint_least64_t; +typedef ::uintfast64_t uint_fast64_t; + +# endif + +#endif + +namespace autoboost +{ + + using ::int8_t; + using ::int_least8_t; + using ::int_fast8_t; + using ::uint8_t; + using ::uint_least8_t; + using ::uint_fast8_t; + + using ::int16_t; + using ::int_least16_t; + using ::int_fast16_t; + using ::uint16_t; + using ::uint_least16_t; + using ::uint_fast16_t; + + using ::int32_t; + using ::int_least32_t; + using ::int_fast32_t; + using ::uint32_t; + using ::uint_least32_t; + using ::uint_fast32_t; + +# ifndef AUTOBOOST_NO_INT64_T + + using ::int64_t; + using ::int_least64_t; + using ::int_fast64_t; + using ::uint64_t; + using ::uint_least64_t; + using ::uint_fast64_t; + +# endif + + using ::intmax_t; + using ::uintmax_t; + +} // namespace autoboost + +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS) +// FreeBSD and Tru64 have an that contains much of what we need. +# include + +namespace autoboost { + + using ::int8_t; + typedef int8_t int_least8_t; + typedef int8_t int_fast8_t; + using ::uint8_t; + typedef uint8_t uint_least8_t; + typedef uint8_t uint_fast8_t; + + using ::int16_t; + typedef int16_t int_least16_t; + typedef int16_t int_fast16_t; + using ::uint16_t; + typedef uint16_t uint_least16_t; + typedef uint16_t uint_fast16_t; + + using ::int32_t; + typedef int32_t int_least32_t; + typedef int32_t int_fast32_t; + using ::uint32_t; + typedef uint32_t uint_least32_t; + typedef uint32_t uint_fast32_t; + +# ifndef AUTOBOOST_NO_INT64_T + + using ::int64_t; + typedef int64_t int_least64_t; + typedef int64_t int_fast64_t; + using ::uint64_t; + typedef uint64_t uint_least64_t; + typedef uint64_t uint_fast64_t; + + typedef int64_t intmax_t; + typedef uint64_t uintmax_t; + +# else + + typedef int32_t intmax_t; + typedef uint32_t uintmax_t; + +# endif + +} // namespace autoboost + +#else // AUTOBOOST_HAS_STDINT_H + +# include // implementation artifact; not part of interface +# include // needed for limits macros + + +namespace autoboost +{ + +// These are fairly safe guesses for some 16-bit, and most 32-bit and 64-bit +// platforms. For other systems, they will have to be hand tailored. +// +// Because the fast types are assumed to be the same as the undecorated types, +// it may be possible to hand tailor a more efficient implementation. Such +// an optimization may be illusionary; on the Intel x86-family 386 on, for +// example, byte arithmetic and load/stores are as fast as "int" sized ones. + +// 8-bit types ------------------------------------------------------------// + +# if UCHAR_MAX == 0xff + typedef signed char int8_t; + typedef signed char int_least8_t; + typedef signed char int_fast8_t; + typedef unsigned char uint8_t; + typedef unsigned char uint_least8_t; + typedef unsigned char uint_fast8_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + +// 16-bit types -----------------------------------------------------------// + +# if USHRT_MAX == 0xffff +# if defined(__crayx1) + // The Cray X1 has a 16-bit short, however it is not recommend + // for use in performance critical code. + typedef short int16_t; + typedef short int_least16_t; + typedef int int_fast16_t; + typedef unsigned short uint16_t; + typedef unsigned short uint_least16_t; + typedef unsigned int uint_fast16_t; +# else + typedef short int16_t; + typedef short int_least16_t; + typedef short int_fast16_t; + typedef unsigned short uint16_t; + typedef unsigned short uint_least16_t; + typedef unsigned short uint_fast16_t; +# endif +# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) + // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified + // MTA / XMT does support the following non-standard integer types + typedef __short16 int16_t; + typedef __short16 int_least16_t; + typedef __short16 int_fast16_t; + typedef unsigned __short16 uint16_t; + typedef unsigned __short16 uint_least16_t; + typedef unsigned __short16 uint_fast16_t; +# elif (USHRT_MAX == 0xffffffff) && defined(CRAY) + // no 16-bit types on Cray: + typedef short int_least16_t; + typedef short int_fast16_t; + typedef unsigned short uint_least16_t; + typedef unsigned short uint_fast16_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + +// 32-bit types -----------------------------------------------------------// + +# if UINT_MAX == 0xffffffff + typedef int int32_t; + typedef int int_least32_t; + typedef int int_fast32_t; + typedef unsigned int uint32_t; + typedef unsigned int uint_least32_t; + typedef unsigned int uint_fast32_t; +# elif (USHRT_MAX == 0xffffffff) + typedef short int32_t; + typedef short int_least32_t; + typedef short int_fast32_t; + typedef unsigned short uint32_t; + typedef unsigned short uint_least32_t; + typedef unsigned short uint_fast32_t; +# elif ULONG_MAX == 0xffffffff + typedef long int32_t; + typedef long int_least32_t; + typedef long int_fast32_t; + typedef unsigned long uint32_t; + typedef unsigned long uint_least32_t; + typedef unsigned long uint_fast32_t; +# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) + // Integers are 64 bits on the MTA / XMT + typedef __int32 int32_t; + typedef __int32 int_least32_t; + typedef __int32 int_fast32_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int32 uint_fast32_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + +// 64-bit types + intmax_t and uintmax_t ----------------------------------// + +# if defined(AUTOBOOST_HAS_LONG_LONG) && \ + !defined(AUTOBOOST_MSVC) && !defined(__BORLANDC__) && \ + (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \ + (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) +# if defined(__hpux) + // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions +# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) + // 2**64 - 1 +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + + typedef ::autoboost::long_long_type intmax_t; + typedef ::autoboost::ulong_long_type uintmax_t; + typedef ::autoboost::long_long_type int64_t; + typedef ::autoboost::long_long_type int_least64_t; + typedef ::autoboost::long_long_type int_fast64_t; + typedef ::autoboost::ulong_long_type uint64_t; + typedef ::autoboost::ulong_long_type uint_least64_t; + typedef ::autoboost::ulong_long_type uint_fast64_t; + +# elif ULONG_MAX != 0xffffffff + +# if ULONG_MAX == 18446744073709551615 // 2**64 - 1 + typedef long intmax_t; + typedef unsigned long uintmax_t; + typedef long int64_t; + typedef long int_least64_t; + typedef long int_fast64_t; + typedef unsigned long uint64_t; + typedef unsigned long uint_least64_t; + typedef unsigned long uint_fast64_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# elif defined(__GNUC__) && defined(AUTOBOOST_HAS_LONG_LONG) + __extension__ typedef long long intmax_t; + __extension__ typedef unsigned long long uintmax_t; + __extension__ typedef long long int64_t; + __extension__ typedef long long int_least64_t; + __extension__ typedef long long int_fast64_t; + __extension__ typedef unsigned long long uint64_t; + __extension__ typedef unsigned long long uint_least64_t; + __extension__ typedef unsigned long long uint_fast64_t; +# elif defined(AUTOBOOST_HAS_MS_INT64) + // + // we have Borland/Intel/Microsoft __int64: + // + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; + typedef __int64 int64_t; + typedef __int64 int_least64_t; + typedef __int64 int_fast64_t; + typedef unsigned __int64 uint64_t; + typedef unsigned __int64 uint_least64_t; + typedef unsigned __int64 uint_fast64_t; +# else // assume no 64-bit integers +# define AUTOBOOST_NO_INT64_T + typedef int32_t intmax_t; + typedef uint32_t uintmax_t; +# endif + +} // namespace autoboost + + +#endif // AUTOBOOST_HAS_STDINT_H + +// intptr_t/uintptr_t are defined separately because they are optional and not universally available +#if defined(AUTOBOOST_WINDOWS) && !defined(_WIN32_WCE) && !defined(AUTOBOOST_HAS_STDINT_H) +// Older MSVC don't have stdint.h and have intptr_t/uintptr_t defined in stddef.h +#include +#endif + +// PGI seems to not support intptr_t/uintptr_t properly. AUTOBOOST_HAS_STDINT_H is not defined for this compiler by Boost.Config. +#if !defined(__PGIC__) + +#if (defined(AUTOBOOST_WINDOWS) && !defined(_WIN32_WCE)) \ + || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \ + || defined(__CYGWIN__) \ + || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \ + || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) + +namespace autoboost { + using ::intptr_t; + using ::uintptr_t; +} +#define AUTOBOOST_HAS_INTPTR_T + +// Clang pretends to be GCC, so it'll match this condition +#elif defined(__GNUC__) && defined(__INTPTR_TYPE__) && defined(__UINTPTR_TYPE__) + +namespace autoboost { + typedef __INTPTR_TYPE__ intptr_t; + typedef __UINTPTR_TYPE__ uintptr_t; +} +#define AUTOBOOST_HAS_INTPTR_T + +#endif + +#endif // !defined(__PGIC__) + +#endif // AUTOBOOST_CSTDINT_HPP + + +/**************************************************** + +Macro definition section: + +Added 23rd September 2000 (John Maddock). +Modified 11th September 2001 to be excluded when +AUTOBOOST_HAS_STDINT_H is defined (John Maddock). +Modified 11th Dec 2009 to always define the +INT#_C macros if they're not already defined (John Maddock). + +******************************************************/ + +#if !defined(AUTOBOOST__STDC_CONSTANT_MACROS_DEFINED) && \ + (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) +// +// For the following code we get several warnings along the lines of: +// +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + +#include +# define AUTOBOOST__STDC_CONSTANT_MACROS_DEFINED +# if defined(AUTOBOOST_HAS_MS_INT64) +// +// Borland/Intel/Microsoft compilers have width specific suffixes: +// +#ifndef INT8_C +# define INT8_C(value) value##i8 +#endif +#ifndef INT16_C +# define INT16_C(value) value##i16 +#endif +#ifndef INT32_C +# define INT32_C(value) value##i32 +#endif +#ifndef INT64_C +# define INT64_C(value) value##i64 +#endif +# ifdef __BORLANDC__ + // Borland bug: appending ui8 makes the type a signed char +# define UINT8_C(value) static_cast(value##u) +# else +# define UINT8_C(value) value##ui8 +# endif +#ifndef UINT16_C +# define UINT16_C(value) value##ui16 +#endif +#ifndef UINT32_C +# define UINT32_C(value) value##ui32 +#endif +#ifndef UINT64_C +# define UINT64_C(value) value##ui64 +#endif +#ifndef INTMAX_C +# define INTMAX_C(value) value##i64 +# define UINTMAX_C(value) value##ui64 +#endif + +# else +// do it the old fashioned way: + +// 8-bit types ------------------------------------------------------------// + +# if (UCHAR_MAX == 0xff) && !defined(INT8_C) +# define INT8_C(value) static_cast(value) +# define UINT8_C(value) static_cast(value##u) +# endif + +// 16-bit types -----------------------------------------------------------// + +# if (USHRT_MAX == 0xffff) && !defined(INT16_C) +# define INT16_C(value) static_cast(value) +# define UINT16_C(value) static_cast(value##u) +# endif + +// 32-bit types -----------------------------------------------------------// +#ifndef INT32_C +# if (UINT_MAX == 0xffffffff) +# define INT32_C(value) value +# define UINT32_C(value) value##u +# elif ULONG_MAX == 0xffffffff +# define INT32_C(value) value##L +# define UINT32_C(value) value##uL +# endif +#endif + +// 64-bit types + intmax_t and uintmax_t ----------------------------------// +#ifndef INT64_C +# if defined(AUTOBOOST_HAS_LONG_LONG) && \ + (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) + +# if defined(__hpux) + // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || \ + (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) || \ + (defined(_LLONG_MAX) && _LLONG_MAX == 18446744073709551615ULL) + +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# elif ULONG_MAX != 0xffffffff + +# if ULONG_MAX == 18446744073709551615U // 2**64 - 1 +# define INT64_C(value) value##L +# define UINT64_C(value) value##uL +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# elif defined(AUTOBOOST_HAS_LONG_LONG) + // Usual macros not defined, work things out for ourselves: +# if(~0uLL == 18446744073709551615ULL) +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + +# ifdef AUTOBOOST_NO_INT64_T +# define INTMAX_C(value) INT32_C(value) +# define UINTMAX_C(value) UINT32_C(value) +# else +# define INTMAX_C(value) INT64_C(value) +# define UINTMAX_C(value) UINT64_C(value) +# endif +#endif +# endif // Borland/Microsoft specific width suffixes + +#endif // INT#_C macros. + + + + diff --git a/contrib/autoboost/boost/cstdlib.hpp b/contrib/autoboost/autoboost/cstdlib.hpp similarity index 96% rename from contrib/autoboost/boost/cstdlib.hpp rename to contrib/autoboost/autoboost/cstdlib.hpp index e6d67f54d..542f11797 100644 --- a/contrib/autoboost/boost/cstdlib.hpp +++ b/contrib/autoboost/autoboost/cstdlib.hpp @@ -9,8 +9,8 @@ // Revision History // 26 Feb 01 Initial version (Beman Dawes) -#ifndef BOOST_CSTDLIB_HPP -#define BOOST_CSTDLIB_HPP +#ifndef AUTOBOOST_CSTDLIB_HPP +#define AUTOBOOST_CSTDLIB_HPP #include diff --git a/contrib/autoboost/autoboost/current_function.hpp b/contrib/autoboost/autoboost/current_function.hpp new file mode 100644 index 000000000..b79e7a8c0 --- /dev/null +++ b/contrib/autoboost/autoboost/current_function.hpp @@ -0,0 +1,71 @@ +#ifndef AUTOBOOST_CURRENT_FUNCTION_HPP_INCLUDED +#define AUTOBOOST_CURRENT_FUNCTION_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// boost/current_function.hpp - AUTOBOOST_CURRENT_FUNCTION +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// 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 +// +// http://www.boost.org/libs/assert/current_function.html +// + +namespace autoboost +{ + +namespace detail +{ + +inline void current_function_helper() +{ + +#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__) + +# define AUTOBOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__ + +#elif defined(__DMC__) && (__DMC__ >= 0x810) + +# define AUTOBOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__ + +#elif defined(__FUNCSIG__) + +# define AUTOBOOST_CURRENT_FUNCTION __FUNCSIG__ + +#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500)) + +# define AUTOBOOST_CURRENT_FUNCTION __FUNCTION__ + +#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) + +# define AUTOBOOST_CURRENT_FUNCTION __FUNC__ + +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) + +# define AUTOBOOST_CURRENT_FUNCTION __func__ + +#elif defined(__cplusplus) && (__cplusplus >= 201103) + +# define AUTOBOOST_CURRENT_FUNCTION __func__ + +#else + +# define AUTOBOOST_CURRENT_FUNCTION "(unknown)" + +#endif + +} + +} // namespace detail + +} // namespace autoboost + +#endif // #ifndef AUTOBOOST_CURRENT_FUNCTION_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/date_time.hpp b/contrib/autoboost/autoboost/date_time.hpp new file mode 100644 index 000000000..5cc896772 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time.hpp @@ -0,0 +1,17 @@ +#ifndef AUTOBOOST_DATE_TIME_ALL_HPP___ +#define AUTOBOOST_DATE_TIME_ALL_HPP___ + +/* Copyright (c) 2006 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland + * $Date$ + */ + + // See www.boost.org/libs/date_time for documentation. + +//gregorian and posix time included by indirectly +#include "autoboost/date_time/local_time/local_time.hpp" + +#endif // AUTOBOOST_DATE_TIME_ALL_HPP___ diff --git a/contrib/autoboost/boost/date_time/adjust_functors.hpp b/contrib/autoboost/autoboost/date_time/adjust_functors.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/adjust_functors.hpp rename to contrib/autoboost/autoboost/date_time/adjust_functors.hpp index 9a89c2e9b..cee9a88fb 100644 --- a/contrib/autoboost/boost/date_time/adjust_functors.hpp +++ b/contrib/autoboost/autoboost/date_time/adjust_functors.hpp @@ -1,5 +1,5 @@ -#ifndef _DATE_TIME_ADJUST_FUNCTORS_HPP___ -#define _DATE_TIME_ADJUST_FUNCTORS_HPP___ +#ifndef AB__DATE_TIME_ADJUST_FUNCTORS_HPP___ +#define AB__DATE_TIME_ADJUST_FUNCTORS_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,8 +9,8 @@ * $Date$ */ -#include "boost/date_time/date.hpp" -#include "boost/date_time/wrapping_int.hpp" +#include "autoboost/date_time/date.hpp" +#include "autoboost/date_time/wrapping_int.hpp" namespace autoboost { namespace date_time { diff --git a/contrib/autoboost/boost/date_time/c_time.hpp b/contrib/autoboost/autoboost/date_time/c_time.hpp similarity index 89% rename from contrib/autoboost/boost/date_time/c_time.hpp rename to contrib/autoboost/autoboost/date_time/c_time.hpp index 203f4936e..6ae0387c1 100644 --- a/contrib/autoboost/boost/date_time/c_time.hpp +++ b/contrib/autoboost/autoboost/date_time/c_time.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_C_TIME_HPP___ -#define DATE_TIME_C_TIME_HPP___ +#ifndef AB_DATE_TIME_C_TIME_HPP___ +#define AB_DATE_TIME_C_TIME_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -17,21 +17,21 @@ #include #include // to be able to convert from string literals to exceptions #include -#include -#include +#include +#include //Work around libraries that don't put time_t and time in namespace std -#ifdef BOOST_NO_STDC_NAMESPACE +#ifdef AUTOBOOST_NO_STDC_NAMESPACE namespace std { using ::time_t; using ::time; using ::localtime; using ::tm; using ::gmtime; } -#endif // BOOST_NO_STDC_NAMESPACE +#endif // AUTOBOOST_NO_STDC_NAMESPACE //The following is used to support high precision time clocks -#ifdef BOOST_HAS_GETTIMEOFDAY +#ifdef AUTOBOOST_HAS_GETTIMEOFDAY #include #endif -#ifdef BOOST_HAS_FTIME +#ifdef AUTOBOOST_HAS_FTIME #include #endif @@ -51,7 +51,7 @@ namespace date_time { */ struct c_time { public: -#if defined(BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS) +#if defined(AUTOBOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS) //! requires a pointer to a user created std::tm struct inline static std::tm* localtime(const std::time_t* t, std::tm* result) @@ -88,7 +88,7 @@ namespace date_time { autoboost::throw_exception(std::runtime_error("could not convert calendar time to UTC time")); return result; } -#else // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS +#else // AUTOBOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS #if (defined(_MSC_VER) && (_MSC_VER >= 1400)) #pragma warning(push) // preserve warning settings @@ -116,7 +116,7 @@ namespace date_time { #pragma warning(pop) // restore warnings to previous state #endif // _MSC_VER >= 1400 -#endif // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS +#endif // AUTOBOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS }; }} // namespaces diff --git a/contrib/autoboost/autoboost/date_time/compiler_config.hpp b/contrib/autoboost/autoboost/date_time/compiler_config.hpp new file mode 100644 index 000000000..5fc4e2293 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/compiler_config.hpp @@ -0,0 +1,148 @@ +#ifndef AB_DATE_TIME_COMPILER_CONFIG_HPP___ +#define AB_DATE_TIME_COMPILER_CONFIG_HPP___ + +/* Copyright (c) 2002-2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include +#include +#include + +// With boost release 1.33, date_time will be using a different, +// more flexible, IO system. This new system is not compatible with +// old compilers. The original date_time IO system remains for those +// compilers. They must define this macro to use the legacy IO. +// (defined(__BORLANDC__) && (__BORLANDC__ <= 0x0581) ) ) && + #if( AUTOBOOST_WORKAROUND( __BORLANDC__, AUTOBOOST_TESTED_AT(0x581) ) \ + || AUTOBOOST_WORKAROUND( __GNUC__, < 3) \ + || (AUTOBOOST_WORKAROUND( _MSC_VER, <= 1300) ) \ + ) \ + && !defined(USE_DATE_TIME_PRE_1_33_FACET_IO) +# define USE_DATE_TIME_PRE_1_33_FACET_IO +#endif + + +// This file performs some local compiler configurations + +#include //set up locale configurations + +//Set up a configuration parameter for platforms that have +//GetTimeOfDay +#if defined(AUTOBOOST_HAS_GETTIMEOFDAY) || defined(AUTOBOOST_HAS_FTIME) +#define AUTOBOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK +#endif + +// To Force no default constructors for date & ptime, un-comment following +//#define DATE_TIME_NO_DEFAULT_CONSTRUCTOR + +// Include extensions to date_duration - comment out to remove this feature +#define AUTOBOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES +// these extensions are known to cause problems with gcc295 +#if defined(__GNUC__) && (__GNUC__ < 3) +#undef AUTOBOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES +#endif + +#if (defined(AUTOBOOST_NO_INCLASS_MEMBER_INITIALIZATION) || AUTOBOOST_WORKAROUND( __BORLANDC__, AUTOBOOST_TESTED_AT(0x581) ) ) +#define AUTOBOOST_DATE_TIME_NO_MEMBER_INIT +#endif + +// include these types before we try to re-define them +#include + +//Define INT64_C for compilers that don't have it +#if (!defined(INT64_C)) +#define INT64_C(value) int64_t(value) +#endif + + +/* Workaround for Borland iterator error. Error was "Cannot convert 'istream *' to 'wistream *' in function istream_iterator<>::istream_iterator() */ +#if defined(__BORLANDC__) && defined(AUTOBOOST_BCB_WITH_RW_LIB) +#define AUTOBOOST_DATE_TIME_NO_WISTREAM_ITERATOR +#endif + + +// Borland v5.64 does not have the following in std namespace; v5.5.1 does +#if defined(__BORLANDC__) && defined(AUTOBOOST_BCB_WITH_STLPORT) +#include +namespace std { + using stlport::tolower; + using stlport::ctype; + using stlport::use_facet; +} +#endif + +// workaround for errors associated with output for date classes +// modifications and input streaming for time classes. +// Compilers affected are: +// gcc295, msvc (neither with STLPort), any borland +// +#if (((defined(__GNUC__) && (__GNUC__ < 3)) || \ + (defined(_MSC_VER) && (_MSC_VER < 1300)) ) && \ + !defined(_STLP_OWN_IOSTREAMS) ) || \ + AUTOBOOST_WORKAROUND( __BORLANDC__, AUTOBOOST_TESTED_AT(0x581) ) +#define AUTOBOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS +#endif + +// The macro marks up places where compiler complains for missing return statement or +// uninitialized variables after calling to autoboost::throw_exception. +// AUTOBOOST_UNREACHABLE_RETURN doesn't work since even compilers that support +// unreachable statements detection emit such warnings. +#if defined(_MSC_VER) +// Use special MSVC extension to markup unreachable code +# define AUTOBOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) __assume(false) +#elif !defined(AUTOBOOST_NO_UNREACHABLE_RETURN_DETECTION) +// Call to a non-returning function should suppress the warning +# if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std { + using ::abort; +} +# endif // defined(AUTOBOOST_NO_STDC_NAMESPACE) +# define AUTOBOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) std::abort() +#else +// For other poor compilers the specified expression is compiled. Usually, this would be a return statement. +# define AUTOBOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) x +#endif + +/* The following handles the definition of the necessary macros + * for dll building on Win32 platforms. + * + * For code that will be placed in the date_time .dll, + * it must be properly prefixed with AUTOBOOST_DATE_TIME_DECL. + * The corresponding .cpp file must have AUTOBOOST_DATE_TIME_SOURCE + * defined before including its header. For examples see: + * greg_month.hpp & greg_month.cpp + * + */ + +// we need to import/export our code only if the user has specifically +// asked for it by defining either AUTOBOOST_ALL_DYN_LINK if they want all boost +// libraries to be dynamically linked, or AUTOBOOST_DATE_TIME_DYN_LINK +// if they want just this one to be dynamically liked: +#if defined(AUTOBOOST_ALL_DYN_LINK) || defined(AUTOBOOST_DATE_TIME_DYN_LINK) + // export if this is our own source, otherwise import: +# ifdef AUTOBOOST_DATE_TIME_SOURCE +# define AUTOBOOST_DATE_TIME_DECL AUTOBOOST_SYMBOL_EXPORT +# else +# define AUTOBOOST_DATE_TIME_DECL AUTOBOOST_SYMBOL_IMPORT +# endif // AUTOBOOST_DATE_TIME_SOURCE +#endif // DYN_LINK +// +// if AUTOBOOST_WHATEVER_DECL isn't defined yet define it now: +#ifndef AUTOBOOST_DATE_TIME_DECL +# define AUTOBOOST_DATE_TIME_DECL +#endif + +#if defined(AUTOBOOST_HAS_THREADS) +# if defined(_MSC_VER) || defined(__MWERKS__) || defined(__MINGW32__) || defined(__BORLANDC__) + //no reentrant posix functions (eg: localtime_r) +# elif (!defined(__hpux) || (defined(__hpux) && defined(_REENTRANT))) +# define AUTOBOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS +# endif +#endif + + +#endif diff --git a/contrib/autoboost/boost/date_time/constrained_value.hpp b/contrib/autoboost/autoboost/date_time/constrained_value.hpp similarity index 82% rename from contrib/autoboost/boost/date_time/constrained_value.hpp rename to contrib/autoboost/autoboost/date_time/constrained_value.hpp index 862d77046..dddbb536d 100644 --- a/contrib/autoboost/boost/date_time/constrained_value.hpp +++ b/contrib/autoboost/autoboost/date_time/constrained_value.hpp @@ -1,5 +1,5 @@ -#ifndef CONSTRAINED_VALUE_HPP___ -#define CONSTRAINED_VALUE_HPP___ +#ifndef AB_CONSTRAINED_VALUE_HPP___ +#define AB_CONSTRAINED_VALUE_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -11,10 +11,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { @@ -53,9 +53,9 @@ namespace CV { return *this; } //! Return the max allowed value (traits method) - static value_type max BOOST_PREVENT_MACRO_SUBSTITUTION () {return (value_policies::max)();} + static value_type max AUTOBOOST_PREVENT_MACRO_SUBSTITUTION () {return (value_policies::max)();} //! Return the min allowed value (traits method) - static value_type min BOOST_PREVENT_MACRO_SUBSTITUTION () {return (value_policies::min)();} + static value_type min AUTOBOOST_PREVENT_MACRO_SUBSTITUTION () {return (value_policies::min)();} //! Coerce into the representation type operator value_type() const {return value_;} protected: @@ -84,7 +84,7 @@ namespace CV { { struct exception_wrapper : public exception_type { - // In order to support throw_exception mechanism in the BOOST_NO_EXCEPTIONS mode, + // In order to support throw_exception mechanism in the AUTOBOOST_NO_EXCEPTIONS mode, // we'll have to provide a way to acquire std::exception from the exception being thrown. // However, we cannot derive from it, since it would make it interceptable by this class, // which might not be what the user wanted. @@ -103,8 +103,8 @@ namespace CV { public: typedef rep_type value_type; - static rep_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return min_value; } - static rep_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return max_value; } + static rep_type min AUTOBOOST_PREVENT_MACRO_SUBSTITUTION () { return min_value; } + static rep_type max AUTOBOOST_PREVENT_MACRO_SUBSTITUTION () { return max_value; } static void on_error(rep_type, rep_type, violation_enum) { autoboost::throw_exception(actual_exception_type()); diff --git a/contrib/autoboost/boost/date_time/date.hpp b/contrib/autoboost/autoboost/date_time/date.hpp similarity index 97% rename from contrib/autoboost/boost/date_time/date.hpp rename to contrib/autoboost/autoboost/date_time/date.hpp index e360215eb..7a5934b1a 100644 --- a/contrib/autoboost/boost/date_time/date.hpp +++ b/contrib/autoboost/autoboost/date_time/date.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DATE_HPP___ -#define DATE_TIME_DATE_HPP___ +#ifndef AB_DATE_TIME_DATE_HPP___ +#define AB_DATE_TIME_DATE_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,9 +9,9 @@ * $Date$ */ -#include -#include -#include +#include +#include +#include namespace autoboost { namespace date_time { diff --git a/contrib/autoboost/boost/date_time/date_clock_device.hpp b/contrib/autoboost/autoboost/date_time/date_clock_device.hpp similarity index 95% rename from contrib/autoboost/boost/date_time/date_clock_device.hpp rename to contrib/autoboost/autoboost/date_time/date_clock_device.hpp index a672ed277..9968e0b59 100644 --- a/contrib/autoboost/boost/date_time/date_clock_device.hpp +++ b/contrib/autoboost/autoboost/date_time/date_clock_device.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_CLOCK_DEVICE_HPP___ -#define DATE_CLOCK_DEVICE_HPP___ +#ifndef AB_DATE_CLOCK_DEVICE_HPP___ +#define AB_DATE_CLOCK_DEVICE_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,7 +9,7 @@ * $Date$ */ -#include "boost/date_time/c_time.hpp" +#include "autoboost/date_time/c_time.hpp" namespace autoboost { diff --git a/contrib/autoboost/boost/date_time/date_defs.hpp b/contrib/autoboost/autoboost/date_time/date_defs.hpp similarity index 90% rename from contrib/autoboost/boost/date_time/date_defs.hpp rename to contrib/autoboost/autoboost/date_time/date_defs.hpp index 3a9c4ac30..5fbec5487 100644 --- a/contrib/autoboost/boost/date_time/date_defs.hpp +++ b/contrib/autoboost/autoboost/date_time/date_defs.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DATE_DEFS_HPP -#define DATE_TIME_DATE_DEFS_HPP +#ifndef AB_DATE_TIME_DATE_DEFS_HPP +#define AB_DATE_TIME_DATE_DEFS_HPP /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/boost/date_time/date_duration.hpp b/contrib/autoboost/autoboost/date_time/date_duration.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/date_duration.hpp rename to contrib/autoboost/autoboost/date_time/date_duration.hpp index 34a0054e9..d585c357a 100644 --- a/contrib/autoboost/boost/date_time/date_duration.hpp +++ b/contrib/autoboost/autoboost/date_time/date_duration.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DATE_DURATION__ -#define DATE_TIME_DATE_DURATION__ +#ifndef AB_DATE_TIME_DATE_DURATION__ +#define AB_DATE_TIME_DATE_DURATION__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -10,8 +10,8 @@ */ -#include -#include +#include +#include namespace autoboost { namespace date_time { diff --git a/contrib/autoboost/boost/date_time/date_duration_types.hpp b/contrib/autoboost/autoboost/date_time/date_duration_types.hpp similarity index 97% rename from contrib/autoboost/boost/date_time/date_duration_types.hpp rename to contrib/autoboost/autoboost/date_time/date_duration_types.hpp index 1ec83d690..ead1f484e 100644 --- a/contrib/autoboost/boost/date_time/date_duration_types.hpp +++ b/contrib/autoboost/autoboost/date_time/date_duration_types.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_DURATION_TYPES_HPP___ -#define DATE_DURATION_TYPES_HPP___ +#ifndef AB_DATE_DURATION_TYPES_HPP___ +#define AB_DATE_DURATION_TYPES_HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * Subject to the Boost Software License, Version 1.0. @@ -9,9 +9,9 @@ * $Date$ */ -#include -#include -#include +#include +#include +#include namespace autoboost { namespace date_time { diff --git a/contrib/autoboost/boost/date_time/date_facet.hpp b/contrib/autoboost/autoboost/date_time/date_facet.hpp similarity index 97% rename from contrib/autoboost/boost/date_time/date_facet.hpp rename to contrib/autoboost/autoboost/date_time/date_facet.hpp index fe8fd925c..a77a1a39b 100644 --- a/contrib/autoboost/boost/date_time/date_facet.hpp +++ b/contrib/autoboost/autoboost/date_time/date_facet.hpp @@ -1,5 +1,5 @@ -#ifndef _DATE_TIME_DATE_FACET__HPP___ -#define _DATE_TIME_DATE_FACET__HPP___ +#ifndef AB__DATE_TIME_DATE_FACET__HPP___ +#define AB__DATE_TIME_DATE_FACET__HPP___ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -13,17 +13,17 @@ #include #include #include // ostreambuf_iterator -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace autoboost { namespace date_time { @@ -630,7 +630,7 @@ namespace autoboost { namespace date_time { m_sv_parser.match(from, to, mr); if(mr.current_match == match_results::PARSE_ERROR) { autoboost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + mr.cache + "'")); - BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return from); // should never reach + AUTOBOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return from); // should never reach } dd = duration_type(static_cast(mr.current_match)); } diff --git a/contrib/autoboost/boost/date_time/date_format_simple.hpp b/contrib/autoboost/autoboost/date_time/date_format_simple.hpp similarity index 93% rename from contrib/autoboost/boost/date_time/date_format_simple.hpp rename to contrib/autoboost/autoboost/date_time/date_format_simple.hpp index d2c2b1ca0..c42adfda5 100644 --- a/contrib/autoboost/boost/date_time/date_format_simple.hpp +++ b/contrib/autoboost/autoboost/date_time/date_format_simple.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_SIMPLE_FORMAT_HPP___ -#define DATE_TIME_SIMPLE_FORMAT_HPP___ +#ifndef AB_DATE_TIME_SIMPLE_FORMAT_HPP___ +#define AB_DATE_TIME_SIMPLE_FORMAT_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,7 +9,7 @@ * $Date$ */ -#include "boost/date_time/parse_format_base.hpp" +#include "autoboost/date_time/parse_format_base.hpp" namespace autoboost { namespace date_time { @@ -81,7 +81,7 @@ class simple_format { }; -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING //! Specialization of formmating rules for wchar_t template<> @@ -150,7 +150,7 @@ class simple_format { }; -#endif // BOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_STD_WSTRING } } //namespace date_time diff --git a/contrib/autoboost/boost/date_time/date_formatting.hpp b/contrib/autoboost/autoboost/date_time/date_formatting.hpp similarity index 93% rename from contrib/autoboost/boost/date_time/date_formatting.hpp rename to contrib/autoboost/autoboost/date_time/date_formatting.hpp index 24ee848a6..bd0f6b7e2 100644 --- a/contrib/autoboost/boost/date_time/date_formatting.hpp +++ b/contrib/autoboost/autoboost/date_time/date_formatting.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DATE_FORMATTING_HPP___ -#define DATE_TIME_DATE_FORMATTING_HPP___ +#ifndef AB_DATE_TIME_DATE_FORMATTING_HPP___ +#define AB_DATE_TIME_DATE_FORMATTING_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,14 +9,14 @@ * $Date$ */ -#include "boost/date_time/iso_format.hpp" -#include "boost/date_time/compiler_config.hpp" +#include "autoboost/date_time/iso_format.hpp" +#include "autoboost/date_time/compiler_config.hpp" #include #include #include /* NOTE: "formatter" code for older compilers, ones that define - * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in + * AUTOBOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * date_formatting_limited.hpp */ diff --git a/contrib/autoboost/boost/date_time/date_formatting_limited.hpp b/contrib/autoboost/autoboost/date_time/date_formatting_limited.hpp similarity index 94% rename from contrib/autoboost/boost/date_time/date_formatting_limited.hpp rename to contrib/autoboost/autoboost/date_time/date_formatting_limited.hpp index 4c7de1c59..e0e5d4f92 100644 --- a/contrib/autoboost/boost/date_time/date_formatting_limited.hpp +++ b/contrib/autoboost/autoboost/date_time/date_formatting_limited.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DATE_FORMATTING_LIMITED_HPP___ -#define DATE_TIME_DATE_FORMATTING_LIMITED_HPP___ +#ifndef AB_DATE_TIME_DATE_FORMATTING_LIMITED_HPP___ +#define AB_DATE_TIME_DATE_FORMATTING_LIMITED_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,8 +9,8 @@ * $Date$ */ -#include "boost/date_time/iso_format.hpp" -#include "boost/date_time/compiler_config.hpp" +#include "autoboost/date_time/iso_format.hpp" +#include "autoboost/date_time/compiler_config.hpp" #include #include #include diff --git a/contrib/autoboost/boost/date_time/date_formatting_locales.hpp b/contrib/autoboost/autoboost/date_time/date_formatting_locales.hpp similarity index 94% rename from contrib/autoboost/boost/date_time/date_formatting_locales.hpp rename to contrib/autoboost/autoboost/date_time/date_formatting_locales.hpp index ba7846d9a..a1805918e 100644 --- a/contrib/autoboost/boost/date_time/date_formatting_locales.hpp +++ b/contrib/autoboost/autoboost/date_time/date_formatting_locales.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DATE_FORMATTING_LOCALES_HPP___ -#define DATE_TIME_DATE_FORMATTING_LOCALES_HPP___ +#ifndef AB_DATE_TIME_DATE_FORMATTING_LOCALES_HPP___ +#define AB_DATE_TIME_DATE_FORMATTING_LOCALES_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -10,13 +10,13 @@ */ -#include "boost/date_time/locale_config.hpp" // set BOOST_DATE_TIME_NO_LOCALE +#include "autoboost/date_time/locale_config.hpp" // set AUTOBOOST_DATE_TIME_NO_LOCALE -#ifndef BOOST_DATE_TIME_NO_LOCALE +#ifndef AUTOBOOST_DATE_TIME_NO_LOCALE -#include "boost/date_time/iso_format.hpp" -#include "boost/date_time/date_names_put.hpp" -#include "boost/date_time/parse_format_base.hpp" +#include "autoboost/date_time/iso_format.hpp" +#include "autoboost/date_time/date_names_put.hpp" +#include "autoboost/date_time/parse_format_base.hpp" //#include #include #include diff --git a/contrib/autoboost/boost/date_time/date_generator_formatter.hpp b/contrib/autoboost/autoboost/date_time/date_generator_formatter.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/date_generator_formatter.hpp rename to contrib/autoboost/autoboost/date_time/date_generator_formatter.hpp index 674e41e3e..fb888f29d 100644 --- a/contrib/autoboost/boost/date_time/date_generator_formatter.hpp +++ b/contrib/autoboost/autoboost/date_time/date_generator_formatter.hpp @@ -1,5 +1,5 @@ -#ifndef _DATE_TIME_DATE_GENERATOR_FORMATTER__HPP___ -#define _DATE_TIME_DATE_GENERATOR_FORMATTER__HPP___ +#ifndef AB__DATE_TIME_DATE_GENERATOR_FORMATTER__HPP___ +#define AB__DATE_TIME_DATE_GENERATOR_FORMATTER__HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -13,7 +13,7 @@ #include #include #include -#include "boost/date_time/date_generators.hpp" +#include "autoboost/date_time/date_generators.hpp" namespace autoboost { namespace date_time { diff --git a/contrib/autoboost/boost/date_time/date_generator_parser.hpp b/contrib/autoboost/autoboost/date_time/date_generator_parser.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/date_generator_parser.hpp rename to contrib/autoboost/autoboost/date_time/date_generator_parser.hpp index 62aa45cd5..c0c793684 100644 --- a/contrib/autoboost/boost/date_time/date_generator_parser.hpp +++ b/contrib/autoboost/autoboost/date_time/date_generator_parser.hpp @@ -1,6 +1,6 @@ -#ifndef DATE_TIME_DATE_GENERATOR_PARSER_HPP__ -#define DATE_TIME_DATE_GENERATOR_PARSER_HPP__ +#ifndef AB_DATE_TIME_DATE_GENERATOR_PARSER_HPP__ +#define AB_DATE_TIME_DATE_GENERATOR_PARSER_HPP__ /* Copyright (c) 2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -13,11 +13,11 @@ #include #include #include // istreambuf_iterator -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace autoboost { namespace date_time { @@ -175,7 +175,7 @@ namespace autoboost { namespace date_time { default: { autoboost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + mr.cache + "'")); - BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(wn = nth_kday_type::first); + AUTOBOOST_DATE_TIME_UNREACHABLE_EXPRESSION(wn = nth_kday_type::first); } } // week num facet.get(sitr, stream_end, a_ios, wd); // day_of_week diff --git a/contrib/autoboost/boost/date_time/date_generators.hpp b/contrib/autoboost/autoboost/date_time/date_generators.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/date_generators.hpp rename to contrib/autoboost/autoboost/date_time/date_generators.hpp index 6b3a9665c..f1ac62711 100644 --- a/contrib/autoboost/boost/date_time/date_generators.hpp +++ b/contrib/autoboost/autoboost/date_time/date_generators.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DATE_GENERATORS_HPP__ -#define DATE_TIME_DATE_GENERATORS_HPP__ +#ifndef AB_DATE_TIME_DATE_GENERATORS_HPP__ +#define AB_DATE_TIME_DATE_GENERATORS_HPP__ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -15,9 +15,9 @@ #include #include -#include -#include -#include +#include +#include +#include namespace autoboost { namespace date_time { @@ -155,7 +155,7 @@ namespace date_time { //! Returns nth arg as string. 1 -> "first", 2 -> "second", max is 5. - BOOST_DATE_TIME_DECL const char* nth_as_str(int n); + AUTOBOOST_DATE_TIME_DECL const char* nth_as_str(int n); //! Useful generator functor for finding holidays /*! Based on the idea in Cal. Calc. for finding holidays that are diff --git a/contrib/autoboost/boost/date_time/date_iterator.hpp b/contrib/autoboost/autoboost/date_time/date_iterator.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/date_iterator.hpp rename to contrib/autoboost/autoboost/date_time/date_iterator.hpp index caede920a..2d3318d6a 100644 --- a/contrib/autoboost/boost/date_time/date_iterator.hpp +++ b/contrib/autoboost/autoboost/date_time/date_iterator.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_ITERATOR_HPP___ -#define DATE_ITERATOR_HPP___ +#ifndef AB_DATE_ITERATOR_HPP___ +#define AB_DATE_ITERATOR_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/boost/date_time/date_names_put.hpp b/contrib/autoboost/autoboost/date_time/date_names_put.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/date_names_put.hpp rename to contrib/autoboost/autoboost/date_time/date_names_put.hpp index 688daf1d3..27b0210f6 100644 --- a/contrib/autoboost/boost/date_time/date_names_put.hpp +++ b/contrib/autoboost/autoboost/date_time/date_names_put.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DATE_NAMES_PUT_HPP___ -#define DATE_TIME_DATE_NAMES_PUT_HPP___ +#ifndef AB_DATE_TIME_DATE_NAMES_PUT_HPP___ +#define AB_DATE_TIME_DATE_NAMES_PUT_HPP___ /* Copyright (c) 2002-2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -10,14 +10,14 @@ */ -#include "boost/date_time/locale_config.hpp" // set BOOST_DATE_TIME_NO_LOCALE +#include "autoboost/date_time/locale_config.hpp" // set AUTOBOOST_DATE_TIME_NO_LOCALE -#ifndef BOOST_DATE_TIME_NO_LOCALE +#ifndef AUTOBOOST_DATE_TIME_NO_LOCALE -#include "boost/date_time/special_defs.hpp" -#include "boost/date_time/date_defs.hpp" -#include "boost/date_time/parse_format_base.hpp" -#include "boost/lexical_cast.hpp" +#include "autoboost/date_time/special_defs.hpp" +#include "autoboost/date_time/date_defs.hpp" +#include "autoboost/date_time/parse_format_base.hpp" +#include "autoboost/lexical_cast.hpp" #include @@ -315,6 +315,6 @@ namespace date_time { } } //namespace autoboost::date_time -#endif //BOOST_NO_STD_LOCALE +#endif //AUTOBOOST_NO_STD_LOCALE #endif diff --git a/contrib/autoboost/boost/date_time/date_parsing.hpp b/contrib/autoboost/autoboost/date_time/date_parsing.hpp similarity index 94% rename from contrib/autoboost/boost/date_time/date_parsing.hpp rename to contrib/autoboost/autoboost/date_time/date_parsing.hpp index 97e4efca2..545d43ad6 100644 --- a/contrib/autoboost/boost/date_time/date_parsing.hpp +++ b/contrib/autoboost/autoboost/date_time/date_parsing.hpp @@ -1,5 +1,5 @@ -#ifndef _DATE_TIME_DATE_PARSING_HPP___ -#define _DATE_TIME_DATE_PARSING_HPP___ +#ifndef AB__DATE_TIME_DATE_PARSING_HPP___ +#define AB__DATE_TIME_DATE_PARSING_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -12,12 +12,12 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#if defined(BOOST_DATE_TIME_NO_LOCALE) +#if defined(AUTOBOOST_DATE_TIME_NO_LOCALE) #include // ::tolower(int) #else #include // std::tolower(char, locale) @@ -36,13 +36,13 @@ namespace date_time { std::string convert_to_lower(std::string inp) { -#if !defined(BOOST_DATE_TIME_NO_LOCALE) +#if !defined(AUTOBOOST_DATE_TIME_NO_LOCALE) const std::locale loc(std::locale::classic()); #endif std::string::size_type i = 0, n = inp.length(); for (; i < n; ++i) { inp[i] = -#if defined(BOOST_DATE_TIME_NO_LOCALE) +#if defined(AUTOBOOST_DATE_TIME_NO_LOCALE) static_cast(std::tolower(inp[i])); #else // tolower and others were brought in to std for borland >= v564 @@ -230,7 +230,7 @@ namespace date_time { wchar_t) { std::ostringstream ss; -#if !defined(BOOST_DATE_TIME_NO_LOCALE) +#if !defined(AUTOBOOST_DATE_TIME_NO_LOCALE) std::locale loc; std::ctype const& fac = std::use_facet >(loc); while(beg != end) { @@ -247,7 +247,7 @@ namespace date_time { #endif return parse_date(ss.str()); } -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING //! Helper function for 'date gregorian::from_stream()' /*! Creates a string from the first wstring found in the stream * referenced by the begining & end iterators */ @@ -260,7 +260,7 @@ namespace date_time { std::wstring ws = *beg; std::ostringstream ss; std::wstring::iterator wsb = ws.begin(), wse = ws.end(); -#if !defined(BOOST_DATE_TIME_NO_LOCALE) +#if !defined(AUTOBOOST_DATE_TIME_NO_LOCALE) std::locale loc; std::ctype const& fac = std::use_facet >(loc); while(wsb != wse) { @@ -277,8 +277,8 @@ namespace date_time { #endif return parse_date(ss.str()); } -#endif // BOOST_NO_STD_WSTRING -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#endif // AUTOBOOST_NO_STD_WSTRING +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) // This function cannot be compiled with MSVC 6.0 due to internal compiler shorcomings #else //! function called by wrapper functions: date_period_from_(w)string() diff --git a/contrib/autoboost/boost/date_time/dst_rules.hpp b/contrib/autoboost/autoboost/date_time/dst_rules.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/dst_rules.hpp rename to contrib/autoboost/autoboost/date_time/dst_rules.hpp index fcddd4f06..8d0f04828 100644 --- a/contrib/autoboost/boost/date_time/dst_rules.hpp +++ b/contrib/autoboost/autoboost/date_time/dst_rules.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_DST_RULES_HPP__ -#define DATE_TIME_DST_RULES_HPP__ +#ifndef AB_DATE_TIME_DST_RULES_HPP__ +#define AB_DATE_TIME_DST_RULES_HPP__ /* Copyright (c) 2002,2003, 2007 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -13,9 +13,9 @@ Contains template class to provide static dst rule calculations */ -#include "boost/date_time/date_generators.hpp" -#include "boost/date_time/period.hpp" -#include "boost/date_time/date_defs.hpp" +#include "autoboost/date_time/date_generators.hpp" +#include "autoboost/date_time/period.hpp" +#include "autoboost/date_time/date_defs.hpp" #include namespace autoboost { diff --git a/contrib/autoboost/autoboost/date_time/dst_transition_generators.hpp b/contrib/autoboost/autoboost/date_time/dst_transition_generators.hpp new file mode 100644 index 000000000..ab86dd9c5 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/dst_transition_generators.hpp @@ -0,0 +1,75 @@ +/* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + */ +#ifndef AB_DATE_TIME_DATE_DST_TRANSITION_DAY_GEN_HPP__ +#define AB_DATE_TIME_DATE_DST_TRANSITION_DAY_GEN_HPP__ + + + +namespace autoboost { +namespace date_time { + + //! Defines base interface for calculating start and end date of daylight savings + template + class dst_day_calc_rule + { + public: + typedef typename date_type::year_type year_type; + virtual ~dst_day_calc_rule() {} + virtual date_type start_day(year_type y) const=0; + virtual std::string start_rule_as_string() const=0; + virtual date_type end_day(year_type y) const=0; + virtual std::string end_rule_as_string() const=0; + + }; + + //! Canonical form for a class that provides day rule calculation + /*! This class is used to generate specific sets of dst rules + * + *@param spec Provides a specifiction of the function object types used + * to generate start and end days of daylight savings as well + * as the date type. + */ + template + class day_calc_dst_rule : public dst_day_calc_rule + { + public: + typedef typename spec::date_type date_type; + typedef typename date_type::year_type year_type; + typedef typename spec::start_rule start_rule; + typedef typename spec::end_rule end_rule; + day_calc_dst_rule(start_rule dst_start, + end_rule dst_end) : + dst_start_(dst_start), + dst_end_(dst_end) + {} + virtual date_type start_day(year_type y) const + { + return dst_start_.get_date(y); + } + virtual std::string start_rule_as_string() const + { + return dst_start_.to_string(); + } + virtual date_type end_day(year_type y) const + { + return dst_end_.get_date(y); + } + virtual std::string end_rule_as_string() const + { + return dst_end_.to_string(); + } + private: + start_rule dst_start_; + end_rule dst_end_; + }; + + +} }//namespace + + + +#endif diff --git a/contrib/autoboost/boost/date_time/filetime_functions.hpp b/contrib/autoboost/autoboost/date_time/filetime_functions.hpp similarity index 88% rename from contrib/autoboost/boost/date_time/filetime_functions.hpp rename to contrib/autoboost/autoboost/date_time/filetime_functions.hpp index c9cc47e39..1dd8c2aa4 100644 --- a/contrib/autoboost/boost/date_time/filetime_functions.hpp +++ b/contrib/autoboost/autoboost/date_time/filetime_functions.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_FILETIME_FUNCTIONS_HPP__ -#define DATE_TIME_FILETIME_FUNCTIONS_HPP__ +#ifndef AB_DATE_TIME_FILETIME_FUNCTIONS_HPP__ +#define AB_DATE_TIME_FILETIME_FUNCTIONS_HPP__ /* Copyright (c) 2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -12,20 +12,20 @@ /*! @file filetime_functions.hpp * Function(s) for converting between a FILETIME structure and a * time object. This file is only available on systems that have - * BOOST_HAS_FTIME defined. + * AUTOBOOST_HAS_FTIME defined. */ -#include +#include -#if defined(BOOST_HAS_FTIME) // skip this file if no FILETIME +#if defined(AUTOBOOST_HAS_FTIME) // skip this file if no FILETIME -#if defined(BOOST_USE_WINDOWS_H) +#if defined(AUTOBOOST_USE_WINDOWS_H) # include #endif -#include -#include -#include +#include +#include +#include namespace autoboost { @@ -33,7 +33,7 @@ namespace date_time { namespace winapi { -#if !defined(BOOST_USE_WINDOWS_H) +#if !defined(AUTOBOOST_USE_WINDOWS_H) extern "C" { @@ -61,19 +61,19 @@ namespace winapi { } // extern "C" -#endif // defined(BOOST_USE_WINDOWS_H) +#endif // defined(AUTOBOOST_USE_WINDOWS_H) typedef FILETIME file_time; typedef SYSTEMTIME system_time; inline void get_system_time_as_file_time(file_time& ft) { -#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) +#if AUTOBOOST_WORKAROUND(__MWERKS__, AUTOBOOST_TESTED_AT(0x3205)) // Some runtime library implementations expect local times as the norm for ctime. file_time ft_utc; GetSystemTimeAsFileTime(&ft_utc); FileTimeToLocalFileTime(&ft_utc, &ft); -#elif defined(BOOST_HAS_GETSYSTEMTIMEASFILETIME) +#elif defined(AUTOBOOST_HAS_GETSYSTEMTIMEASFILETIME) GetSystemTimeAsFileTime(&ft); #else system_time st; @@ -142,7 +142,7 @@ TimeT time_from_ftime(const FileTimeT& ft) uint64_t sec = caster.as_integer / 10000000UL; uint32_t sub_sec = (caster.as_integer % 10000000UL) // 100-nanoseconds since the last second -#if !defined(BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG) +#if !defined(AUTOBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG) / 10; // microseconds since the last second #else * 100; // nanoseconds since the last second @@ -165,6 +165,6 @@ TimeT time_from_ftime(const FileTimeT& ft) }} // autoboost::date_time -#endif // BOOST_HAS_FTIME +#endif // AUTOBOOST_HAS_FTIME #endif // DATE_TIME_FILETIME_FUNCTIONS_HPP__ diff --git a/contrib/autoboost/boost/date_time/format_date_parser.hpp b/contrib/autoboost/autoboost/date_time/format_date_parser.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/format_date_parser.hpp rename to contrib/autoboost/autoboost/date_time/format_date_parser.hpp index 718ac48c5..882b4b386 100644 --- a/contrib/autoboost/boost/date_time/format_date_parser.hpp +++ b/contrib/autoboost/autoboost/date_time/format_date_parser.hpp @@ -1,6 +1,6 @@ -#ifndef DATE_TIME_FORMAT_DATE_PARSER_HPP__ -#define DATE_TIME_FORMAT_DATE_PARSER_HPP__ +#ifndef AB_DATE_TIME_FORMAT_DATE_PARSER_HPP__ +#define AB_DATE_TIME_FORMAT_DATE_PARSER_HPP__ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -11,21 +11,21 @@ */ -#include "boost/lexical_cast.hpp" -#include "boost/date_time/string_parse_tree.hpp" -#include "boost/date_time/strings_from_facet.hpp" -#include "boost/date_time/special_values_parser.hpp" +#include "autoboost/lexical_cast.hpp" +#include "autoboost/date_time/string_parse_tree.hpp" +#include "autoboost/date_time/strings_from_facet.hpp" +#include "autoboost/date_time/special_values_parser.hpp" #include #include #include #include -#ifndef BOOST_NO_STDC_NAMESPACE +#ifndef AUTOBOOST_NO_STDC_NAMESPACE # include #else # include #endif -#ifdef BOOST_NO_STDC_NAMESPACE +#ifdef AUTOBOOST_NO_STDC_NAMESPACE namespace std { using ::isspace; using ::isdigit; diff --git a/contrib/autoboost/autoboost/date_time/gregorian/conversion.hpp b/contrib/autoboost/autoboost/date_time/gregorian/conversion.hpp new file mode 100644 index 000000000..39722c5ed --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/gregorian/conversion.hpp @@ -0,0 +1,68 @@ +#ifndef AB__GREGORIAN__CONVERSION_HPP___ +#define AB__GREGORIAN__CONVERSION_HPP___ + +/* Copyright (c) 2004-2005 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { + +namespace gregorian { + + //! Converts a date to a tm struct. Throws out_of_range exception if date is a special value + inline + std::tm to_tm(const date& d) + { + if (d.is_special()) + { + std::string s = "tm unable to handle "; + switch (d.as_special()) + { + case date_time::not_a_date_time: + s += "not-a-date-time value"; break; + case date_time::neg_infin: + s += "-infinity date value"; break; + case date_time::pos_infin: + s += "+infinity date value"; break; + default: + s += "a special date value"; break; + } + autoboost::throw_exception(std::out_of_range(s)); + } + + std::tm datetm; + std::memset(&datetm, 0, sizeof(datetm)); + autoboost::gregorian::date::ymd_type ymd = d.year_month_day(); + datetm.tm_year = ymd.year - 1900; + datetm.tm_mon = ymd.month - 1; + datetm.tm_mday = ymd.day; + datetm.tm_wday = d.day_of_week(); + datetm.tm_yday = d.day_of_year() - 1; + datetm.tm_isdst = -1; // negative because not enough info to set tm_isdst + return datetm; + } + + //! Converts a tm structure into a date dropping the any time values. + inline + date date_from_tm(const std::tm& datetm) + { + return date(static_cast(datetm.tm_year+1900), + static_cast(datetm.tm_mon+1), + static_cast(datetm.tm_mday)); + } + +} } //namespace autoboost::gregorian + +#endif diff --git a/contrib/autoboost/boost/date_time/gregorian/formatters.hpp b/contrib/autoboost/autoboost/date_time/gregorian/formatters.hpp similarity index 89% rename from contrib/autoboost/boost/date_time/gregorian/formatters.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/formatters.hpp index 0887ef813..2d6a21d24 100644 --- a/contrib/autoboost/boost/date_time/gregorian/formatters.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/formatters.hpp @@ -1,5 +1,5 @@ -#ifndef GREGORIAN_FORMATTERS_HPP___ -#define GREGORIAN_FORMATTERS_HPP___ +#ifndef AB_GREGORIAN_FORMATTERS_HPP___ +#define AB_GREGORIAN_FORMATTERS_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,18 +9,18 @@ * $Date$ */ -#include "boost/date_time/compiler_config.hpp" -#include "boost/date_time/gregorian/gregorian_types.hpp" -#if defined(BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) -#include "boost/date_time/date_formatting_limited.hpp" +#include "autoboost/date_time/compiler_config.hpp" +#include "autoboost/date_time/gregorian/gregorian_types.hpp" +#if defined(AUTOBOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) +#include "autoboost/date_time/date_formatting_limited.hpp" #else -#include "boost/date_time/date_formatting.hpp" +#include "autoboost/date_time/date_formatting.hpp" #endif -#include "boost/date_time/iso_format.hpp" -#include "boost/date_time/date_format_simple.hpp" +#include "autoboost/date_time/iso_format.hpp" +#include "autoboost/date_time/date_format_simple.hpp" /* NOTE: "to_*_string" code for older compilers, ones that define - * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in + * AUTOBOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * formatters_limited.hpp */ @@ -119,7 +119,7 @@ namespace gregorian { } -#if !defined(BOOST_NO_STD_WSTRING) +#if !defined(AUTOBOOST_NO_STD_WSTRING) //! Convert date period to simple string. Example: [2002-Jan-01/2002-Jan-02] /*!\ingroup date_format */ @@ -153,7 +153,7 @@ namespace gregorian { inline std::wstring to_sql_wstring(const date& d) { return to_sql_string_type(d); } -#endif // BOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_STD_WSTRING } } //namespace gregorian diff --git a/contrib/autoboost/boost/date_time/gregorian/formatters_limited.hpp b/contrib/autoboost/autoboost/date_time/gregorian/formatters_limited.hpp similarity index 86% rename from contrib/autoboost/boost/date_time/gregorian/formatters_limited.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/formatters_limited.hpp index b5df25e13..5a673fdb6 100644 --- a/contrib/autoboost/boost/date_time/gregorian/formatters_limited.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/formatters_limited.hpp @@ -1,5 +1,5 @@ -#ifndef GREGORIAN_FORMATTERS_LIMITED_HPP___ -#define GREGORIAN_FORMATTERS_LIMITED_HPP___ +#ifndef AB_GREGORIAN_FORMATTERS_LIMITED_HPP___ +#define AB_GREGORIAN_FORMATTERS_LIMITED_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,11 +9,11 @@ * $Date$ */ -#include "boost/date_time/gregorian/gregorian_types.hpp" -#include "boost/date_time/date_formatting_limited.hpp" -#include "boost/date_time/iso_format.hpp" -#include "boost/date_time/date_format_simple.hpp" -#include "boost/date_time/compiler_config.hpp" +#include "autoboost/date_time/gregorian/gregorian_types.hpp" +#include "autoboost/date_time/date_formatting_limited.hpp" +#include "autoboost/date_time/iso_format.hpp" +#include "autoboost/date_time/date_format_simple.hpp" +#include "autoboost/date_time/compiler_config.hpp" namespace autoboost { namespace gregorian { diff --git a/contrib/autoboost/autoboost/date_time/gregorian/greg_calendar.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_calendar.hpp new file mode 100644 index 000000000..49aee12e7 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_calendar.hpp @@ -0,0 +1,48 @@ +#ifndef AB_GREGORIAN_GREGORIAN_CALENDAR_HPP__ +#define AB_GREGORIAN_GREGORIAN_CALENDAR_HPP__ + +/* Copyright (c) 2002,2003 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland + * $Date$ + */ + +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace gregorian { + + //!An internal date representation that includes infinities, not a date + typedef date_time::int_adapter fancy_date_rep; + + //! Gregorian calendar for this implementation, hard work in the base + class gregorian_calendar : + public date_time::gregorian_calendar_base { + public: + //! Type to hold a weekday (eg: Sunday, Monday,...) + typedef greg_weekday day_of_week_type; + //! Counter type from 1 to 366 for gregorian dates. + typedef greg_day_of_year_rep day_of_year_type; + //! Internal date representation that handles infinity, not a date + typedef fancy_date_rep date_rep_type; + //! Date rep implements the traits stuff as well + typedef fancy_date_rep date_traits_type; + + + private: + }; + +} } //namespace gregorian + + + + +#endif + diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_date.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_date.hpp similarity index 93% rename from contrib/autoboost/boost/date_time/gregorian/greg_date.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_date.hpp index 659d97e4c..6e9549c06 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_date.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_date.hpp @@ -1,5 +1,5 @@ -#ifndef GREG_DATE_HPP___ -#define GREG_DATE_HPP___ +#ifndef AB_GREG_DATE_HPP___ +#define AB_GREG_DATE_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,11 +9,11 @@ * $Date$ */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace autoboost { namespace gregorian { diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_day.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_day.hpp similarity index 93% rename from contrib/autoboost/boost/date_time/gregorian/greg_day.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_day.hpp index 86615eb78..506b4a7eb 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_day.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_day.hpp @@ -1,5 +1,5 @@ -#ifndef GREG_DAY_HPP___ -#define GREG_DAY_HPP___ +#ifndef AB_GREG_DAY_HPP___ +#define AB_GREG_DAY_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,7 +9,7 @@ * $Date$ */ -#include "boost/date_time/constrained_value.hpp" +#include "autoboost/date_time/constrained_value.hpp" #include #include diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_day_of_year.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_day_of_year.hpp similarity index 88% rename from contrib/autoboost/boost/date_time/gregorian/greg_day_of_year.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_day_of_year.hpp index 773a20ed6..8d7829b15 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_day_of_year.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_day_of_year.hpp @@ -1,5 +1,5 @@ -#ifndef GREG_DAY_OF_YEAR_HPP___ -#define GREG_DAY_OF_YEAR_HPP___ +#ifndef AB_GREG_DAY_OF_YEAR_HPP___ +#define AB_GREG_DAY_OF_YEAR_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,7 +9,7 @@ * $Date$ */ -#include "boost/date_time/constrained_value.hpp" +#include "autoboost/date_time/constrained_value.hpp" #include #include diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_duration.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_duration.hpp similarity index 91% rename from contrib/autoboost/boost/date_time/gregorian/greg_duration.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_duration.hpp index 0ca19b5ea..28afbfc13 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_duration.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_duration.hpp @@ -1,5 +1,5 @@ -#ifndef GREG_DURATION_HPP___ -#define GREG_DURATION_HPP___ +#ifndef AB_GREG_DURATION_HPP___ +#define AB_GREG_DURATION_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,9 +9,9 @@ * $Date$ */ -#include -#include -#include +#include +#include +#include namespace autoboost { namespace gregorian { @@ -127,8 +127,8 @@ namespace gregorian { } } //namespace gregorian -#if defined(BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) -#include +#if defined(AUTOBOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) +#include #endif #endif diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_duration_types.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_duration_types.hpp similarity index 76% rename from contrib/autoboost/boost/date_time/gregorian/greg_duration_types.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_duration_types.hpp index 074ac2dbd..f511958df 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_duration_types.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_duration_types.hpp @@ -1,5 +1,5 @@ -#ifndef GREG_DURATION_TYPES_HPP___ -#define GREG_DURATION_TYPES_HPP___ +#ifndef AB_GREG_DURATION_TYPES_HPP___ +#define AB_GREG_DURATION_TYPES_HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * Subject to Boost Software License, Version 1.0. (See accompanying @@ -9,11 +9,11 @@ */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace autoboost { namespace gregorian { diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_facet.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_facet.hpp similarity index 93% rename from contrib/autoboost/boost/date_time/gregorian/greg_facet.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_facet.hpp index e739d4741..4698d304e 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_facet.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_facet.hpp @@ -1,5 +1,5 @@ -#ifndef GREGORIAN_FACET_HPP___ -#define GREGORIAN_FACET_HPP___ +#ifndef AB_GREGORIAN_FACET_HPP___ +#define AB_GREGORIAN_FACET_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,12 +9,12 @@ * $Date$ */ -#include "boost/date_time/gregorian/gregorian_types.hpp" -#include "boost/date_time/date_formatting_locales.hpp" // sets BOOST_DATE_TIME_NO_LOCALE -#include "boost/date_time/gregorian/parsers.hpp" +#include "autoboost/date_time/gregorian/gregorian_types.hpp" +#include "autoboost/date_time/date_formatting_locales.hpp" // sets AUTOBOOST_DATE_TIME_NO_LOCALE +#include "autoboost/date_time/gregorian/parsers.hpp" //This file is basically commented out if locales are not supported -#ifndef BOOST_DATE_TIME_NO_LOCALE +#ifndef AUTOBOOST_DATE_TIME_NO_LOCALE #include #include @@ -207,7 +207,7 @@ namespace gregorian { #endif // USE_DATE_TIME_PRE_1_33_FACET_IO /**************** Input Streaming ******************/ -#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) +#if !defined(AUTOBOOST_NO_STD_ITERATOR_TRAITS) //! operator>> for gregorian::date template inline @@ -217,7 +217,7 @@ namespace gregorian { d = from_stream(beg, eos); return is; } -#endif // BOOST_NO_STD_ITERATOR_TRAITS +#endif // AUTOBOOST_NO_STD_ITERATOR_TRAITS //! operator>> for gregorian::date_duration template @@ -244,21 +244,21 @@ namespace gregorian { } //! generates a locale with the set of gregorian name-strings of type char* - BOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, char type); + AUTOBOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, char type); //! Returns a pointer to a facet with a default set of names (English) /* Necessary in the event an exception is thrown from op>> for * weekday or month. See comments in those functions for more info */ - BOOST_DATE_TIME_DECL autoboost::date_time::all_date_names_put* create_facet_def(char type); + AUTOBOOST_DATE_TIME_DECL autoboost::date_time::all_date_names_put* create_facet_def(char type); -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING //! generates a locale with the set of gregorian name-strings of type wchar_t* - BOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, wchar_t type); + AUTOBOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, wchar_t type); //! Returns a pointer to a facet with a default set of names (English) /* Necessary in the event an exception is thrown from op>> for * weekday or month. See comments in those functions for more info */ - BOOST_DATE_TIME_DECL autoboost::date_time::all_date_names_put* create_facet_def(wchar_t type); -#endif // BOOST_NO_STD_WSTRING + AUTOBOOST_DATE_TIME_DECL autoboost::date_time::all_date_names_put* create_facet_def(wchar_t type); +#endif // AUTOBOOST_NO_STD_WSTRING //! operator>> for gregorian::greg_month - throws exception if invalid month given template diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_month.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_month.hpp similarity index 87% rename from contrib/autoboost/boost/date_time/gregorian/greg_month.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_month.hpp index 82488d8c6..f5537972f 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_month.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_month.hpp @@ -1,5 +1,5 @@ -#ifndef GREG_MONTH_HPP___ -#define GREG_MONTH_HPP___ +#ifndef AB_GREG_MONTH_HPP___ +#define AB_GREG_MONTH_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,10 +9,10 @@ * $Date$ */ -#include "boost/date_time/constrained_value.hpp" -#include "boost/date_time/date_defs.hpp" -#include "boost/shared_ptr.hpp" -#include "boost/date_time/compiler_config.hpp" +#include "autoboost/date_time/constrained_value.hpp" +#include "autoboost/date_time/date_defs.hpp" +#include "autoboost/shared_ptr.hpp" +#include "autoboost/date_time/compiler_config.hpp" #include #include #include @@ -52,7 +52,7 @@ namespace gregorian { //! Wrapper class to represent months in gregorian based calendar - class BOOST_DATE_TIME_DECL greg_month : public greg_month_rep { + class AUTOBOOST_DATE_TIME_DECL greg_month : public greg_month_rep { public: typedef date_time::months_of_year month_enum; typedef std::map month_map_type; @@ -69,10 +69,10 @@ namespace gregorian { month_enum as_enum() const {return static_cast(value_);} const char* as_short_string() const; const char* as_long_string() const; -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING const wchar_t* as_short_wstring() const; const wchar_t* as_long_wstring() const; -#endif // BOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_STD_WSTRING //! Shared pointer to a map of Month strings (Names & Abbrev) & numbers static month_map_ptr_type get_month_map_ptr(); @@ -86,7 +86,7 @@ namespace gregorian { { return as_long_string(); } -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING const wchar_t* as_short_string(wchar_t) const { return as_short_wstring(); @@ -95,7 +95,7 @@ namespace gregorian { { return as_long_wstring(); } -#endif // BOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_STD_WSTRING }; } } //namespace gregorian diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_weekday.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_weekday.hpp similarity index 81% rename from contrib/autoboost/boost/date_time/gregorian/greg_weekday.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_weekday.hpp index a2ee1db39..50583e222 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_weekday.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_weekday.hpp @@ -1,5 +1,5 @@ -#ifndef GREG_WEEKDAY_HPP___ -#define GREG_WEEKDAY_HPP___ +#ifndef AB_GREG_WEEKDAY_HPP___ +#define AB_GREG_WEEKDAY_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,9 +9,9 @@ * $Date$ */ -#include "boost/date_time/constrained_value.hpp" -#include "boost/date_time/date_defs.hpp" -#include "boost/date_time/compiler_config.hpp" +#include "autoboost/date_time/constrained_value.hpp" +#include "autoboost/date_time/date_defs.hpp" +#include "autoboost/date_time/compiler_config.hpp" #include #include @@ -38,7 +38,7 @@ namespace gregorian { //! Represent a day within a week (range 0==Sun to 6==Sat) - class BOOST_DATE_TIME_DECL greg_weekday : public greg_weekday_rep { + class AUTOBOOST_DATE_TIME_DECL greg_weekday : public greg_weekday_rep { public: typedef autoboost::date_time::weekdays weekday_enum; greg_weekday(unsigned short day_of_week_num) : @@ -48,10 +48,10 @@ namespace gregorian { unsigned short as_number() const {return value_;} const char* as_short_string() const; const char* as_long_string() const; -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING const wchar_t* as_short_wstring() const; const wchar_t* as_long_wstring() const; -#endif // BOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_STD_WSTRING weekday_enum as_enum() const {return static_cast(value_);} diff --git a/contrib/autoboost/boost/date_time/gregorian/greg_year.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_year.hpp similarity index 93% rename from contrib/autoboost/boost/date_time/gregorian/greg_year.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/greg_year.hpp index 3ba5beeb1..503e8fc34 100644 --- a/contrib/autoboost/boost/date_time/gregorian/greg_year.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_year.hpp @@ -1,5 +1,5 @@ -#ifndef GREG_YEAR_HPP___ -#define GREG_YEAR_HPP___ +#ifndef AB_GREG_YEAR_HPP___ +#define AB_GREG_YEAR_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,7 +9,7 @@ * $Date$ */ -#include "boost/date_time/constrained_value.hpp" +#include "autoboost/date_time/constrained_value.hpp" #include #include diff --git a/contrib/autoboost/autoboost/date_time/gregorian/greg_ymd.hpp b/contrib/autoboost/autoboost/date_time/gregorian/greg_ymd.hpp new file mode 100644 index 000000000..18e213eb0 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/gregorian/greg_ymd.hpp @@ -0,0 +1,33 @@ +#ifndef AB_DATE_TIME_GREG_YMD_HPP__ +#define AB_DATE_TIME_GREG_YMD_HPP__ + +/* Copyright (c) 2002,2003 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland + * $Date$ + */ + +#include "autoboost/date_time/year_month_day.hpp" +#include "autoboost/date_time/special_defs.hpp" +#include "autoboost/date_time/gregorian/greg_day.hpp" +#include "autoboost/date_time/gregorian/greg_year.hpp" +#include "autoboost/date_time/gregorian/greg_month.hpp" + +namespace autoboost { +namespace gregorian { + + typedef date_time::year_month_day_base greg_year_month_day; + + + +} } //namespace gregorian + + + + +#endif + diff --git a/contrib/autoboost/autoboost/date_time/gregorian/gregorian.hpp b/contrib/autoboost/autoboost/date_time/gregorian/gregorian.hpp new file mode 100644 index 000000000..4ee1fa4ce --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/gregorian/gregorian.hpp @@ -0,0 +1,38 @@ +#ifndef AB_GREGORIAN_HPP__ +#define AB_GREGORIAN_HPP__ + +/* Copyright (c) 2002-2004 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +/*! @file gregorian.hpp + Single file header that provides overall include for all elements of + the gregorian date-time system. This includes the various types + defined, but also other functions for formatting and parsing. +*/ + + +#include "autoboost/date_time/compiler_config.hpp" +#include "autoboost/date_time/gregorian/gregorian_types.hpp" +#include "autoboost/date_time/gregorian/conversion.hpp" +#if defined(AUTOBOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) +#include "autoboost/date_time/gregorian/formatters_limited.hpp" +#else +#include "autoboost/date_time/gregorian/formatters.hpp" +#endif + +#if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) +#include "autoboost/date_time/gregorian/greg_facet.hpp" +#else +#include "autoboost/date_time/gregorian/gregorian_io.hpp" +#endif // USE_DATE_TIME_PRE_1_33_FACET_IO + +#include "autoboost/date_time/gregorian/parsers.hpp" + + + +#endif diff --git a/contrib/autoboost/boost/date_time/gregorian/gregorian_io.hpp b/contrib/autoboost/autoboost/date_time/gregorian/gregorian_io.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/gregorian/gregorian_io.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/gregorian_io.hpp index 1c6d610e9..418bb802b 100644 --- a/contrib/autoboost/boost/date_time/gregorian/gregorian_io.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/gregorian_io.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_GREGORIAN_IO_HPP__ -#define DATE_TIME_GREGORIAN_IO_HPP__ +#ifndef AB_DATE_TIME_GREGORIAN_IO_HPP__ +#define AB_DATE_TIME_GREGORIAN_IO_HPP__ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -12,14 +12,14 @@ #include #include #include // i/ostreambuf_iterator -#include -#include -#include -#include -#include -#include -#include -#include // to_tm will be needed in the facets +#include +#include +#include +#include +#include +#include +#include +#include // to_tm will be needed in the facets namespace autoboost { namespace gregorian { diff --git a/contrib/autoboost/boost/date_time/gregorian/gregorian_types.hpp b/contrib/autoboost/autoboost/date_time/gregorian/gregorian_types.hpp similarity index 82% rename from contrib/autoboost/boost/date_time/gregorian/gregorian_types.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/gregorian_types.hpp index 0e56cd90a..0ae8aa164 100644 --- a/contrib/autoboost/boost/date_time/gregorian/gregorian_types.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/gregorian_types.hpp @@ -1,5 +1,5 @@ -#ifndef _GREGORIAN_TYPES_HPP__ -#define _GREGORIAN_TYPES_HPP__ +#ifndef AB__GREGORIAN_TYPES_HPP__ +#define AB__GREGORIAN_TYPES_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -14,18 +14,18 @@ date-time system. */ -#include "boost/date_time/date.hpp" -#include "boost/date_time/period.hpp" -#include "boost/date_time/gregorian/greg_calendar.hpp" -#include "boost/date_time/gregorian/greg_duration.hpp" -#if defined(BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) -#include "boost/date_time/gregorian/greg_duration_types.hpp" +#include "autoboost/date_time/date.hpp" +#include "autoboost/date_time/period.hpp" +#include "autoboost/date_time/gregorian/greg_calendar.hpp" +#include "autoboost/date_time/gregorian/greg_duration.hpp" +#if defined(AUTOBOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) +#include "autoboost/date_time/gregorian/greg_duration_types.hpp" #endif -#include "boost/date_time/gregorian/greg_date.hpp" -#include "boost/date_time/date_generators.hpp" -#include "boost/date_time/date_clock_device.hpp" -#include "boost/date_time/date_iterator.hpp" -#include "boost/date_time/adjust_functors.hpp" +#include "autoboost/date_time/gregorian/greg_date.hpp" +#include "autoboost/date_time/date_generators.hpp" +#include "autoboost/date_time/date_clock_device.hpp" +#include "autoboost/date_time/date_iterator.hpp" +#include "autoboost/date_time/adjust_functors.hpp" namespace autoboost { diff --git a/contrib/autoboost/boost/date_time/gregorian/parsers.hpp b/contrib/autoboost/autoboost/date_time/gregorian/parsers.hpp similarity index 85% rename from contrib/autoboost/boost/date_time/gregorian/parsers.hpp rename to contrib/autoboost/autoboost/date_time/gregorian/parsers.hpp index 1c7f39b23..ba63a12bc 100644 --- a/contrib/autoboost/boost/date_time/gregorian/parsers.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian/parsers.hpp @@ -1,5 +1,5 @@ -#ifndef GREGORIAN_PARSERS_HPP___ -#define GREGORIAN_PARSERS_HPP___ +#ifndef AB_GREGORIAN_PARSERS_HPP___ +#define AB_GREGORIAN_PARSERS_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,10 +9,10 @@ * $Date$ */ -#include "boost/date_time/gregorian/gregorian_types.hpp" -#include "boost/date_time/date_parsing.hpp" -#include "boost/date_time/compiler_config.hpp" -#include "boost/date_time/parse_format_base.hpp" +#include "autoboost/date_time/gregorian/gregorian_types.hpp" +#include "autoboost/date_time/date_parsing.hpp" +#include "autoboost/date_time/compiler_config.hpp" +#include "autoboost/date_time/parse_format_base.hpp" #include #include @@ -23,7 +23,7 @@ namespace gregorian { /*! Return special_value from string argument. If argument is * not one of the special value names (defined in src/gregorian/names.hpp), * return 'not_special' */ - BOOST_DATE_TIME_DECL special_values special_value_from_string(const std::string& s); + AUTOBOOST_DATE_TIME_DECL special_values special_value_from_string(const std::string& s); //! Deprecated: Use from_simple_string inline date from_string(std::string s) { @@ -55,7 +55,7 @@ namespace gregorian { return date_time::parse_undelimited_date(s); } -#if !(defined(BOOST_NO_STD_ITERATOR_TRAITS)) +#if !(defined(AUTOBOOST_NO_STD_ITERATOR_TRAITS)) //! Stream should hold a date in the form of: 2002-1-25. Month number, abbrev, or name are accepted /* Arguments passed in by-value for convertability of char[] * to iterator_type. Calls to from_stream_type are by-reference @@ -69,7 +69,7 @@ namespace gregorian { typedef typename std::iterator_traits::value_type value_type; return date_time::from_stream_type(beg, end, value_type()); } -#endif //BOOST_NO_STD_ITERATOR_TRAITS +#endif //AUTOBOOST_NO_STD_ITERATOR_TRAITS #if (defined(_MSC_VER) && (_MSC_VER < 1300)) // This function cannot be compiled with MSVC 6.0 due to internal compiler shorcomings @@ -78,12 +78,12 @@ namespace gregorian { inline date_period date_period_from_string(const std::string& s){ return date_time::from_simple_string_type(s); } -# if !defined(BOOST_NO_STD_WSTRING) +# if !defined(AUTOBOOST_NO_STD_WSTRING) //! Function to parse a date_period from a wstring (eg: [2003-Oct-31/2003-Dec-25]) inline date_period date_period_from_wstring(const std::wstring& s){ return date_time::from_simple_string_type(s); } -# endif // BOOST_NO_STD_WSTRING +# endif // AUTOBOOST_NO_STD_WSTRING #endif } } //namespace gregorian diff --git a/contrib/autoboost/boost/date_time/gregorian_calendar.hpp b/contrib/autoboost/autoboost/date_time/gregorian_calendar.hpp similarity index 92% rename from contrib/autoboost/boost/date_time/gregorian_calendar.hpp rename to contrib/autoboost/autoboost/date_time/gregorian_calendar.hpp index ad842db43..2a4e865bc 100644 --- a/contrib/autoboost/boost/date_time/gregorian_calendar.hpp +++ b/contrib/autoboost/autoboost/date_time/gregorian_calendar.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_GREGORIAN_CALENDAR_HPP__ -#define DATE_TIME_GREGORIAN_CALENDAR_HPP__ +#ifndef AB_DATE_TIME_GREGORIAN_CALENDAR_HPP__ +#define AB_DATE_TIME_GREGORIAN_CALENDAR_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -59,8 +59,8 @@ namespace date_time { } } //namespace -#ifndef NO_BOOST_DATE_TIME_INLINE -#include "boost/date_time/gregorian_calendar.ipp" +#ifndef NO_AUTOBOOST_DATE_TIME_INLINE +#include "autoboost/date_time/gregorian_calendar.ipp" #endif diff --git a/contrib/autoboost/boost/date_time/gregorian_calendar.ipp b/contrib/autoboost/autoboost/date_time/gregorian_calendar.ipp similarity index 94% rename from contrib/autoboost/boost/date_time/gregorian_calendar.ipp rename to contrib/autoboost/autoboost/date_time/gregorian_calendar.ipp index 5c5f9d867..4641bbabe 100644 --- a/contrib/autoboost/boost/date_time/gregorian_calendar.ipp +++ b/contrib/autoboost/autoboost/date_time/gregorian_calendar.ipp @@ -6,9 +6,9 @@ * $Date$ */ -#ifndef NO_BOOST_DATE_TIME_INLINE - #undef BOOST_DATE_TIME_INLINE - #define BOOST_DATE_TIME_INLINE inline +#ifndef NO_AUTOBOOST_DATE_TIME_INLINE + #undef AUTOBOOST_DATE_TIME_INLINE + #define AUTOBOOST_DATE_TIME_INLINE inline #endif namespace autoboost { @@ -17,7 +17,7 @@ namespace date_time { /*! Converts a year-month-day into a day of the week number */ template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE unsigned short gregorian_calendar_base::day_of_week(const ymd_type& ymd) { unsigned short a = static_cast((14-ymd.month)/12); @@ -35,7 +35,7 @@ namespace date_time { Reference for this algorithm is the Calendar FAQ by Claus Tondering, April 2000. */ template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE int gregorian_calendar_base::week_number(const ymd_type& ymd) { unsigned long julianbegin = julian_day_number(ymd_type(ymd.year,1,1)); @@ -71,7 +71,7 @@ namespace date_time { /*! The day number is an absolute number of days since the start of count */ template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE date_int_type_ gregorian_calendar_base::day_number(const ymd_type& ymd) { @@ -86,7 +86,7 @@ namespace date_time { /*! Since this implementation uses julian day internally, this is the same as the day_number. */ template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE date_int_type_ gregorian_calendar_base::julian_day_number(const ymd_type& ymd) { @@ -98,7 +98,7 @@ namespace date_time { * MJD 0 thus started on 17 Nov 1858(Gregorian) at 00:00:00 UTC */ template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE date_int_type_ gregorian_calendar_base::modjulian_day_number(const ymd_type& ymd) { @@ -107,7 +107,7 @@ namespace date_time { //! Change a day number into a year-month-day template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE ymd_type_ gregorian_calendar_base::from_day_number(date_int_type dayNumber) { @@ -127,7 +127,7 @@ namespace date_time { //! Change a day number into a year-month-day template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE ymd_type_ gregorian_calendar_base::from_julian_day_number(date_int_type dayNumber) { @@ -147,7 +147,7 @@ namespace date_time { //! Change a modified julian day number into a year-month-day template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE ymd_type_ gregorian_calendar_base::from_modjulian_day_number(date_int_type dayNumber) { date_int_type jd = dayNumber + 2400001; //is 2400000.5 prerounded @@ -159,7 +159,7 @@ namespace date_time { *@return true if year is a leap year, false otherwise */ template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE bool gregorian_calendar_base::is_leap_year(year_type year) { @@ -172,7 +172,7 @@ namespace date_time { * No error checking is performed. */ template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE unsigned short gregorian_calendar_base::end_of_month_day(year_type year, month_type month) @@ -197,7 +197,7 @@ namespace date_time { //! Provide the ymd_type specification for the calandar start template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE ymd_type_ gregorian_calendar_base::epoch() { @@ -206,7 +206,7 @@ namespace date_time { //! Defines length of a week for week calculations template - BOOST_DATE_TIME_INLINE + AUTOBOOST_DATE_TIME_INLINE unsigned short gregorian_calendar_base::days_in_week() { diff --git a/contrib/autoboost/boost/date_time/int_adapter.hpp b/contrib/autoboost/autoboost/date_time/int_adapter.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/int_adapter.hpp rename to contrib/autoboost/autoboost/date_time/int_adapter.hpp index 3b8e9cd79..615e736b1 100644 --- a/contrib/autoboost/boost/date_time/int_adapter.hpp +++ b/contrib/autoboost/autoboost/date_time/int_adapter.hpp @@ -1,5 +1,5 @@ -#ifndef _DATE_TIME_INT_ADAPTER_HPP__ -#define _DATE_TIME_INT_ADAPTER_HPP__ +#ifndef AB__DATE_TIME_INT_ADAPTER_HPP__ +#define AB__DATE_TIME_INT_ADAPTER_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -10,11 +10,11 @@ */ -#include "boost/config.hpp" -#include "boost/limits.hpp" //work around compilers without limits -#include "boost/date_time/special_defs.hpp" -#include "boost/date_time/locale_config.hpp" -#ifndef BOOST_DATE_TIME_NO_LOCALE +#include "autoboost/config.hpp" +#include "autoboost/limits.hpp" //work around compilers without limits +#include "autoboost/date_time/special_defs.hpp" +#include "autoboost/date_time/locale_config.hpp" +#ifndef AUTOBOOST_DATE_TIME_NO_LOCALE # include #endif @@ -59,11 +59,11 @@ class int_adapter { { return (::std::numeric_limits::max)()-1; } - static int_adapter max BOOST_PREVENT_MACRO_SUBSTITUTION () + static int_adapter max AUTOBOOST_PREVENT_MACRO_SUBSTITUTION () { return (::std::numeric_limits::max)()-2; } - static int_adapter min BOOST_PREVENT_MACRO_SUBSTITUTION () + static int_adapter min AUTOBOOST_PREVENT_MACRO_SUBSTITUTION () { return (::std::numeric_limits::min)()+1; } @@ -467,7 +467,7 @@ class int_adapter { }; -#ifndef BOOST_DATE_TIME_NO_LOCALE +#ifndef AUTOBOOST_DATE_TIME_NO_LOCALE /*! Expected output is either a numeric representation * or a special values representation.
* Ex. "12", "+infinity", "not-a-number", etc. */ diff --git a/contrib/autoboost/boost/date_time/iso_format.hpp b/contrib/autoboost/autoboost/date_time/iso_format.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/iso_format.hpp rename to contrib/autoboost/autoboost/date_time/iso_format.hpp index 483d1f1eb..786267562 100644 --- a/contrib/autoboost/boost/date_time/iso_format.hpp +++ b/contrib/autoboost/autoboost/date_time/iso_format.hpp @@ -1,5 +1,5 @@ -#ifndef ISO_FORMAT_HPP___ -#define ISO_FORMAT_HPP___ +#ifndef AB_ISO_FORMAT_HPP___ +#define AB_ISO_FORMAT_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,7 +9,7 @@ * $Date$ */ -#include "boost/date_time/parse_format_base.hpp" +#include "autoboost/date_time/parse_format_base.hpp" namespace autoboost { namespace date_time { @@ -141,7 +141,7 @@ class iso_format_base { }; -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING //! Class to provide common iso formatting spec template<> @@ -270,7 +270,7 @@ class iso_format_base { }; -#endif // BOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_STD_WSTRING //! Format description for iso normal YYYYMMDD template diff --git a/contrib/autoboost/autoboost/date_time/local_time/conversion.hpp b/contrib/autoboost/autoboost/date_time/local_time/conversion.hpp new file mode 100644 index 000000000..0517effa0 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/conversion.hpp @@ -0,0 +1,34 @@ +#ifndef AB_DATE_TIME_LOCAL_TIME_CONVERSION_HPP__ +#define AB_DATE_TIME_LOCAL_TIME_CONVERSION_HPP__ + +/* Copyright (c) 2003-2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + + +#include "autoboost/date_time/posix_time/conversion.hpp" +#include "autoboost/date_time/c_time.hpp" +#include "autoboost/date_time/local_time/local_date_time.hpp" + +namespace autoboost { +namespace local_time { + +//! Function that creates a tm struct from a local_date_time +inline +std::tm to_tm(const local_date_time& lt) { + std::tm lt_tm = posix_time::to_tm(lt.local_time()); + if(lt.is_dst()){ + lt_tm.tm_isdst = 1; + } + else{ + lt_tm.tm_isdst = 0; + } + return lt_tm; +} + + +}} // namespaces +#endif // DATE_TIME_LOCAL_TIME_CONVERSION_HPP__ diff --git a/contrib/autoboost/autoboost/date_time/local_time/custom_time_zone.hpp b/contrib/autoboost/autoboost/date_time/local_time/custom_time_zone.hpp new file mode 100644 index 000000000..7fdf443a4 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/custom_time_zone.hpp @@ -0,0 +1,169 @@ +#ifndef AB_LOCAL_TIME_CUSTOM_TIME_ZONE_HPP__ +#define AB_LOCAL_TIME_CUSTOM_TIME_ZONE_HPP__ + +/* Copyright (c) 2003-2005 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include "autoboost/date_time/time_zone_base.hpp" +#include "autoboost/date_time/time_zone_names.hpp" +#include "autoboost/date_time/posix_time/posix_time.hpp" +#include "autoboost/date_time/local_time/dst_transition_day_rules.hpp" +#include "autoboost/date_time/string_convert.hpp" +//#include "autoboost/date_time/special_defs.hpp" +#include "autoboost/shared_ptr.hpp" + +namespace autoboost { +namespace local_time { + + //typedef autoboost::date_time::time_zone_names time_zone_names; + typedef autoboost::date_time::dst_adjustment_offsets dst_adjustment_offsets; + //typedef autoboost::date_time::time_zone_base time_zone; + typedef autoboost::shared_ptr dst_calc_rule_ptr; + + //! A real time zone + template + class custom_time_zone_base : public date_time::time_zone_base { + public: + typedef autoboost::posix_time::time_duration time_duration_type; + typedef date_time::time_zone_base base_type; + typedef typename base_type::string_type string_type; + typedef typename base_type::stringstream_type stringstream_type; + typedef date_time::time_zone_names_base time_zone_names; + typedef CharT char_type; + + custom_time_zone_base(const time_zone_names& zone_names, + const time_duration_type& utc_offset, + const dst_adjustment_offsets& dst_shift, + autoboost::shared_ptr calc_rule) : + zone_names_(zone_names), + base_utc_offset_(utc_offset), + dst_offsets_(dst_shift), + dst_calc_rules_(calc_rule) + {} + virtual ~custom_time_zone_base() {} + virtual string_type dst_zone_abbrev() const + { + return zone_names_.dst_zone_abbrev(); + } + virtual string_type std_zone_abbrev() const + { + return zone_names_.std_zone_abbrev(); + } + virtual string_type dst_zone_name() const + { + return zone_names_.dst_zone_name(); + } + virtual string_type std_zone_name() const + { + return zone_names_.std_zone_name(); + } + //! True if zone uses daylight savings adjustments + virtual bool has_dst() const + { + return (bool) dst_calc_rules_; //if calc_rule is set the tz has dst + } + //! Local time that DST starts -- NADT if has_dst is false + virtual posix_time::ptime dst_local_start_time(gregorian::greg_year y) const + { + gregorian::date d(gregorian::not_a_date_time); + if (dst_calc_rules_) { + d = dst_calc_rules_->start_day(y); + } + return posix_time::ptime(d, dst_offsets_.dst_start_offset_); + } + //! Local time that DST ends -- NADT if has_dst is false + virtual posix_time::ptime dst_local_end_time(gregorian::greg_year y) const + { + gregorian::date d(gregorian::not_a_date_time); + if (dst_calc_rules_) { + d = dst_calc_rules_->end_day(y); + } + return posix_time::ptime(d, dst_offsets_.dst_end_offset_); + } + //! Base offset from UTC for zone (eg: -07:30:00) + virtual time_duration_type base_utc_offset() const + { + return base_utc_offset_; + } + //! Adjustment forward or back made while DST is in effect + virtual time_duration_type dst_offset() const + { + return dst_offsets_.dst_adjust_; + } + //! Returns a POSIX time_zone string for this object + virtual string_type to_posix_string() const + { + // std offset dst [offset],start[/time],end[/time] - w/o spaces + stringstream_type ss; + ss.fill('0'); + autoboost::shared_ptr no_rules; + // std + ss << std_zone_abbrev(); + // offset + if(base_utc_offset().is_negative()) { + // inverting the sign guarantees we get two digits + ss << '-' << std::setw(2) << base_utc_offset().invert_sign().hours(); + } + else { + ss << '+' << std::setw(2) << base_utc_offset().hours(); + } + if(base_utc_offset().minutes() != 0 || base_utc_offset().seconds() != 0) { + ss << ':' << std::setw(2) << base_utc_offset().minutes(); + if(base_utc_offset().seconds() != 0) { + ss << ':' << std::setw(2) << base_utc_offset().seconds(); + } + } + if(dst_calc_rules_ != no_rules) { + // dst + ss << dst_zone_abbrev(); + // dst offset + if(dst_offset().is_negative()) { + // inverting the sign guarantees we get two digits + ss << '-' << std::setw(2) << dst_offset().invert_sign().hours(); + } + else { + ss << '+' << std::setw(2) << dst_offset().hours(); + } + if(dst_offset().minutes() != 0 || dst_offset().seconds() != 0) { + ss << ':' << std::setw(2) << dst_offset().minutes(); + if(dst_offset().seconds() != 0) { + ss << ':' << std::setw(2) << dst_offset().seconds(); + } + } + // start/time + ss << ',' << date_time::convert_string_type(dst_calc_rules_->start_rule_as_string()) << '/' + << std::setw(2) << dst_offsets_.dst_start_offset_.hours() << ':' + << std::setw(2) << dst_offsets_.dst_start_offset_.minutes(); + if(dst_offsets_.dst_start_offset_.seconds() != 0) { + ss << ':' << std::setw(2) << dst_offsets_.dst_start_offset_.seconds(); + } + // end/time + ss << ',' << date_time::convert_string_type(dst_calc_rules_->end_rule_as_string()) << '/' + << std::setw(2) << dst_offsets_.dst_end_offset_.hours() << ':' + << std::setw(2) << dst_offsets_.dst_end_offset_.minutes(); + if(dst_offsets_.dst_end_offset_.seconds() != 0) { + ss << ':' << std::setw(2) << dst_offsets_.dst_end_offset_.seconds(); + } + } + + return ss.str(); + } + private: + time_zone_names zone_names_; + bool has_dst_; + time_duration_type base_utc_offset_; + dst_adjustment_offsets dst_offsets_; + autoboost::shared_ptr dst_calc_rules_; + }; + + typedef custom_time_zone_base custom_time_zone; + +} }//namespace + + + +#endif diff --git a/contrib/autoboost/autoboost/date_time/local_time/date_duration_operators.hpp b/contrib/autoboost/autoboost/date_time/local_time/date_duration_operators.hpp new file mode 100644 index 000000000..ee60501f7 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/date_duration_operators.hpp @@ -0,0 +1,115 @@ +#ifndef AB_LOCAL_TIME_DATE_DURATION_OPERATORS_HPP___ +#define AB_LOCAL_TIME_DATE_DURATION_OPERATORS_HPP___ + +/* Copyright (c) 2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or + * http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include "autoboost/date_time/gregorian/greg_duration_types.hpp" +#include "autoboost/date_time/local_time/local_date_time.hpp" + +namespace autoboost { +namespace local_time { + + /*!@file date_duration_operators.hpp Operators for local_date_time and + * optional gregorian types. Operators use snap-to-end-of-month behavior. + * Further details on this behavior can be found in reference for + * date_time/date_duration_types.hpp and documentation for + * month and year iterators. + */ + + + /*! Adds a months object and a local_date_time. Result will be same + * day-of-month as local_date_time unless original day was the last day of month. + * see date_time::months_duration for more details */ + inline + local_date_time + operator+(const local_date_time& t, const autoboost::gregorian::months& m) + { + return t + m.get_offset(t.utc_time().date()); + } + + /*! Adds a months object to a local_date_time. Result will be same + * day-of-month as local_date_time unless original day was the last day of month. + * see date_time::months_duration for more details */ + inline + local_date_time + operator+=(local_date_time& t, const autoboost::gregorian::months& m) + { + return t += m.get_offset(t.utc_time().date()); + } + + /*! Subtracts a months object and a local_date_time. Result will be same + * day-of-month as local_date_time unless original day was the last day of month. + * see date_time::months_duration for more details */ + inline + local_date_time + operator-(const local_date_time& t, const autoboost::gregorian::months& m) + { + // get_neg_offset returns a negative duration, so we add + return t + m.get_neg_offset(t.utc_time().date()); + } + + /*! Subtracts a months object from a local_date_time. Result will be same + * day-of-month as local_date_time unless original day was the last day of month. + * see date_time::months_duration for more details */ + inline + local_date_time + operator-=(local_date_time& t, const autoboost::gregorian::months& m) + { + // get_neg_offset returns a negative duration, so we add + return t += m.get_neg_offset(t.utc_time().date()); + } + + // local_date_time & years + + /*! Adds a years object and a local_date_time. Result will be same + * month and day-of-month as local_date_time unless original day was the + * last day of month. see date_time::years_duration for more details */ + inline + local_date_time + operator+(const local_date_time& t, const autoboost::gregorian::years& y) + { + return t + y.get_offset(t.utc_time().date()); + } + + /*! Adds a years object to a local_date_time. Result will be same + * month and day-of-month as local_date_time unless original day was the + * last day of month. see date_time::years_duration for more details */ + inline + local_date_time + operator+=(local_date_time& t, const autoboost::gregorian::years& y) + { + return t += y.get_offset(t.utc_time().date()); + } + + /*! Subtracts a years object and a local_date_time. Result will be same + * month and day-of-month as local_date_time unless original day was the + * last day of month. see date_time::years_duration for more details */ + inline + local_date_time + operator-(const local_date_time& t, const autoboost::gregorian::years& y) + { + // get_neg_offset returns a negative duration, so we add + return t + y.get_neg_offset(t.utc_time().date()); + } + + /*! Subtracts a years object from a local_date_time. Result will be same + * month and day-of-month as local_date_time unless original day was the + * last day of month. see date_time::years_duration for more details */ + inline + local_date_time + operator-=(local_date_time& t, const autoboost::gregorian::years& y) + { + // get_neg_offset returns a negative duration, so we add + return t += y.get_neg_offset(t.utc_time().date()); + } + + +}} // namespaces + +#endif // LOCAL_TIME_DATE_DURATION_OPERATORS_HPP___ diff --git a/contrib/autoboost/autoboost/date_time/local_time/dst_transition_day_rules.hpp b/contrib/autoboost/autoboost/date_time/local_time/dst_transition_day_rules.hpp new file mode 100644 index 000000000..caf9052ed --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/dst_transition_day_rules.hpp @@ -0,0 +1,77 @@ +#ifndef AB_LOCAL_TIME_DST_TRANSITION_DAY_RULES_HPP__ +#define AB_LOCAL_TIME_DST_TRANSITION_DAY_RULES_HPP__ + +/* Copyright (c) 2003-2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + + +#include "autoboost/date_time/gregorian/gregorian_types.hpp" +#include "autoboost/date_time/dst_transition_generators.hpp" + +namespace autoboost { +namespace local_time { + + //! Provides rule of the form starting Apr 30 ending Oct 21 + typedef date_time::dst_day_calc_rule dst_calc_rule; + + struct partial_date_rule_spec + { + typedef gregorian::date date_type; + typedef gregorian::partial_date start_rule; + typedef gregorian::partial_date end_rule; + }; + + //! Provides rule of the form first Sunday in April, last Saturday in Oct + typedef date_time::day_calc_dst_rule partial_date_dst_rule; + + struct first_last_rule_spec + { + typedef gregorian::date date_type; + typedef gregorian::first_kday_of_month start_rule; + typedef gregorian::last_kday_of_month end_rule; + }; + + //! Provides rule of the form first Sunday in April, last Saturday in Oct + typedef date_time::day_calc_dst_rule first_last_dst_rule; + + struct last_last_rule_spec + { + typedef gregorian::date date_type; + typedef gregorian::last_kday_of_month start_rule; + typedef gregorian::last_kday_of_month end_rule; + }; + + //! Provides rule of the form last Sunday in April, last Saturday in Oct + typedef date_time::day_calc_dst_rule last_last_dst_rule; + + struct nth_last_rule_spec + { + typedef gregorian::date date_type; + typedef gregorian::nth_kday_of_month start_rule; + typedef gregorian::last_kday_of_month end_rule; + }; + + //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April, last Sunday in Oct + typedef date_time::day_calc_dst_rule nth_last_dst_rule; + + struct nth_kday_rule_spec + { + typedef gregorian::date date_type; + typedef gregorian::nth_kday_of_month start_rule; + typedef gregorian::nth_kday_of_month end_rule; + }; + + //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April/October + typedef date_time::day_calc_dst_rule nth_kday_dst_rule; + //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April/October + typedef date_time::day_calc_dst_rule nth_day_of_the_week_in_month_dst_rule; + + +} }//namespace + + +#endif diff --git a/contrib/autoboost/autoboost/date_time/local_time/local_date_time.hpp b/contrib/autoboost/autoboost/date_time/local_time/local_date_time.hpp new file mode 100644 index 000000000..aa78b5123 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/local_date_time.hpp @@ -0,0 +1,528 @@ +#ifndef AB_LOCAL_TIME_LOCAL_DATE_TIME_HPP__ +#define AB_LOCAL_TIME_LOCAL_DATE_TIME_HPP__ + +/* Copyright (c) 2003-2005 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include //todo remove? +#include +#include +#include +#include // absolute_value + +namespace autoboost { +namespace local_time { + + //! simple exception for reporting when STD or DST cannot be determined + struct ambiguous_result : public std::logic_error + { + ambiguous_result (std::string const& msg = std::string()) : + std::logic_error(std::string("Daylight Savings Results are ambiguous: " + msg)) {} + }; + //! simple exception for when time label given cannot exist + struct time_label_invalid : public std::logic_error + { + time_label_invalid (std::string const& msg = std::string()) : + std::logic_error(std::string("Time label given is invalid: " + msg)) {} + }; + struct dst_not_valid: public std::logic_error + { + dst_not_valid(std::string const& msg = std::string()) : + std::logic_error(std::string("is_dst flag does not match resulting dst for time label given: " + msg)) {} + }; + + //TODO: I think these should be in local_date_time_base and not + // necessarily brought into the namespace + using date_time::time_is_dst_result; + using date_time::is_in_dst; + using date_time::is_not_in_dst; + using date_time::ambiguous; + using date_time::invalid_time_label; + + //! Representation of "wall-clock" time in a particular time zone + /*! Representation of "wall-clock" time in a particular time zone + * Local_date_time_base holds a time value (date and time offset from 00:00) + * along with a time zone. The time value is stored as UTC and conversions + * to wall clock time are made as needed. This approach allows for + * operations between wall-clock times in different time zones, and + * daylight savings time considerations, to be made. Time zones are + * required to be in the form of a autoboost::shared_ptr. + */ + template > + class local_date_time_base : public date_time::base_time { + public: + typedef utc_time_ utc_time_type; + typedef typename utc_time_type::time_duration_type time_duration_type; + typedef typename utc_time_type::date_type date_type; + typedef typename date_type::duration_type date_duration_type; + typedef typename utc_time_type::time_system_type time_system_type; + /*! This constructor interprets the passed time as a UTC time. + * So, for example, if the passed timezone is UTC-5 then the + * time will be adjusted back 5 hours. The time zone allows for + * automatic calculation of whether the particular time is adjusted for + * daylight savings, etc. + * If the time zone shared pointer is null then time stays unadjusted. + *@param t A UTC time + *@param tz Timezone for to adjust the UTC time to. + */ + local_date_time_base(utc_time_type t, + autoboost::shared_ptr tz) : + date_time::base_time(t), + zone_(tz) + { + // param was already utc so nothing more to do + } + + /*! This constructs a local time -- the passed time information + * understood to be in the passed tz. The DST flag must be passed + * to indicate whether the time is in daylight savings or not. + * @throws -- time_label_invalid if the time passed does not exist in + * the given locale. The non-existent case occurs typically + * during the shift-back from daylight savings time. When + * the clock is shifted forward a range of times + * (2 am to 3 am in the US) is skipped and hence is invalid. + * @throws -- dst_not_valid if the DST flag is passed for a period + * where DST is not active. + */ + local_date_time_base(date_type d, + time_duration_type td, + autoboost::shared_ptr tz, + bool dst_flag) : //necessary for constr_adj() + date_time::base_time(construction_adjustment(utc_time_type(d, td), tz, dst_flag)), + zone_(tz) + { + if(tz != autoboost::shared_ptr() && tz->has_dst()){ + + // d & td are already local so we use them + time_is_dst_result result = check_dst(d, td, tz); + bool in_dst = (result == is_in_dst); // less processing than is_dst() + + // ambig occurs at end, invalid at start + if(result == invalid_time_label){ + // Ex: 2:15am local on trans-in day in nyc, dst_flag irrelevant + std::ostringstream ss; + ss << "time given: " << d << ' ' << td; + autoboost::throw_exception(time_label_invalid(ss.str())); + } + else if(result != ambiguous && in_dst != dst_flag){ + // is dst_flag accurate? + // Ex: false flag in NYC in June + std::ostringstream ss; + ss.setf(std::ios_base::boolalpha); + ss << "flag given: dst=" << dst_flag << ", dst calculated: dst=" << in_dst; + autoboost::throw_exception(dst_not_valid(ss.str())); + } + + // everything checks out and conversion to utc already done + } + } + + //TODO maybe not the right set...Ignore the last 2 for now... + enum DST_CALC_OPTIONS { EXCEPTION_ON_ERROR, NOT_DATE_TIME_ON_ERROR }; + //ASSUME_DST_ON_ERROR, ASSUME_NOT_DST_ON_ERROR }; + + /*! This constructs a local time -- the passed time information + * understood to be in the passed tz. The DST flag is calculated + * according to the specified rule. + */ + local_date_time_base(date_type d, + time_duration_type td, + autoboost::shared_ptr tz, + DST_CALC_OPTIONS calc_option) : + // dummy value - time_ is set in constructor code + date_time::base_time(utc_time_type(d,td)), + zone_(tz) + { + time_is_dst_result result = check_dst(d, td, tz); + if(result == ambiguous) { + if(calc_option == EXCEPTION_ON_ERROR){ + std::ostringstream ss; + ss << "time given: " << d << ' ' << td; + autoboost::throw_exception(ambiguous_result(ss.str())); + } + else{ // NADT on error + this->time_ = posix_time::posix_time_system::get_time_rep(date_type(date_time::not_a_date_time), time_duration_type(date_time::not_a_date_time)); + } + } + else if(result == invalid_time_label){ + if(calc_option == EXCEPTION_ON_ERROR){ + std::ostringstream ss; + ss << "time given: " << d << ' ' << td; + autoboost::throw_exception(time_label_invalid(ss.str())); + } + else{ // NADT on error + this->time_ = posix_time::posix_time_system::get_time_rep(date_type(date_time::not_a_date_time), time_duration_type(date_time::not_a_date_time)); + } + } + else if(result == is_in_dst){ + utc_time_type t = + construction_adjustment(utc_time_type(d, td), tz, true); + this->time_ = posix_time::posix_time_system::get_time_rep(t.date(), + t.time_of_day()); + } + else{ + utc_time_type t = + construction_adjustment(utc_time_type(d, td), tz, false); + this->time_ = posix_time::posix_time_system::get_time_rep(t.date(), + t.time_of_day()); + } + } + + + //! Determines if given time label is in daylight savings for given zone + /*! Determines if given time label is in daylight savings for given zone. + * Takes a date and time_duration representing a local time, along + * with time zone, and returns a time_is_dst_result object as result. + */ + static time_is_dst_result check_dst(date_type d, + time_duration_type td, + autoboost::shared_ptr tz) + { + if(tz != autoboost::shared_ptr() && tz->has_dst()) { + typedef typename date_time::dst_calculator dst_calculator; + return dst_calculator::local_is_dst( + d, td, + tz->dst_local_start_time(d.year()).date(), + tz->dst_local_start_time(d.year()).time_of_day(), + tz->dst_local_end_time(d.year()).date(), + tz->dst_local_end_time(d.year()).time_of_day(), + tz->dst_offset() + ); + } + else{ + return is_not_in_dst; + } + } + + //! Simple destructor, releases time zone if last referrer + ~local_date_time_base() {} + + //! Copy constructor + local_date_time_base(const local_date_time_base& rhs) : + date_time::base_time(rhs), + zone_(rhs.zone_) + {} + + //! Special values constructor + explicit local_date_time_base(const autoboost::date_time::special_values sv, + autoboost::shared_ptr tz = autoboost::shared_ptr()) : + date_time::base_time(utc_time_type(sv)), + zone_(tz) + {} + + //! returns time zone associated with calling instance + autoboost::shared_ptr zone() const + { + return zone_; + } + //! returns false is time_zone is NULL and if time value is a special_value + bool is_dst() const + { + if(zone_ != autoboost::shared_ptr() && zone_->has_dst() && !this->is_special()) { + // check_dst takes a local time, *this is utc + utc_time_type lt(this->time_); + lt += zone_->base_utc_offset(); + // dst_offset only needs to be considered with ambiguous time labels + // make that adjustment there + + switch(check_dst(lt.date(), lt.time_of_day(), zone_)){ + case is_not_in_dst: + return false; + case is_in_dst: + return true; + case ambiguous: + if(lt + zone_->dst_offset() < zone_->dst_local_end_time(lt.date().year())) { + return true; + } + break; + case invalid_time_label: + if(lt >= zone_->dst_local_start_time(lt.date().year())) { + return true; + } + break; + } + } + return false; + } + //! Returns object's time value as a utc representation + utc_time_type utc_time() const + { + return utc_time_type(this->time_); + } + //! Returns object's time value as a local representation + utc_time_type local_time() const + { + if(zone_ != autoboost::shared_ptr()){ + utc_time_type lt = this->utc_time() + zone_->base_utc_offset(); + if (is_dst()) { + lt += zone_->dst_offset(); + } + return lt; + } + return utc_time_type(this->time_); + } + //! Returns string in the form "2003-Aug-20 05:00:00 EDT" + /*! Returns string in the form "2003-Aug-20 05:00:00 EDT". If + * time_zone is NULL the time zone abbreviation will be "UTC". The time + * zone abbrev will not be included if calling object is a special_value*/ + std::string to_string() const + { + //TODO is this a temporary function ??? + std::ostringstream ss; + if(this->is_special()){ + ss << utc_time(); + return ss.str(); + } + if(zone_ == autoboost::shared_ptr()) { + ss << utc_time() << " UTC"; + return ss.str(); + } + bool is_dst_ = is_dst(); + utc_time_type lt = this->utc_time() + zone_->base_utc_offset(); + if (is_dst_) { + lt += zone_->dst_offset(); + } + ss << local_time() << " "; + if (is_dst()) { + ss << zone_->dst_zone_abbrev(); + } + else { + ss << zone_->std_zone_abbrev(); + } + return ss.str(); + } + /*! returns a local_date_time_base in the given time zone with the + * optional time_duration added. */ + local_date_time_base local_time_in(autoboost::shared_ptr new_tz, + time_duration_type td=time_duration_type(0,0,0)) const + { + return local_date_time_base(utc_time_type(this->time_) + td, new_tz); + } + + //! Returns name of associated time zone or "Coordinated Universal Time". + /*! Optional bool parameter will return time zone as an offset + * (ie "+07:00" extended iso format). Empty string is returned for + * classes that do not use a time_zone */ + std::string zone_name(bool as_offset=false) const + { + if(zone_ == autoboost::shared_ptr()) { + if(as_offset) { + return std::string("Z"); + } + else { + return std::string("Coordinated Universal Time"); + } + } + if (is_dst()) { + if(as_offset) { + time_duration_type td = zone_->base_utc_offset(); + td += zone_->dst_offset(); + return zone_as_offset(td, ":"); + } + else { + return zone_->dst_zone_name(); + } + } + else { + if(as_offset) { + time_duration_type td = zone_->base_utc_offset(); + return zone_as_offset(td, ":"); + } + else { + return zone_->std_zone_name(); + } + } + } + //! Returns abbreviation of associated time zone or "UTC". + /*! Optional bool parameter will return time zone as an offset + * (ie "+0700" iso format). Empty string is returned for classes + * that do not use a time_zone */ + std::string zone_abbrev(bool as_offset=false) const + { + if(zone_ == autoboost::shared_ptr()) { + if(as_offset) { + return std::string("Z"); + } + else { + return std::string("UTC"); + } + } + if (is_dst()) { + if(as_offset) { + time_duration_type td = zone_->base_utc_offset(); + td += zone_->dst_offset(); + return zone_as_offset(td, ""); + } + else { + return zone_->dst_zone_abbrev(); + } + } + else { + if(as_offset) { + time_duration_type td = zone_->base_utc_offset(); + return zone_as_offset(td, ""); + } + else { + return zone_->std_zone_abbrev(); + } + } + } + + //! returns a posix_time_zone string for the associated time_zone. If no time_zone, "UTC+00" is returned. + std::string zone_as_posix_string() const + { + if(zone_ == shared_ptr()) { + return std::string("UTC+00"); + } + return zone_->to_posix_string(); + } + + //! Equality comparison operator + /*bool operator==(const date_time::base_time& rhs) const + { // fails due to rhs.time_ being protected + return date_time::base_time::operator==(rhs); + //return this->time_ == rhs.time_; + }*/ + //! Equality comparison operator + bool operator==(const local_date_time_base& rhs) const + { + return time_system_type::is_equal(this->time_, rhs.time_); + } + //! Non-Equality comparison operator + bool operator!=(const local_date_time_base& rhs) const + { + return !(*this == rhs); + } + //! Less than comparison operator + bool operator<(const local_date_time_base& rhs) const + { + return time_system_type::is_less(this->time_, rhs.time_); + } + //! Less than or equal to comparison operator + bool operator<=(const local_date_time_base& rhs) const + { + return (*this < rhs || *this == rhs); + } + //! Greater than comparison operator + bool operator>(const local_date_time_base& rhs) const + { + return !(*this <= rhs); + } + //! Greater than or equal to comparison operator + bool operator>=(const local_date_time_base& rhs) const + { + return (*this > rhs || *this == rhs); + } + + //! Local_date_time + date_duration + local_date_time_base operator+(const date_duration_type& dd) const + { + return local_date_time_base(time_system_type::add_days(this->time_,dd), zone_); + } + //! Local_date_time += date_duration + local_date_time_base operator+=(const date_duration_type& dd) + { + this->time_ = time_system_type::add_days(this->time_,dd); + return *this; + } + //! Local_date_time - date_duration + local_date_time_base operator-(const date_duration_type& dd) const + { + return local_date_time_base(time_system_type::subtract_days(this->time_,dd), zone_); + } + //! Local_date_time -= date_duration + local_date_time_base operator-=(const date_duration_type& dd) + { + this->time_ = time_system_type::subtract_days(this->time_,dd); + return *this; + } + //! Local_date_time + time_duration + local_date_time_base operator+(const time_duration_type& td) const + { + return local_date_time_base(time_system_type::add_time_duration(this->time_,td), zone_); + } + //! Local_date_time += time_duration + local_date_time_base operator+=(const time_duration_type& td) + { + this->time_ = time_system_type::add_time_duration(this->time_,td); + return *this; + } + //! Local_date_time - time_duration + local_date_time_base operator-(const time_duration_type& td) const + { + return local_date_time_base(time_system_type::subtract_time_duration(this->time_,td), zone_); + } + //! Local_date_time -= time_duration + local_date_time_base operator-=(const time_duration_type& td) + { + this->time_ = time_system_type::subtract_time_duration(this->time_,td); + return *this; + } + //! local_date_time -= local_date_time --> time_duration_type + time_duration_type operator-(const local_date_time_base& rhs) const + { + return utc_time_type(this->time_) - utc_time_type(rhs.time_); + } + private: + autoboost::shared_ptr zone_; + //bool is_dst_; + + /*! Adjust the passed in time to UTC? + */ + utc_time_type construction_adjustment(utc_time_type t, + autoboost::shared_ptr z, + bool dst_flag) + { + if(z != autoboost::shared_ptr()) { + if(dst_flag && z->has_dst()) { + t -= z->dst_offset(); + } // else no adjust + t -= z->base_utc_offset(); + } + return t; + } + + /*! Simple formatting code -- todo remove this? + */ + std::string zone_as_offset(const time_duration_type& td, + const std::string& separator) const + { + std::ostringstream ss; + if(td.is_negative()) { + // a negative duration is represented as "-[h]h:mm" + // we require two digits for the hour. A positive duration + // with the %H flag will always give two digits + ss << "-"; + } + else { + ss << "+"; + } + ss << std::setw(2) << std::setfill('0') + << date_time::absolute_value(td.hours()) + << separator + << std::setw(2) << std::setfill('0') + << date_time::absolute_value(td.minutes()); + return ss.str(); + } + }; + + //!Use the default parameters to define local_date_time + typedef local_date_time_base<> local_date_time; + +} } + + +#endif diff --git a/contrib/autoboost/autoboost/date_time/local_time/local_time.hpp b/contrib/autoboost/autoboost/date_time/local_time/local_time.hpp new file mode 100644 index 000000000..033c99677 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/local_time.hpp @@ -0,0 +1,24 @@ +#ifndef AB_LOCAL_TIME_LOCAL_TIME_HPP__ +#define AB_LOCAL_TIME_LOCAL_TIME_HPP__ + +/* Copyright (c) 2003-2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include "autoboost/date_time/posix_time/posix_time.hpp" +#include "autoboost/date_time/local_time/local_date_time.hpp" +#include "autoboost/date_time/local_time/local_time_types.hpp" +#if !defined(USE_DATE_TIME_PRE_1_33_FACET_IO) +#include "autoboost/date_time/local_time/local_time_io.hpp" +#endif // USE_DATE_TIME_PRE_1_33_FACET_IO +#include "autoboost/date_time/local_time/posix_time_zone.hpp" +#include "autoboost/date_time/local_time/custom_time_zone.hpp" +#include "autoboost/date_time/local_time/tz_database.hpp" +#include "autoboost/date_time/local_time/conversion.hpp" +#include "autoboost/date_time/time_zone_base.hpp" + + +#endif diff --git a/contrib/autoboost/autoboost/date_time/local_time/local_time_io.hpp b/contrib/autoboost/autoboost/date_time/local_time/local_time_io.hpp new file mode 100644 index 000000000..53293f6d2 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/local_time_io.hpp @@ -0,0 +1,184 @@ +#ifndef AUTOBOOST_DATE_TIME_LOCAL_TIME_IO_HPP__ +#define AUTOBOOST_DATE_TIME_LOCAL_TIME_IO_HPP__ + +/* Copyright (c) 2003-2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include +#include +#include // i/ostreambuf_iterator +#include +#include +#include +#include +#include +#include // to_tm will be needed in the facets + +namespace autoboost { +namespace local_time { + + typedef autoboost::date_time::time_facet wlocal_time_facet; + typedef autoboost::date_time::time_facet local_time_facet; + + typedef autoboost::date_time::time_input_facet wlocal_time_input_facet; + typedef autoboost::date_time::time_input_facet local_time_input_facet; + + //! operator<< for local_date_time - see local_time docs for formatting details + template + inline + std::basic_ostream& + operator<<(std::basic_ostream& os, const local_date_time& ldt) + { + autoboost::io::ios_flags_saver iflags(os); + typedef local_date_time time_type;//::utc_time_type typename + typedef date_time::time_facet custom_time_facet; + std::ostreambuf_iterator oitr(os); + + if(std::has_facet(os.getloc())) { + std::use_facet(os.getloc()).put(oitr, + os, + os.fill(), + ldt); + } + else { + custom_time_facet* f = new custom_time_facet(); + std::locale l = std::locale(os.getloc(), f); + os.imbue(l); + f->put(oitr, os, os.fill(), ldt); + } + + return os; + } + + + //! input operator for local_date_time + template + inline + std::basic_istream& + operator>>(std::basic_istream& is, local_date_time& ldt) + { + autoboost::io::ios_flags_saver iflags(is); + typename std::basic_istream::sentry strm_sentry(is, false); + if (strm_sentry) { + try { + typedef typename local_date_time::utc_time_type utc_time_type; + typedef typename date_time::time_input_facet time_input_facet; + + // intermediate objects + std::basic_string tz_str; + utc_time_type pt(not_a_date_time); + + std::istreambuf_iterator sit(is), str_end; + if(std::has_facet(is.getloc())) { + std::use_facet(is.getloc()).get_local_time(sit, str_end, is, pt, tz_str); + } + else { + time_input_facet* f = new time_input_facet(); + std::locale l = std::locale(is.getloc(), f); + is.imbue(l); + f->get_local_time(sit, str_end, is, pt, tz_str); + } + if(tz_str.empty()) { + time_zone_ptr null_ptr; + // a null time_zone_ptr creates a local_date_time that is UTC + ldt = local_date_time(pt, null_ptr); + } + else { + time_zone_ptr tz_ptr(new posix_time_zone(date_time::convert_string_type(tz_str))); + // the "date & time" constructor expects the time label to *not* be utc. + // a posix_tz_string also expects the time label to *not* be utc. + ldt = local_date_time(pt.date(), pt.time_of_day(), tz_ptr, local_date_time::EXCEPTION_ON_ERROR); + } + } + catch(...) { + // mask tells us what exceptions are turned on + std::ios_base::iostate exception_mask = is.exceptions(); + // if the user wants exceptions on failbit, we'll rethrow our + // date_time exception & set the failbit + if(std::ios_base::failbit & exception_mask) { + try { is.setstate(std::ios_base::failbit); } + catch(std::ios_base::failure&) {} // ignore this one + throw; // rethrow original exception + } + else { + // if the user want's to fail quietly, we simply set the failbit + is.setstate(std::ios_base::failbit); + } + + } + } + return is; + } + + //! output operator for local_time_period + template + inline + std::basic_ostream& + operator<<(std::basic_ostream& os, + const autoboost::local_time::local_time_period& p) { + autoboost::io::ios_flags_saver iflags(os); + typedef autoboost::date_time::time_facet custom_facet; + std::ostreambuf_iterator oitr(os); + if (std::has_facet(os.getloc())) { + std::use_facet(os.getloc()).put(oitr, os, os.fill(), p); + } + else { + //instantiate a custom facet for dealing with periods since the user + //has not put one in the stream so far. This is for efficiency + //since we would always need to reconstruct for every time period + //if the local did not already exist. Of course this will be overridden + //if the user imbues as some later point. + custom_facet* f = new custom_facet(); + std::locale l = std::locale(os.getloc(), f); + os.imbue(l); + f->put(oitr, os, os.fill(), p); + } + return os; + } + + //! input operator for local_time_period + template + inline + std::basic_istream& + operator>>(std::basic_istream& is, autoboost::local_time::local_time_period& tp) + { + autoboost::io::ios_flags_saver iflags(is); + typename std::basic_istream::sentry strm_sentry(is, false); + if (strm_sentry) { + try { + typedef typename date_time::time_input_facet time_input_facet; + + std::istreambuf_iterator sit(is), str_end; + if(std::has_facet(is.getloc())) { + std::use_facet(is.getloc()).get(sit, str_end, is, tp); + } + else { + time_input_facet* f = new time_input_facet(); + std::locale l = std::locale(is.getloc(), f); + is.imbue(l); + f->get(sit, str_end, is, tp); + } + } + catch(...) { + std::ios_base::iostate exception_mask = is.exceptions(); + if(std::ios_base::failbit & exception_mask) { + try { is.setstate(std::ios_base::failbit); } + catch(std::ios_base::failure&) {} + throw; // rethrow original exception + } + else { + is.setstate(std::ios_base::failbit); + } + + } + } + return is; + } + +} } // namespaces + +#endif // AUTOBOOST_DATE_TIME_LOCAL_TIME_IO_HPP__ diff --git a/contrib/autoboost/autoboost/date_time/local_time/local_time_types.hpp b/contrib/autoboost/autoboost/date_time/local_time/local_time_types.hpp new file mode 100644 index 000000000..11852a9ad --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/local_time_types.hpp @@ -0,0 +1,52 @@ +#ifndef AB_LOCAL_TIME_LOCAL_TIME_TYPES_HPP__ +#define AB_LOCAL_TIME_LOCAL_TIME_TYPES_HPP__ + +/* Copyright (c) 2003-2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include "autoboost/date_time/local_time/local_date_time.hpp" +#include "autoboost/date_time/period.hpp" +#include "autoboost/date_time/time_iterator.hpp" +#include "autoboost/date_time/compiler_config.hpp" +#if defined(AUTOBOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) +#include "autoboost/date_time/local_time/date_duration_operators.hpp" +#endif //AUTOBOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES +#include "autoboost/date_time/local_time/custom_time_zone.hpp" + +namespace autoboost { +namespace local_time { + + typedef autoboost::date_time::period local_time_period; + + typedef date_time::time_itr local_time_iterator; + + typedef date_time::second_clock local_sec_clock; + typedef date_time::microsec_clock local_microsec_clock; + + typedef date_time::time_zone_base time_zone; + typedef date_time::time_zone_base wtime_zone; + + //! Shared Pointer for custom_time_zone and posix_time_zone objects + typedef autoboost::shared_ptr time_zone_ptr; + typedef autoboost::shared_ptr wtime_zone_ptr; + + typedef date_time::time_zone_names_base time_zone_names; + typedef date_time::time_zone_names_base wtime_zone_names; + + //bring special enum values into the namespace + using date_time::special_values; + using date_time::not_special; + using date_time::neg_infin; + using date_time::pos_infin; + using date_time::not_a_date_time; + using date_time::max_date_time; + using date_time::min_date_time; + +}} // namespaces + +#endif // LOCAL_TIME_LOCAL_TIME_TYPES_HPP__ diff --git a/contrib/autoboost/autoboost/date_time/local_time/posix_time_zone.hpp b/contrib/autoboost/autoboost/date_time/local_time/posix_time_zone.hpp new file mode 100644 index 000000000..fc9cbaf7e --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/posix_time_zone.hpp @@ -0,0 +1,474 @@ +#ifndef AB__DATE_TIME_POSIX_TIME_ZONE__ +#define AB__DATE_TIME_POSIX_TIME_ZONE__ + +/* Copyright (c) 2003-2005 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost{ +namespace local_time{ + + //! simple exception for UTC and Daylight savings start/end offsets + struct bad_offset : public std::out_of_range + { + bad_offset(std::string const& msg = std::string()) : + std::out_of_range(std::string("Offset out of range: " + msg)) {} + }; + //! simple exception for UTC daylight savings adjustment + struct bad_adjustment : public std::out_of_range + { + bad_adjustment(std::string const& msg = std::string()) : + std::out_of_range(std::string("Adjustment out of range: " + msg)) {} + }; + + typedef autoboost::date_time::dst_adjustment_offsets dst_adjustment_offsets; + + //! A time zone class constructed from a POSIX time zone string + /*! A POSIX time zone string takes the form of:
+ * "std offset dst [offset],start[/time],end[/time]" (w/no spaces) + * 'std' specifies the abbrev of the time zone.
+ * 'offset' is the offset from UTC.
+ * 'dst' specifies the abbrev of the time zone during daylight savings time.
+ * The second offset is how many hours changed during DST. Default=1
+ * 'start' and'end' are the dates when DST goes into (and out of) effect.
+ * 'offset' takes the form of: [+|-]hh[:mm[:ss]] {h=0-23, m/s=0-59}
+ * 'time' and 'offset' take the same form. Time defaults=02:00:00
+ * 'start' and 'end' can be one of three forms:
+ * Mm.w.d {month=1-12, week=1-5 (5 is always last), day=0-6}
+ * Jn {n=1-365 Feb29 is never counted}
+ * n {n=0-365 Feb29 is counted in leap years}
+ * Example "PST-5PDT01:00:00,M4.1.0/02:00:00,M10.1.0/02:00:00" + *
+ * Exceptions will be thrown under these conditions:
+ * An invalid date spec (see date class)
+ * A autoboost::local_time::bad_offset exception will be thrown for:
+ * A DST start or end offset that is negative or more than 24 hours
+ * A UTC zone that is greater than +14 or less than -12 hours
+ * A autoboost::local_time::bad_adjustment exception will be thrown for:
+ * A DST adjustment that is 24 hours or more (positive or negative)
+ * + * Note that UTC zone offsets can be greater than +12: + * http://www.worldtimezone.com/utc/utc+1200.html + */ + template + class posix_time_zone_base : public date_time::time_zone_base { + public: + typedef autoboost::posix_time::time_duration time_duration_type; + typedef date_time::time_zone_names_base time_zone_names; + typedef date_time::time_zone_base base_type; + typedef typename base_type::string_type string_type; + typedef CharT char_type; + typedef typename base_type::stringstream_type stringstream_type; + typedef autoboost::char_separator > char_separator_type; + typedef autoboost::tokenizer tokenizer_type; + typedef typename tokenizer_type::iterator tokenizer_iterator_type; + + //! Construct from a POSIX time zone string + posix_time_zone_base(const string_type& s) : + //zone_names_("std_name","std_abbrev","no-dst","no-dst"), + zone_names_(), + has_dst_(false), + base_utc_offset_(posix_time::hours(0)), + dst_offsets_(posix_time::hours(0),posix_time::hours(0),posix_time::hours(0)), + dst_calc_rules_() + { +#ifdef __HP_aCC + // Work around bug in aC++ compiler: see QXCR1000880488 in the + // HP bug tracking system + const char_type sep_chars[2] = {',',0}; +#else + const char_type sep_chars[2] = {','}; +#endif + char_separator_type sep(sep_chars); + tokenizer_type tokens(s, sep); + tokenizer_iterator_type it = tokens.begin(), end = tokens.end(); + if (it == end) + AUTOBOOST_THROW_EXCEPTION(std::invalid_argument("Could not parse time zone name")); + calc_zone(*it++); + if(has_dst_) + { + if (it == end) + AUTOBOOST_THROW_EXCEPTION(std::invalid_argument("Could not parse DST begin time")); + string_type dst_begin = *it++; + + if (it == end) + AUTOBOOST_THROW_EXCEPTION(std::invalid_argument("Could not parse DST end time")); + string_type dst_end = *it; + calc_rules(dst_begin, dst_end); + } + } + virtual ~posix_time_zone_base() {} + //!String for the zone when not in daylight savings (eg: EST) + virtual string_type std_zone_abbrev()const + { + return zone_names_.std_zone_abbrev(); + } + //!String for the timezone when in daylight savings (eg: EDT) + /*! For those time zones that have no DST, an empty string is used */ + virtual string_type dst_zone_abbrev() const + { + return zone_names_.dst_zone_abbrev(); + } + //!String for the zone when not in daylight savings (eg: Eastern Standard Time) + /*! The full STD name is not extracted from the posix time zone string. + * Therefore, the STD abbreviation is used in it's place */ + virtual string_type std_zone_name()const + { + return zone_names_.std_zone_name(); + } + //!String for the timezone when in daylight savings (eg: Eastern Daylight Time) + /*! The full DST name is not extracted from the posix time zone string. + * Therefore, the STD abbreviation is used in it's place. For time zones + * that have no DST, an empty string is used */ + virtual string_type dst_zone_name()const + { + return zone_names_.dst_zone_name(); + } + //! True if zone uses daylight savings adjustments otherwise false + virtual bool has_dst()const + { + return has_dst_; + } + //! Local time that DST starts -- NADT if has_dst is false + virtual posix_time::ptime dst_local_start_time(gregorian::greg_year y)const + { + gregorian::date d(gregorian::not_a_date_time); + if(has_dst_) + { + d = dst_calc_rules_->start_day(y); + } + return posix_time::ptime(d, dst_offsets_.dst_start_offset_); + } + //! Local time that DST ends -- NADT if has_dst is false + virtual posix_time::ptime dst_local_end_time(gregorian::greg_year y)const + { + gregorian::date d(gregorian::not_a_date_time); + if(has_dst_) + { + d = dst_calc_rules_->end_day(y); + } + return posix_time::ptime(d, dst_offsets_.dst_end_offset_); + } + //! Base offset from UTC for zone (eg: -07:30:00) + virtual time_duration_type base_utc_offset()const + { + return base_utc_offset_; + } + //! Adjustment forward or back made while DST is in effect + virtual time_duration_type dst_offset()const + { + return dst_offsets_.dst_adjust_; + } + + //! Returns a POSIX time_zone string for this object + virtual string_type to_posix_string() const + { + // std offset dst [offset],start[/time],end[/time] - w/o spaces + stringstream_type ss; + ss.fill('0'); + autoboost::shared_ptr no_rules; + // std + ss << std_zone_abbrev(); + // offset + if(base_utc_offset().is_negative()) { + // inverting the sign guarantees we get two digits + ss << '-' << std::setw(2) << base_utc_offset().invert_sign().hours(); + } + else { + ss << '+' << std::setw(2) << base_utc_offset().hours(); + } + if(base_utc_offset().minutes() != 0 || base_utc_offset().seconds() != 0) { + ss << ':' << std::setw(2) << base_utc_offset().minutes(); + if(base_utc_offset().seconds() != 0) { + ss << ':' << std::setw(2) << base_utc_offset().seconds(); + } + } + if(dst_calc_rules_ != no_rules) { + // dst + ss << dst_zone_abbrev(); + // dst offset + if(dst_offset().is_negative()) { + // inverting the sign guarantees we get two digits + ss << '-' << std::setw(2) << dst_offset().invert_sign().hours(); + } + else { + ss << '+' << std::setw(2) << dst_offset().hours(); + } + if(dst_offset().minutes() != 0 || dst_offset().seconds() != 0) { + ss << ':' << std::setw(2) << dst_offset().minutes(); + if(dst_offset().seconds() != 0) { + ss << ':' << std::setw(2) << dst_offset().seconds(); + } + } + // start/time + ss << ',' << date_time::convert_string_type(dst_calc_rules_->start_rule_as_string()) << '/' + << std::setw(2) << dst_offsets_.dst_start_offset_.hours() << ':' + << std::setw(2) << dst_offsets_.dst_start_offset_.minutes(); + if(dst_offsets_.dst_start_offset_.seconds() != 0) { + ss << ':' << std::setw(2) << dst_offsets_.dst_start_offset_.seconds(); + } + // end/time + ss << ',' << date_time::convert_string_type(dst_calc_rules_->end_rule_as_string()) << '/' + << std::setw(2) << dst_offsets_.dst_end_offset_.hours() << ':' + << std::setw(2) << dst_offsets_.dst_end_offset_.minutes(); + if(dst_offsets_.dst_end_offset_.seconds() != 0) { + ss << ':' << std::setw(2) << dst_offsets_.dst_end_offset_.seconds(); + } + } + + return ss.str(); + } + private: + time_zone_names zone_names_; + bool has_dst_; + time_duration_type base_utc_offset_; + dst_adjustment_offsets dst_offsets_; + autoboost::shared_ptr dst_calc_rules_; + + /*! Extract time zone abbreviations for STD & DST as well + * as the offsets for the time shift that occurs and how + * much of a shift. At this time full time zone names are + * NOT extracted so the abbreviations are used in their place */ + void calc_zone(const string_type& obj){ + const char_type empty_string[2] = {'\0'}; + stringstream_type ss(empty_string); + typename string_type::const_pointer sit = obj.c_str(), obj_end = sit + obj.size(); + string_type l_std_zone_abbrev, l_dst_zone_abbrev; + + // get 'std' name/abbrev + while(std::isalpha(*sit)){ + ss << *sit++; + } + l_std_zone_abbrev = ss.str(); + ss.str(empty_string); + + // get UTC offset + if(sit != obj_end){ + // get duration + while(sit != obj_end && !std::isalpha(*sit)){ + ss << *sit++; + } + base_utc_offset_ = date_time::str_from_delimited_time_duration(ss.str()); + ss.str(empty_string); + + // base offset must be within range of -12 hours to +14 hours + if(base_utc_offset_ < time_duration_type(-12,0,0) || + base_utc_offset_ > time_duration_type(14,0,0)) + { + autoboost::throw_exception(bad_offset(posix_time::to_simple_string(base_utc_offset_))); + } + } + + // get DST data if given + if(sit != obj_end){ + has_dst_ = true; + + // get 'dst' name/abbrev + while(sit != obj_end && std::isalpha(*sit)){ + ss << *sit++; + } + l_dst_zone_abbrev = ss.str(); + ss.str(empty_string); + + // get DST offset if given + if(sit != obj_end){ + // get duration + while(sit != obj_end && !std::isalpha(*sit)){ + ss << *sit++; + } + dst_offsets_.dst_adjust_ = date_time::str_from_delimited_time_duration(ss.str()); + ss.str(empty_string); + } + else{ // default DST offset + dst_offsets_.dst_adjust_ = posix_time::hours(1); + } + + // adjustment must be within +|- 1 day + if(dst_offsets_.dst_adjust_ <= time_duration_type(-24,0,0) || + dst_offsets_.dst_adjust_ >= time_duration_type(24,0,0)) + { + autoboost::throw_exception(bad_adjustment(posix_time::to_simple_string(dst_offsets_.dst_adjust_))); + } + } + // full names not extracted so abbrevs used in their place + zone_names_ = time_zone_names(l_std_zone_abbrev, l_std_zone_abbrev, l_dst_zone_abbrev, l_dst_zone_abbrev); + } + + void calc_rules(const string_type& start, const string_type& end){ +#ifdef __HP_aCC + // Work around bug in aC++ compiler: see QXCR1000880488 in the + // HP bug tracking system + const char_type sep_chars[2] = {'/',0}; +#else + const char_type sep_chars[2] = {'/'}; +#endif + char_separator_type sep(sep_chars); + tokenizer_type st_tok(start, sep); + tokenizer_type et_tok(end, sep); + tokenizer_iterator_type sit = st_tok.begin(); + tokenizer_iterator_type eit = et_tok.begin(); + + // generate date spec + char_type x = string_type(*sit).at(0); + if(x == 'M'){ + M_func(*sit, *eit); + } + else if(x == 'J'){ + julian_no_leap(*sit, *eit); + } + else{ + julian_day(*sit, *eit); + } + + ++sit; + ++eit; + // generate durations + // starting offset + if(sit != st_tok.end()){ + dst_offsets_.dst_start_offset_ = date_time::str_from_delimited_time_duration(*sit); + } + else{ + // default + dst_offsets_.dst_start_offset_ = posix_time::hours(2); + } + // start/end offsets must fall on given date + if(dst_offsets_.dst_start_offset_ < time_duration_type(0,0,0) || + dst_offsets_.dst_start_offset_ >= time_duration_type(24,0,0)) + { + autoboost::throw_exception(bad_offset(posix_time::to_simple_string(dst_offsets_.dst_start_offset_))); + } + + // ending offset + if(eit != et_tok.end()){ + dst_offsets_.dst_end_offset_ = date_time::str_from_delimited_time_duration(*eit); + } + else{ + // default + dst_offsets_.dst_end_offset_ = posix_time::hours(2); + } + // start/end offsets must fall on given date + if(dst_offsets_.dst_end_offset_ < time_duration_type(0,0,0) || + dst_offsets_.dst_end_offset_ >= time_duration_type(24,0,0)) + { + autoboost::throw_exception(bad_offset(posix_time::to_simple_string(dst_offsets_.dst_end_offset_))); + } + } + + /* Parses out a start/end date spec from a posix time zone string. + * Date specs come in three possible formats, this function handles + * the 'M' spec. Ex "M2.2.4" => 2nd month, 2nd week, 4th day . + */ + void M_func(const string_type& s, const string_type& e){ + typedef gregorian::nth_kday_of_month nkday; + unsigned short sm=0,sw=0,sd=0,em=0,ew=0,ed=0; // start/end month,week,day +#ifdef __HP_aCC + // Work around bug in aC++ compiler: see QXCR1000880488 in the + // HP bug tracking system + const char_type sep_chars[3] = {'M','.',0}; +#else + const char_type sep_chars[3] = {'M','.'}; +#endif + char_separator_type sep(sep_chars); + tokenizer_type stok(s, sep), etok(e, sep); + + tokenizer_iterator_type it = stok.begin(); + sm = lexical_cast(*it++); + sw = lexical_cast(*it++); + sd = lexical_cast(*it); + + it = etok.begin(); + em = lexical_cast(*it++); + ew = lexical_cast(*it++); + ed = lexical_cast(*it); + + dst_calc_rules_ = shared_ptr( + new nth_kday_dst_rule( + nth_last_dst_rule::start_rule( + static_cast(sw),sd,sm), + nth_last_dst_rule::start_rule( + static_cast(ew),ed,em) + ) + ); + } + + //! Julian day. Feb29 is never counted, even in leap years + // expects range of 1-365 + void julian_no_leap(const string_type& s, const string_type& e){ + typedef gregorian::gregorian_calendar calendar; + const unsigned short year = 2001; // Non-leap year + unsigned short sm=1; + int sd=0; + sd = lexical_cast(s.substr(1)); // skip 'J' + while(sd >= calendar::end_of_month_day(year,sm)){ + sd -= calendar::end_of_month_day(year,sm++); + } + unsigned short em=1; + int ed=0; + ed = lexical_cast(e.substr(1)); // skip 'J' + while(ed > calendar::end_of_month_day(year,em)){ + ed -= calendar::end_of_month_day(year,em++); + } + + dst_calc_rules_ = shared_ptr( + new partial_date_dst_rule( + partial_date_dst_rule::start_rule( + static_cast(sd), static_cast(sm)), + partial_date_dst_rule::end_rule( + static_cast(ed), static_cast(em)) + ) + ); + } + + //! Julian day. Feb29 is always counted, but exception thrown in non-leap years + // expects range of 0-365 + void julian_day(const string_type& s, const string_type& e){ + int sd=0, ed=0; + sd = lexical_cast(s); + ed = lexical_cast(e); + dst_calc_rules_ = shared_ptr( + new partial_date_dst_rule( + partial_date_dst_rule::start_rule(++sd),// args are 0-365 + partial_date_dst_rule::end_rule(++ed) // pd expects 1-366 + ) + ); + } + + //! helper function used when throwing exceptions + static std::string td_as_string(const time_duration_type& td) + { + std::string s; +#if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) + s = posix_time::to_simple_string(td); +#else + std::stringstream ss; + ss << td; + s = ss.str(); +#endif + return s; + } + }; + + typedef posix_time_zone_base posix_time_zone; + +} } // namespace autoboost::local_time + + +#endif // _DATE_TIME_POSIX_TIME_ZONE__ diff --git a/contrib/autoboost/autoboost/date_time/local_time/tz_database.hpp b/contrib/autoboost/autoboost/date_time/local_time/tz_database.hpp new file mode 100644 index 000000000..00b5d9d94 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/local_time/tz_database.hpp @@ -0,0 +1,32 @@ +#ifndef AUTOBOOST_DATE_TIME_TZ_DATABASE_HPP__ +#define AUTOBOOST_DATE_TIME_TZ_DATABASE_HPP__ + +/* Copyright (c) 2003-2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include +#include "autoboost/date_time/local_time/custom_time_zone.hpp" +#include "autoboost/date_time/local_time/dst_transition_day_rules.hpp" +#include "autoboost/date_time/tz_db_base.hpp" + + +namespace autoboost { +namespace local_time { + + using date_time::data_not_accessible; + using date_time::bad_field_count; + + //! Object populated with autoboost::shared_ptr objects + /*! Object populated with autoboost::shared_ptr objects + * Database is populated from specs stored in external csv file. See + * date_time::tz_db_base for greater detail */ + typedef date_time::tz_db_base tz_database; + +}} // namespace + +#endif // AUTOBOOST_DATE_TIME_TZ_DATABASE_HPP__ + diff --git a/contrib/autoboost/autoboost/date_time/locale_config.hpp b/contrib/autoboost/autoboost/date_time/locale_config.hpp new file mode 100644 index 000000000..40e63d2b6 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/locale_config.hpp @@ -0,0 +1,31 @@ +#ifndef AB_DATE_TIME_LOCALE_CONFIG_HPP___ +#define AB_DATE_TIME_LOCALE_CONFIG_HPP___ + +/* Copyright (c) 2002-2006 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland + * $Date$ + */ + +// This file configures whether the library will support locales and hence +// iostream based i/o. Even if a compiler has some support for locales, +// any failure to be compatible gets the compiler on the exclusion list. +// +// At the moment this is defined for MSVC 6 and any compiler that +// defines AUTOBOOST_NO_STD_LOCALE (gcc 2.95.x) + +#include "autoboost/config.hpp" //sets AUTOBOOST_NO_STD_LOCALE +#include "autoboost/detail/workaround.hpp" + +//This file basically becomes a noop if locales are not properly supported +#if (defined(AUTOBOOST_NO_STD_LOCALE) \ + || (AUTOBOOST_WORKAROUND( AUTOBOOST_MSVC, < 1300)) \ + || (AUTOBOOST_WORKAROUND( __BORLANDC__, AUTOBOOST_TESTED_AT( 0x581 )) ) ) +#define AUTOBOOST_DATE_TIME_NO_LOCALE +#endif + + +#endif + diff --git a/contrib/autoboost/boost/date_time/microsec_time_clock.hpp b/contrib/autoboost/autoboost/date_time/microsec_time_clock.hpp similarity index 85% rename from contrib/autoboost/boost/date_time/microsec_time_clock.hpp rename to contrib/autoboost/autoboost/date_time/microsec_time_clock.hpp index 8f8d7cd10..f44cebe73 100644 --- a/contrib/autoboost/boost/date_time/microsec_time_clock.hpp +++ b/contrib/autoboost/autoboost/date_time/microsec_time_clock.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_HIGHRES_TIME_CLOCK_HPP___ -#define DATE_TIME_HIGHRES_TIME_CLOCK_HPP___ +#ifndef AB_DATE_TIME_HIGHRES_TIME_CLOCK_HPP___ +#define AB_DATE_TIME_HIGHRES_TIME_CLOCK_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -14,15 +14,15 @@ This file contains a high resolution time clock implementation. */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -#ifdef BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK +#ifdef AUTOBOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK namespace autoboost { namespace date_time { @@ -79,12 +79,12 @@ namespace date_time { private: static time_type create_time(time_converter converter) { -#ifdef BOOST_HAS_GETTIMEOFDAY +#ifdef AUTOBOOST_HAS_GETTIMEOFDAY timeval tv; gettimeofday(&tv, 0); //gettimeofday does not support TZ adjust on Linux. std::time_t t = tv.tv_sec; autoboost::uint32_t sub_sec = tv.tv_usec; -#elif defined(BOOST_HAS_FTIME) +#elif defined(AUTOBOOST_HAS_FTIME) winapi::file_time ft; winapi::get_system_time_as_file_time(ft); uint64_t micros = winapi::file_time_to_microseconds(ft); // it will not wrap, since ft is the current time @@ -93,7 +93,7 @@ namespace date_time { // microseconds -- static casts supress warnings autoboost::uint32_t sub_sec = static_cast(micros % 1000000UL); #else -#error Internal Boost.DateTime error: BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK is defined, however neither gettimeofday nor FILETIME support is detected. +#error Internal Boost.DateTime error: AUTOBOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK is defined, however neither gettimeofday nor FILETIME support is detected. #endif std::tm curr; @@ -120,7 +120,7 @@ namespace date_time { } } //namespace date_time -#endif //BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK +#endif //AUTOBOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK #endif diff --git a/contrib/autoboost/boost/date_time/parse_format_base.hpp b/contrib/autoboost/autoboost/date_time/parse_format_base.hpp similarity index 91% rename from contrib/autoboost/boost/date_time/parse_format_base.hpp rename to contrib/autoboost/autoboost/date_time/parse_format_base.hpp index 8106581a7..a74d82581 100644 --- a/contrib/autoboost/boost/date_time/parse_format_base.hpp +++ b/contrib/autoboost/autoboost/date_time/parse_format_base.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_PARSE_FORMAT_BASE__ -#define DATE_TIME_PARSE_FORMAT_BASE__ +#ifndef AB_DATE_TIME_PARSE_FORMAT_BASE__ +#define AB_DATE_TIME_PARSE_FORMAT_BASE__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/boost/date_time/period.hpp b/contrib/autoboost/autoboost/date_time/period.hpp similarity index 99% rename from contrib/autoboost/boost/date_time/period.hpp rename to contrib/autoboost/autoboost/date_time/period.hpp index 00f36b5a6..4587e0fa8 100644 --- a/contrib/autoboost/boost/date_time/period.hpp +++ b/contrib/autoboost/autoboost/date_time/period.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_PERIOD_HPP___ -#define DATE_TIME_PERIOD_HPP___ +#ifndef AB_DATE_TIME_PERIOD_HPP___ +#define AB_DATE_TIME_PERIOD_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -17,7 +17,7 @@ */ -#include "boost/operators.hpp" +#include "autoboost/operators.hpp" namespace autoboost { diff --git a/contrib/autoboost/boost/date_time/period_formatter.hpp b/contrib/autoboost/autoboost/date_time/period_formatter.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/period_formatter.hpp rename to contrib/autoboost/autoboost/date_time/period_formatter.hpp index 5161dd56a..d0d406ea8 100644 --- a/contrib/autoboost/boost/date_time/period_formatter.hpp +++ b/contrib/autoboost/autoboost/date_time/period_formatter.hpp @@ -1,6 +1,6 @@ -#ifndef DATETIME_PERIOD_FORMATTER_HPP___ -#define DATETIME_PERIOD_FORMATTER_HPP___ +#ifndef AB_DATETIME_PERIOD_FORMATTER_HPP___ +#define AB_DATETIME_PERIOD_FORMATTER_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/boost/date_time/period_parser.hpp b/contrib/autoboost/autoboost/date_time/period_parser.hpp similarity index 97% rename from contrib/autoboost/boost/date_time/period_parser.hpp rename to contrib/autoboost/autoboost/date_time/period_parser.hpp index c5a044200..f80c55fc1 100644 --- a/contrib/autoboost/boost/date_time/period_parser.hpp +++ b/contrib/autoboost/autoboost/date_time/period_parser.hpp @@ -1,6 +1,6 @@ -#ifndef DATETIME_PERIOD_PARSER_HPP___ -#define DATETIME_PERIOD_PARSER_HPP___ +#ifndef AB_DATETIME_PERIOD_PARSER_HPP___ +#define AB_DATETIME_PERIOD_PARSER_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -10,9 +10,9 @@ * $Date$ */ -#include -#include -#include +#include +#include +#include namespace autoboost { namespace date_time { diff --git a/contrib/autoboost/autoboost/date_time/posix_time/conversion.hpp b/contrib/autoboost/autoboost/date_time/posix_time/conversion.hpp new file mode 100644 index 000000000..0e39f218e --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/posix_time/conversion.hpp @@ -0,0 +1,94 @@ +#ifndef AB_POSIX_TIME_CONVERSION_HPP___ +#define AB_POSIX_TIME_CONVERSION_HPP___ + +/* Copyright (c) 2002-2005 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include +#include +#include +#include +#include +#include // absolute_value +#include + +namespace autoboost { + +namespace posix_time { + + + //! Function that converts a time_t into a ptime. + inline + ptime from_time_t(std::time_t t) + { + ptime start(gregorian::date(1970,1,1)); + return start + seconds(static_cast(t)); + } + + //! Convert a time to a tm structure truncating any fractional seconds + inline + std::tm to_tm(const autoboost::posix_time::ptime& t) { + std::tm timetm = autoboost::gregorian::to_tm(t.date()); + autoboost::posix_time::time_duration td = t.time_of_day(); + timetm.tm_hour = td.hours(); + timetm.tm_min = td.minutes(); + timetm.tm_sec = td.seconds(); + timetm.tm_isdst = -1; // -1 used when dst info is unknown + return timetm; + } + //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components + inline + std::tm to_tm(const autoboost::posix_time::time_duration& td) { + std::tm timetm; + std::memset(&timetm, 0, sizeof(timetm)); + timetm.tm_hour = date_time::absolute_value(td.hours()); + timetm.tm_min = date_time::absolute_value(td.minutes()); + timetm.tm_sec = date_time::absolute_value(td.seconds()); + timetm.tm_isdst = -1; // -1 used when dst info is unknown + return timetm; + } + + //! Convert a tm struct to a ptime ignoring is_dst flag + inline + ptime ptime_from_tm(const std::tm& timetm) { + autoboost::gregorian::date d = autoboost::gregorian::date_from_tm(timetm); + return ptime(d, time_duration(timetm.tm_hour, timetm.tm_min, timetm.tm_sec)); + } + + +#if defined(AUTOBOOST_HAS_FTIME) + + //! Function to create a time object from an initialized FILETIME struct. + /*! Function to create a time object from an initialized FILETIME struct. + * A FILETIME struct holds 100-nanosecond units (0.0000001). When + * built with microsecond resolution the FILETIME's sub second value + * will be truncated. Nanosecond resolution has no truncation. + * + * \note FILETIME is part of the Win32 API, so it is not portable to non-windows + * platforms. + * + * \note The function is templated on the FILETIME type, so that + * it can be used with both native FILETIME and the ad-hoc + * autoboost::date_time::winapi::file_time type. + */ + template< typename TimeT, typename FileTimeT > + inline + TimeT from_ftime(const FileTimeT& ft) + { + return autoboost::date_time::time_from_ftime(ft); + } + +#endif // AUTOBOOST_HAS_FTIME + +} } //namespace autoboost::posix_time + + + + +#endif + diff --git a/contrib/autoboost/autoboost/date_time/posix_time/date_duration_operators.hpp b/contrib/autoboost/autoboost/date_time/posix_time/date_duration_operators.hpp new file mode 100644 index 000000000..2949005de --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/posix_time/date_duration_operators.hpp @@ -0,0 +1,114 @@ +#ifndef AB_DATE_DURATION_OPERATORS_HPP___ +#define AB_DATE_DURATION_OPERATORS_HPP___ + +/* Copyright (c) 2004 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or + * http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include "autoboost/date_time/gregorian/greg_duration_types.hpp" +#include "autoboost/date_time/posix_time/ptime.hpp" + +namespace autoboost { +namespace posix_time { + + /*!@file date_duration_operators.hpp Operators for ptime and + * optional gregorian types. Operators use snap-to-end-of-month behavior. + * Further details on this behavior can be found in reference for + * date_time/date_duration_types.hpp and documentation for + * month and year iterators. + */ + + + /*! Adds a months object and a ptime. Result will be same + * day-of-month as ptime unless original day was the last day of month. + * see date_time::months_duration for more details */ + inline + ptime + operator+(const ptime& t, const autoboost::gregorian::months& m) + { + return t + m.get_offset(t.date()); + } + + /*! Adds a months object to a ptime. Result will be same + * day-of-month as ptime unless original day was the last day of month. + * see date_time::months_duration for more details */ + inline + ptime + operator+=(ptime& t, const autoboost::gregorian::months& m) + { + // get_neg_offset returns a negative duration, so we add + return t += m.get_offset(t.date()); + } + + /*! Subtracts a months object and a ptime. Result will be same + * day-of-month as ptime unless original day was the last day of month. + * see date_time::months_duration for more details */ + inline + ptime + operator-(const ptime& t, const autoboost::gregorian::months& m) + { + // get_neg_offset returns a negative duration, so we add + return t + m.get_neg_offset(t.date()); + } + + /*! Subtracts a months object from a ptime. Result will be same + * day-of-month as ptime unless original day was the last day of month. + * see date_time::months_duration for more details */ + inline + ptime + operator-=(ptime& t, const autoboost::gregorian::months& m) + { + return t += m.get_neg_offset(t.date()); + } + + // ptime & years + + /*! Adds a years object and a ptime. Result will be same + * month and day-of-month as ptime unless original day was the + * last day of month. see date_time::years_duration for more details */ + inline + ptime + operator+(const ptime& t, const autoboost::gregorian::years& y) + { + return t + y.get_offset(t.date()); + } + + /*! Adds a years object to a ptime. Result will be same + * month and day-of-month as ptime unless original day was the + * last day of month. see date_time::years_duration for more details */ + inline + ptime + operator+=(ptime& t, const autoboost::gregorian::years& y) + { + return t += y.get_offset(t.date()); + } + + /*! Subtracts a years object and a ptime. Result will be same + * month and day-of-month as ptime unless original day was the + * last day of month. see date_time::years_duration for more details */ + inline + ptime + operator-(const ptime& t, const autoboost::gregorian::years& y) + { + // get_neg_offset returns a negative duration, so we add + return t + y.get_neg_offset(t.date()); + } + + /*! Subtracts a years object from a ptime. Result will be same + * month and day-of-month as ptime unless original day was the + * last day of month. see date_time::years_duration for more details */ + inline + ptime + operator-=(ptime& t, const autoboost::gregorian::years& y) + { + // get_neg_offset returns a negative duration, so we add + return t += y.get_neg_offset(t.date()); + } + +}} // namespaces + +#endif // DATE_DURATION_OPERATORS_HPP___ diff --git a/contrib/autoboost/autoboost/date_time/posix_time/posix_time.hpp b/contrib/autoboost/autoboost/date_time/posix_time/posix_time.hpp new file mode 100644 index 000000000..5c6a3a9cf --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/posix_time/posix_time.hpp @@ -0,0 +1,39 @@ +#ifndef AB_POSIX_TIME_HPP___ +#define AB_POSIX_TIME_HPP___ + +/* Copyright (c) 2002-2005 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ +/*!@file posix_time.hpp Global header file to get all of posix time types + */ + +#include "autoboost/date_time/compiler_config.hpp" +#include "autoboost/date_time/posix_time/ptime.hpp" +#if defined(AUTOBOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) +#include "autoboost/date_time/posix_time/date_duration_operators.hpp" +#endif + +// output functions +#if defined(AUTOBOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) +#include "autoboost/date_time/posix_time/time_formatters_limited.hpp" +#else +#include "autoboost/date_time/posix_time/time_formatters.hpp" +#endif // AUTOBOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS + +// streaming operators +#if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) +#include "autoboost/date_time/posix_time/posix_time_legacy_io.hpp" +#else +#include "autoboost/date_time/posix_time/posix_time_io.hpp" +#endif // USE_DATE_TIME_PRE_1_33_FACET_IO + +#include "autoboost/date_time/posix_time/time_parsers.hpp" +#include "autoboost/date_time/posix_time/conversion.hpp" + + +#endif + diff --git a/contrib/autoboost/boost/date_time/posix_time/posix_time_config.hpp b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_config.hpp similarity index 78% rename from contrib/autoboost/boost/date_time/posix_time/posix_time_config.hpp rename to contrib/autoboost/autoboost/date_time/posix_time/posix_time_config.hpp index 0221b774a..73b8e99a5 100644 --- a/contrib/autoboost/boost/date_time/posix_time/posix_time_config.hpp +++ b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_config.hpp @@ -1,5 +1,5 @@ -#ifndef POSIX_TIME_CONFIG_HPP___ -#define POSIX_TIME_CONFIG_HPP___ +#ifndef AB_POSIX_TIME_CONFIG_HPP___ +#define AB_POSIX_TIME_CONFIG_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -10,41 +10,41 @@ */ #include //for MCW 7.2 std::abs(long long) -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace autoboost { namespace posix_time { //Remove the following line if you want 64 bit millisecond resolution time -//#define BOOST_GDTL_POSIX_TIME_STD_CONFIG +//#define AUTOBOOST_GDTL_POSIX_TIME_STD_CONFIG -#ifdef BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG +#ifdef AUTOBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG // set up conditional test compilations -#define BOOST_DATE_TIME_HAS_MILLISECONDS -#define BOOST_DATE_TIME_HAS_MICROSECONDS -#define BOOST_DATE_TIME_HAS_NANOSECONDS +#define AUTOBOOST_DATE_TIME_HAS_MILLISECONDS +#define AUTOBOOST_DATE_TIME_HAS_MICROSECONDS +#define AUTOBOOST_DATE_TIME_HAS_NANOSECONDS typedef date_time::time_resolution_traits time_res_traits; #else // set up conditional test compilations -#define BOOST_DATE_TIME_HAS_MILLISECONDS -#define BOOST_DATE_TIME_HAS_MICROSECONDS -#undef BOOST_DATE_TIME_HAS_NANOSECONDS +#define AUTOBOOST_DATE_TIME_HAS_MILLISECONDS +#define AUTOBOOST_DATE_TIME_HAS_MICROSECONDS +#undef AUTOBOOST_DATE_TIME_HAS_NANOSECONDS typedef date_time::time_resolution_traits< autoboost::date_time::time_resolution_traits_adapted64_impl, autoboost::date_time::micro, 1000000, 6 > time_res_traits; -// #undef BOOST_DATE_TIME_HAS_MILLISECONDS -// #undef BOOST_DATE_TIME_HAS_MICROSECONDS -// #undef BOOST_DATE_TIME_HAS_NANOSECONDS +// #undef AUTOBOOST_DATE_TIME_HAS_MILLISECONDS +// #undef AUTOBOOST_DATE_TIME_HAS_MICROSECONDS +// #undef AUTOBOOST_DATE_TIME_HAS_NANOSECONDS // typedef date_time::time_resolution_traits time_res_traits; @@ -87,7 +87,7 @@ namespace posix_time { {} }; -#ifdef BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG +#ifdef AUTOBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG //! Simple implementation for the time rep struct simple_time_rep @@ -143,9 +143,9 @@ namespace posix_time { typedef time_duration time_duration_type; typedef time_res_traits::tick_type int_type; typedef time_res_traits resolution_traits; -#if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers +#if (defined(AUTOBOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers #else - BOOST_STATIC_CONSTANT(autoboost::int64_t, tick_per_second = 1000000000); + AUTOBOOST_STATIC_CONSTANT(autoboost::int64_t, tick_per_second = 1000000000); #endif }; @@ -162,9 +162,9 @@ namespace posix_time { typedef time_res_traits::tick_type int_type; typedef time_res_traits::impl_type impl_type; typedef time_res_traits resolution_traits; -#if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers +#if (defined(AUTOBOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers #else - BOOST_STATIC_CONSTANT(autoboost::int64_t, tick_per_second = 1000000); + AUTOBOOST_STATIC_CONSTANT(autoboost::int64_t, tick_per_second = 1000000); #endif }; diff --git a/contrib/autoboost/boost/date_time/posix_time/posix_time_duration.hpp b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_duration.hpp similarity index 90% rename from contrib/autoboost/boost/date_time/posix_time/posix_time_duration.hpp rename to contrib/autoboost/autoboost/date_time/posix_time/posix_time_duration.hpp index bbc654b77..f52b675e7 100644 --- a/contrib/autoboost/boost/date_time/posix_time/posix_time_duration.hpp +++ b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_duration.hpp @@ -1,5 +1,5 @@ -#ifndef POSIX_TIME_DURATION_HPP___ -#define POSIX_TIME_DURATION_HPP___ +#ifndef AB_POSIX_TIME_DURATION_HPP___ +#define AB_POSIX_TIME_DURATION_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,7 +9,7 @@ * $Date$ */ -#include "boost/date_time/posix_time/posix_time_config.hpp" +#include "autoboost/date_time/posix_time/posix_time_config.hpp" namespace autoboost { namespace posix_time { @@ -61,7 +61,7 @@ namespace posix_time { typedef date_time::subsecond_duration microseconds; //This is probably not needed anymore... -#if defined(BOOST_DATE_TIME_HAS_NANOSECONDS) +#if defined(AUTOBOOST_DATE_TIME_HAS_NANOSECONDS) //! Allows expression of durations as nano seconds /*! \ingroup time_basics diff --git a/contrib/autoboost/boost/date_time/posix_time/posix_time_io.hpp b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_io.hpp similarity index 94% rename from contrib/autoboost/boost/date_time/posix_time/posix_time_io.hpp rename to contrib/autoboost/autoboost/date_time/posix_time/posix_time_io.hpp index 7dccef54b..bc72c2d79 100644 --- a/contrib/autoboost/boost/date_time/posix_time/posix_time_io.hpp +++ b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_io.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_POSIX_TIME_IO_HPP__ -#define DATE_TIME_POSIX_TIME_IO_HPP__ +#ifndef AB_DATE_TIME_POSIX_TIME_IO_HPP__ +#define AB_DATE_TIME_POSIX_TIME_IO_HPP__ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -12,13 +12,13 @@ #include #include #include // i/ostreambuf_iterator -#include -#include -#include -#include -#include -#include -#include // to_tm will be needed in the facets +#include +#include +#include +#include +#include +#include +#include // to_tm will be needed in the facets namespace autoboost { namespace posix_time { diff --git a/contrib/autoboost/boost/date_time/posix_time/posix_time_legacy_io.hpp b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_legacy_io.hpp similarity index 89% rename from contrib/autoboost/boost/date_time/posix_time/posix_time_legacy_io.hpp rename to contrib/autoboost/autoboost/date_time/posix_time/posix_time_legacy_io.hpp index eacdec2ca..27f8e7d26 100644 --- a/contrib/autoboost/boost/date_time/posix_time/posix_time_legacy_io.hpp +++ b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_legacy_io.hpp @@ -1,5 +1,5 @@ -#ifndef POSIX_TIME_PRE133_OPERATORS_HPP___ -#define POSIX_TIME_PRE133_OPERATORS_HPP___ +#ifndef AB_POSIX_TIME_PRE133_OPERATORS_HPP___ +#define AB_POSIX_TIME_PRE133_OPERATORS_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -18,19 +18,19 @@ #include #include #include -#include "boost/date_time/compiler_config.hpp" -#include "boost/date_time/gregorian/gregorian.hpp" -#include "boost/date_time/posix_time/posix_time_duration.hpp" -#include "boost/date_time/posix_time/ptime.hpp" -#include "boost/date_time/posix_time/time_period.hpp" -#include "boost/date_time/time_parsing.hpp" +#include "autoboost/date_time/compiler_config.hpp" +#include "autoboost/date_time/gregorian/gregorian.hpp" +#include "autoboost/date_time/posix_time/posix_time_duration.hpp" +#include "autoboost/date_time/posix_time/ptime.hpp" +#include "autoboost/date_time/posix_time/time_period.hpp" +#include "autoboost/date_time/time_parsing.hpp" namespace autoboost { namespace posix_time { //The following code is removed for configurations with poor std::locale support (eg: MSVC6, gcc 2.9x) -#ifndef BOOST_DATE_TIME_NO_LOCALE +#ifndef AUTOBOOST_DATE_TIME_NO_LOCALE #if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) //! ostream operator for posix_time::time_duration template @@ -146,7 +146,7 @@ namespace posix_time { } -#endif //BOOST_DATE_TIME_NO_LOCALE +#endif //AUTOBOOST_DATE_TIME_NO_LOCALE } } // namespaces diff --git a/contrib/autoboost/autoboost/date_time/posix_time/posix_time_system.hpp b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_system.hpp new file mode 100644 index 000000000..9b1a3e302 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_system.hpp @@ -0,0 +1,68 @@ +#ifndef AB_POSIX_TIME_SYSTEM_HPP___ +#define AB_POSIX_TIME_SYSTEM_HPP___ + +/* Copyright (c) 2002,2003 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland + * $Date$ + */ + + +#include "autoboost/date_time/posix_time/posix_time_config.hpp" +#include "autoboost/date_time/time_system_split.hpp" +#include "autoboost/date_time/time_system_counted.hpp" +#include "autoboost/date_time/compiler_config.hpp" + + +namespace autoboost { +namespace posix_time { + +#ifdef AUTOBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG + +#if (defined(AUTOBOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers + typedef date_time::split_timedate_system posix_time_system; +#else + typedef date_time::split_timedate_system posix_time_system; +#endif + +#else + + typedef date_time::counted_time_rep int64_time_rep; + typedef date_time::counted_time_system posix_time_system; + +#endif + +} }//namespace posix_time + + +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/autoboost/autoboost/date_time/posix_time/posix_time_types.hpp b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_types.hpp new file mode 100644 index 000000000..76ab7f695 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/posix_time/posix_time_types.hpp @@ -0,0 +1,55 @@ +/* Copyright (c) 2002,2003 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland + */ +#ifndef AB_POSIX_TIME_TYPES_HPP___ +#define AB_POSIX_TIME_TYPES_HPP___ + +#include "autoboost/date_time/time_clock.hpp" +#include "autoboost/date_time/microsec_time_clock.hpp" +#include "autoboost/date_time/posix_time/ptime.hpp" +#if defined(AUTOBOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) +#include "autoboost/date_time/posix_time/date_duration_operators.hpp" +#endif +#include "autoboost/date_time/posix_time/posix_time_duration.hpp" +#include "autoboost/date_time/posix_time/posix_time_system.hpp" +#include "autoboost/date_time/posix_time/time_period.hpp" +#include "autoboost/date_time/time_iterator.hpp" +#include "autoboost/date_time/dst_rules.hpp" + +namespace autoboost { + +//!Defines a non-adjusted time system with nano-second resolution and stable calculation properties +namespace posix_time { + + //! Iterator over a defined time duration + /*! \ingroup time_basics + */ + typedef date_time::time_itr time_iterator; + //! A time clock that has a resolution of one second + /*! \ingroup time_basics + */ + typedef date_time::second_clock second_clock; + +#ifdef AUTOBOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK + //! A time clock that has a resolution of one microsecond + /*! \ingroup time_basics + */ + typedef date_time::microsec_clock microsec_clock; +#endif + + //! Define a dst null dst rule for the posix_time system + typedef date_time::null_dst_rules no_dst; + //! Define US dst rule calculator for the posix_time system + typedef date_time::us_dst_rules us_dst; + + +} } //namespace posix_time + + + + +#endif + diff --git a/contrib/autoboost/boost/date_time/posix_time/ptime.hpp b/contrib/autoboost/autoboost/date_time/posix_time/ptime.hpp similarity index 92% rename from contrib/autoboost/boost/date_time/posix_time/ptime.hpp rename to contrib/autoboost/autoboost/date_time/posix_time/ptime.hpp index b1f06a828..80ce21813 100644 --- a/contrib/autoboost/boost/date_time/posix_time/ptime.hpp +++ b/contrib/autoboost/autoboost/date_time/posix_time/ptime.hpp @@ -1,5 +1,5 @@ -#ifndef POSIX_PTIME_HPP___ -#define POSIX_PTIME_HPP___ +#ifndef AB_POSIX_PTIME_HPP___ +#define AB_POSIX_PTIME_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,8 +9,8 @@ * $Date$ */ -#include "boost/date_time/posix_time/posix_time_system.hpp" -#include "boost/date_time/time.hpp" +#include "autoboost/date_time/posix_time/posix_time_system.hpp" +#include "autoboost/date_time/time.hpp" namespace autoboost { diff --git a/contrib/autoboost/boost/date_time/posix_time/time_formatters.hpp b/contrib/autoboost/autoboost/date_time/posix_time/time_formatters.hpp similarity index 90% rename from contrib/autoboost/boost/date_time/posix_time/time_formatters.hpp rename to contrib/autoboost/autoboost/date_time/posix_time/time_formatters.hpp index 891c77267..23ee0f095 100644 --- a/contrib/autoboost/boost/date_time/posix_time/time_formatters.hpp +++ b/contrib/autoboost/autoboost/date_time/posix_time/time_formatters.hpp @@ -1,5 +1,5 @@ -#ifndef POSIXTIME_FORMATTERS_HPP___ -#define POSIXTIME_FORMATTERS_HPP___ +#ifndef AB_POSIXTIME_FORMATTERS_HPP___ +#define AB_POSIXTIME_FORMATTERS_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,17 +9,17 @@ * $Date$ */ -#include -#include -#include -#include -#include -#include -#include // absolute_value -#include +#include +#include +#include +#include +#include +#include +#include // absolute_value +#include /* NOTE: The "to_*_string" code for older compilers, ones that define - * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in + * AUTOBOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * formatters_limited.hpp */ @@ -64,7 +64,7 @@ namespace posix_time { ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) autoboost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] @@ -79,7 +79,7 @@ namespace posix_time { << std::setfill(fill_char) // JDG [7/6/02 VC++ compatibility] -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) << buff; #else << frac_sec; @@ -133,7 +133,7 @@ namespace posix_time { ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) autoboost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] @@ -148,7 +148,7 @@ namespace posix_time { << std::setfill(fill_char) // JDG [7/6/02 VC++ compatibility] -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) << buff; #else << frac_sec; @@ -244,7 +244,7 @@ namespace posix_time { return to_iso_extended_string_type(t); } -#if !defined(BOOST_NO_STD_WSTRING) +#if !defined(AUTOBOOST_NO_STD_WSTRING) //! Time duration to wstring -hh::mm::ss.fffffff. Example: 10:09:03.0123456 /*!\ingroup time_format */ @@ -279,7 +279,7 @@ namespace posix_time { return to_iso_extended_string_type(t); } -#endif // BOOST_NO_STD_WSTRING +#endif // AUTOBOOST_NO_STD_WSTRING } } //namespace posix_time diff --git a/contrib/autoboost/boost/date_time/posix_time/time_formatters_limited.hpp b/contrib/autoboost/autoboost/date_time/posix_time/time_formatters_limited.hpp similarity index 88% rename from contrib/autoboost/boost/date_time/posix_time/time_formatters_limited.hpp rename to contrib/autoboost/autoboost/date_time/posix_time/time_formatters_limited.hpp index 23a5101ff..a36cedaef 100644 --- a/contrib/autoboost/boost/date_time/posix_time/time_formatters_limited.hpp +++ b/contrib/autoboost/autoboost/date_time/posix_time/time_formatters_limited.hpp @@ -1,5 +1,5 @@ -#ifndef POSIXTIME_FORMATTERS_LIMITED_HPP___ -#define POSIXTIME_FORMATTERS_LIMITED_HPP___ +#ifndef AB_POSIXTIME_FORMATTERS_LIMITED_HPP___ +#define AB_POSIXTIME_FORMATTERS_LIMITED_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,13 +9,13 @@ * $Date$ */ -#include -#include -#include -#include -#include -#include -#include // absolute_value +#include +#include +#include +#include +#include +#include +#include // absolute_value namespace autoboost { @@ -57,7 +57,7 @@ namespace posix_time { ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) autoboost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] @@ -72,7 +72,7 @@ namespace posix_time { << std::setfill('0') // JDG [7/6/02 VC++ compatibility] -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) << buff; #else << frac_sec; @@ -120,7 +120,7 @@ namespace posix_time { ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) autoboost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] @@ -135,7 +135,7 @@ namespace posix_time { << std::setfill('0') // JDG [7/6/02 VC++ compatibility] -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) << buff; #else << frac_sec; diff --git a/contrib/autoboost/boost/date_time/posix_time/time_parsers.hpp b/contrib/autoboost/autoboost/date_time/posix_time/time_parsers.hpp similarity index 81% rename from contrib/autoboost/boost/date_time/posix_time/time_parsers.hpp rename to contrib/autoboost/autoboost/date_time/posix_time/time_parsers.hpp index fbc33ce39..2ef4db7ff 100644 --- a/contrib/autoboost/boost/date_time/posix_time/time_parsers.hpp +++ b/contrib/autoboost/autoboost/date_time/posix_time/time_parsers.hpp @@ -1,5 +1,5 @@ -#ifndef POSIXTIME_PARSERS_HPP___ -#define POSIXTIME_PARSERS_HPP___ +#ifndef AB_POSIXTIME_PARSERS_HPP___ +#define AB_POSIXTIME_PARSERS_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,9 +9,9 @@ * $Date$ */ -#include "boost/date_time/gregorian/gregorian.hpp" -#include "boost/date_time/time_parsing.hpp" -#include "boost/date_time/posix_time/posix_time_types.hpp" +#include "autoboost/date_time/gregorian/gregorian.hpp" +#include "autoboost/date_time/time_parsing.hpp" +#include "autoboost/date_time/posix_time/posix_time_types.hpp" namespace autoboost { diff --git a/contrib/autoboost/autoboost/date_time/posix_time/time_period.hpp b/contrib/autoboost/autoboost/date_time/posix_time/time_period.hpp new file mode 100644 index 000000000..1b7b3b1c9 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/posix_time/time_period.hpp @@ -0,0 +1,29 @@ +#ifndef AB_POSIX_TIME_PERIOD_HPP___ +#define AB_POSIX_TIME_PERIOD_HPP___ + +/* Copyright (c) 2002,2003 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland + * $Date$ + */ + +#include "autoboost/date_time/period.hpp" +#include "autoboost/date_time/posix_time/posix_time_duration.hpp" +#include "autoboost/date_time/posix_time/ptime.hpp" + +namespace autoboost { +namespace posix_time { + + //! Time period type + /*! \ingroup time_basics + */ + typedef date_time::period time_period; + + +} }//namespace posix_time + + +#endif + diff --git a/contrib/autoboost/boost/date_time/special_defs.hpp b/contrib/autoboost/autoboost/date_time/special_defs.hpp similarity index 87% rename from contrib/autoboost/boost/date_time/special_defs.hpp rename to contrib/autoboost/autoboost/date_time/special_defs.hpp index e55906520..4e4063725 100644 --- a/contrib/autoboost/boost/date_time/special_defs.hpp +++ b/contrib/autoboost/autoboost/date_time/special_defs.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_SPECIAL_DEFS_HPP__ -#define DATE_TIME_SPECIAL_DEFS_HPP__ +#ifndef AB_DATE_TIME_SPECIAL_DEFS_HPP__ +#define AB_DATE_TIME_SPECIAL_DEFS_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/boost/date_time/special_values_formatter.hpp b/contrib/autoboost/autoboost/date_time/special_values_formatter.hpp similarity index 95% rename from contrib/autoboost/boost/date_time/special_values_formatter.hpp rename to contrib/autoboost/autoboost/date_time/special_values_formatter.hpp index 706c53d37..9a1a306db 100644 --- a/contrib/autoboost/boost/date_time/special_values_formatter.hpp +++ b/contrib/autoboost/autoboost/date_time/special_values_formatter.hpp @@ -1,6 +1,6 @@ -#ifndef DATETIME_SPECIAL_VALUE_FORMATTER_HPP___ -#define DATETIME_SPECIAL_VALUE_FORMATTER_HPP___ +#ifndef AB_DATETIME_SPECIAL_VALUE_FORMATTER_HPP___ +#define AB_DATETIME_SPECIAL_VALUE_FORMATTER_HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -12,7 +12,7 @@ #include #include -#include "boost/date_time/special_defs.hpp" +#include "autoboost/date_time/special_defs.hpp" namespace autoboost { namespace date_time { diff --git a/contrib/autoboost/boost/date_time/special_values_parser.hpp b/contrib/autoboost/autoboost/date_time/special_values_parser.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/special_values_parser.hpp rename to contrib/autoboost/autoboost/date_time/special_values_parser.hpp index 2be033aea..0d30b07aa 100644 --- a/contrib/autoboost/boost/date_time/special_values_parser.hpp +++ b/contrib/autoboost/autoboost/date_time/special_values_parser.hpp @@ -1,6 +1,6 @@ -#ifndef DATE_TIME_SPECIAL_VALUES_PARSER_HPP__ -#define DATE_TIME_SPECIAL_VALUES_PARSER_HPP__ +#ifndef AB_DATE_TIME_SPECIAL_VALUES_PARSER_HPP__ +#define AB_DATE_TIME_SPECIAL_VALUES_PARSER_HPP__ /* Copyright (c) 2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -11,8 +11,8 @@ */ -#include "boost/date_time/string_parse_tree.hpp" -#include "boost/date_time/special_defs.hpp" +#include "autoboost/date_time/string_parse_tree.hpp" +#include "autoboost/date_time/special_defs.hpp" #include #include diff --git a/contrib/autoboost/boost/date_time/string_convert.hpp b/contrib/autoboost/autoboost/date_time/string_convert.hpp similarity index 88% rename from contrib/autoboost/boost/date_time/string_convert.hpp rename to contrib/autoboost/autoboost/date_time/string_convert.hpp index 549ad08cf..4ce94abc4 100644 --- a/contrib/autoboost/boost/date_time/string_convert.hpp +++ b/contrib/autoboost/autoboost/date_time/string_convert.hpp @@ -1,5 +1,5 @@ -#ifndef _STRING_CONVERT_HPP___ -#define _STRING_CONVERT_HPP___ +#ifndef AB__STRING_CONVERT_HPP___ +#define AB__STRING_CONVERT_HPP___ /* Copyright (c) 2005 CrystalClear Software, Inc. * Subject to the Boost Software License, Version 1.0. (See accompanying @@ -8,7 +8,7 @@ * $Date$ */ -#include "boost/date_time/compiler_config.hpp" +#include "autoboost/date_time/compiler_config.hpp" #include namespace autoboost { diff --git a/contrib/autoboost/boost/date_time/string_parse_tree.hpp b/contrib/autoboost/autoboost/date_time/string_parse_tree.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/string_parse_tree.hpp rename to contrib/autoboost/autoboost/date_time/string_parse_tree.hpp index ee6545bde..6a6029228 100644 --- a/contrib/autoboost/boost/date_time/string_parse_tree.hpp +++ b/contrib/autoboost/autoboost/date_time/string_parse_tree.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_DATE_TIME_STRING_PARSE_TREE___HPP__ -#define BOOST_DATE_TIME_STRING_PARSE_TREE___HPP__ +#ifndef AUTOBOOST_DATE_TIME_STRING_PARSE_TREE___HPP__ +#define AUTOBOOST_DATE_TIME_STRING_PARSE_TREE___HPP__ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -10,8 +10,8 @@ */ -#include "boost/lexical_cast.hpp" //error without? -#include "boost/algorithm/string/case_conv.hpp" +#include "autoboost/lexical_cast.hpp" //error without? +#include "autoboost/algorithm/string/case_conv.hpp" #include #include #include @@ -82,7 +82,7 @@ operator<<(std::basic_ostream& os, parse_match_result& mr) template struct string_parse_tree { -#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) ) +#if AUTOBOOST_WORKAROUND( __BORLANDC__, AUTOBOOST_TESTED_AT(0x581) ) typedef std::multimap > ptree_coll; #else typedef std::multimap ptree_coll; diff --git a/contrib/autoboost/boost/date_time/strings_from_facet.hpp b/contrib/autoboost/autoboost/date_time/strings_from_facet.hpp similarity index 97% rename from contrib/autoboost/boost/date_time/strings_from_facet.hpp rename to contrib/autoboost/autoboost/date_time/strings_from_facet.hpp index e3ab41d85..073f6f515 100644 --- a/contrib/autoboost/boost/date_time/strings_from_facet.hpp +++ b/contrib/autoboost/autoboost/date_time/strings_from_facet.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_STRINGS_FROM_FACET__HPP___ -#define DATE_TIME_STRINGS_FROM_FACET__HPP___ +#ifndef AB_DATE_TIME_STRINGS_FROM_FACET__HPP___ +#define AB_DATE_TIME_STRINGS_FROM_FACET__HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/autoboost/date_time/time.hpp b/contrib/autoboost/autoboost/date_time/time.hpp new file mode 100644 index 000000000..23f71214b --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/time.hpp @@ -0,0 +1,191 @@ +#ifndef AB_DATE_TIME_TIME_HPP___ +#define AB_DATE_TIME_TIME_HPP___ + +/* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + + +/*! @file time.hpp + This file contains the interface for the time associated classes. +*/ +#include +#include +#include +#include + +namespace autoboost { +namespace date_time { + + //! Representation of a precise moment in time, including the date. + /*! + This class is a skeleton for the interface of a temporal type + with a resolution that is higher than a day. It is intended that + this class be the base class and that the actual time + class be derived using the BN pattern. In this way, the derived + class can make decisions such as 'should there be a default constructor' + and what should it set its value to, should there be optional constructors + say allowing only an time_durations that generate a time from a clock,etc. + So, in fact multiple time types can be created for a time_system with + different construction policies, and all of them can perform basic + operations by only writing a copy constructor. Finally, compiler + errors are also shorter. + + The real behavior of the time class is provided by the time_system + template parameter. This class must provide all the logic + for addition, subtraction, as well as define all the interface + types. + + */ + + template + class base_time : private + autoboost::less_than_comparable > + { + public: + typedef T time_type; + typedef typename time_system::time_rep_type time_rep_type; + typedef typename time_system::date_type date_type; + typedef typename time_system::date_duration_type date_duration_type; + typedef typename time_system::time_duration_type time_duration_type; + //typedef typename time_system::hms_type hms_type; + + base_time(const date_type& day, + const time_duration_type& td, + dst_flags dst=not_dst) : + time_(time_system::get_time_rep(day, td, dst)) + {} + base_time(special_values sv) : + time_(time_system::get_time_rep(sv)) + {} + base_time(const time_rep_type& rhs) : + time_(rhs) + {} + date_type date() const + { + return time_system::get_date(time_); + } + time_duration_type time_of_day() const + { + return time_system::get_time_of_day(time_); + } + /*! Optional bool parameter will return time zone as an offset + * (ie "+07:00"). Empty string is returned for classes that do + * not use a time_zone */ + std::string zone_name(bool /*as_offset*/=false) const + { + return time_system::zone_name(time_); + } + /*! Optional bool parameter will return time zone as an offset + * (ie "+07:00"). Empty string is returned for classes that do + * not use a time_zone */ + std::string zone_abbrev(bool /*as_offset*/=false) const + { + return time_system::zone_name(time_); + } + //! An empty string is returned for classes that do not use a time_zone + std::string zone_as_posix_string() const + { + return std::string(); + } + + //! check to see if date is not a value + bool is_not_a_date_time() const + { + return time_.is_not_a_date_time(); + } + //! check to see if date is one of the infinity values + bool is_infinity() const + { + return (is_pos_infinity() || is_neg_infinity()); + } + //! check to see if date is greater than all possible dates + bool is_pos_infinity() const + { + return time_.is_pos_infinity(); + } + //! check to see if date is greater than all possible dates + bool is_neg_infinity() const + { + return time_.is_neg_infinity(); + } + //! check to see if time is a special value + bool is_special() const + { + return(is_not_a_date_time() || is_infinity()); + } + //!Equality operator -- others generated by autoboost::equality_comparable + bool operator==(const time_type& rhs) const + { + return time_system::is_equal(time_,rhs.time_); + } + //!Equality operator -- others generated by autoboost::less_than_comparable + bool operator<(const time_type& rhs) const + { + return time_system::is_less(time_,rhs.time_); + } + //! difference between two times + time_duration_type operator-(const time_type& rhs) const + { + return time_system::subtract_times(time_, rhs.time_); + } + //! add date durations + time_type operator+(const date_duration_type& dd) const + { + return time_system::add_days(time_, dd); + } + time_type operator+=(const date_duration_type& dd) + { + time_ = (time_system::get_time_rep(date() + dd, time_of_day())); + return time_type(time_); + } + //! subtract date durations + time_type operator-(const date_duration_type& dd) const + { + return time_system::subtract_days(time_, dd); + } + time_type operator-=(const date_duration_type& dd) + { + time_ = (time_system::get_time_rep(date() - dd, time_of_day())); + return time_type(time_); + } + //! add time durations + time_type operator+(const time_duration_type& td) const + { + return time_type(time_system::add_time_duration(time_, td)); + } + time_type operator+=(const time_duration_type& td) + { + time_ = (time_system::get_time_rep(date(), time_of_day() + td)); + return time_type(time_); + } + //! subtract time durations + time_type operator-(const time_duration_type& rhs) const + { + return time_system::subtract_time_duration(time_, rhs); + } + time_type operator-=(const time_duration_type& td) + { + time_ = (time_system::get_time_rep(date(), time_of_day() - td)); + return time_type(time_); + } + + protected: + time_rep_type time_; + }; + + + + + +} } //namespace date_time::boost + + +#endif + diff --git a/contrib/autoboost/boost/date_time/time_clock.hpp b/contrib/autoboost/autoboost/date_time/time_clock.hpp similarity index 93% rename from contrib/autoboost/boost/date_time/time_clock.hpp rename to contrib/autoboost/autoboost/date_time/time_clock.hpp index f6f0b3603..5e2602a28 100644 --- a/contrib/autoboost/boost/date_time/time_clock.hpp +++ b/contrib/autoboost/autoboost/date_time/time_clock.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_TIME_CLOCK_HPP___ -#define DATE_TIME_TIME_CLOCK_HPP___ +#ifndef AB_DATE_TIME_TIME_CLOCK_HPP___ +#define AB_DATE_TIME_TIME_CLOCK_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -13,8 +13,8 @@ This file contains the interface for clock devices. */ -#include "boost/date_time/c_time.hpp" -#include "boost/shared_ptr.hpp" +#include "autoboost/date_time/c_time.hpp" +#include "autoboost/shared_ptr.hpp" namespace autoboost { namespace date_time { diff --git a/contrib/autoboost/boost/date_time/time_defs.hpp b/contrib/autoboost/autoboost/date_time/time_defs.hpp similarity index 90% rename from contrib/autoboost/boost/date_time/time_defs.hpp rename to contrib/autoboost/autoboost/date_time/time_defs.hpp index e8f5f3c4e..fe74e61e4 100644 --- a/contrib/autoboost/boost/date_time/time_defs.hpp +++ b/contrib/autoboost/autoboost/date_time/time_defs.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_TIME_PRECISION_LIMITS_HPP -#define DATE_TIME_TIME_PRECISION_LIMITS_HPP +#ifndef AB_DATE_TIME_TIME_PRECISION_LIMITS_HPP +#define AB_DATE_TIME_TIME_PRECISION_LIMITS_HPP /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/boost/date_time/time_duration.hpp b/contrib/autoboost/autoboost/date_time/time_duration.hpp similarity index 91% rename from contrib/autoboost/boost/date_time/time_duration.hpp rename to contrib/autoboost/autoboost/date_time/time_duration.hpp index 450cb318b..fb76a0bc9 100644 --- a/contrib/autoboost/boost/date_time/time_duration.hpp +++ b/contrib/autoboost/autoboost/date_time/time_duration.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_TIME_DURATION_HPP___ -#define DATE_TIME_TIME_DURATION_HPP___ +#ifndef AB_DATE_TIME_TIME_DURATION_HPP___ +#define AB_DATE_TIME_TIME_DURATION_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,12 +9,12 @@ * $Date$ */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace autoboost { namespace date_time { @@ -271,9 +271,9 @@ namespace date_time { private: // To avoid integer overflow we precompute the duration resolution conversion coefficient (ticket #3471) - BOOST_STATIC_ASSERT_MSG((traits_type::ticks_per_second >= frac_of_second ? traits_type::ticks_per_second % frac_of_second : frac_of_second % traits_type::ticks_per_second) == 0,\ + AUTOBOOST_STATIC_ASSERT_MSG((traits_type::ticks_per_second >= frac_of_second ? traits_type::ticks_per_second % frac_of_second : frac_of_second % traits_type::ticks_per_second) == 0,\ "The base duration resolution must be a multiple of the subsecond duration resolution"); - BOOST_STATIC_CONSTANT(autoboost::int64_t, adjustment_ratio = (traits_type::ticks_per_second >= frac_of_second ? traits_type::ticks_per_second / frac_of_second : frac_of_second / traits_type::ticks_per_second)); + AUTOBOOST_STATIC_CONSTANT(autoboost::int64_t, adjustment_ratio = (traits_type::ticks_per_second >= frac_of_second ? traits_type::ticks_per_second / frac_of_second : frac_of_second / traits_type::ticks_per_second)); public: explicit subsecond_duration(autoboost::int64_t ss) : diff --git a/contrib/autoboost/boost/date_time/time_facet.hpp b/contrib/autoboost/autoboost/date_time/time_facet.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/time_facet.hpp rename to contrib/autoboost/autoboost/date_time/time_facet.hpp index 8c4112519..b9b15029e 100644 --- a/contrib/autoboost/boost/date_time/time_facet.hpp +++ b/contrib/autoboost/autoboost/date_time/time_facet.hpp @@ -1,6 +1,6 @@ -#ifndef _DATE_TIME_FACET__HPP__ -#define _DATE_TIME_FACET__HPP__ +#ifndef AB__DATE_TIME_FACET__HPP__ +#define AB__DATE_TIME_FACET__HPP__ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -18,17 +18,17 @@ #include #include // i/ostreambuf_iterator #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // absolute_value +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // absolute_value namespace autoboost { namespace date_time { @@ -486,7 +486,7 @@ namespace date_time { if (format.find(hours_format) != string_type::npos) { if (hours_str.empty()) hours_str = hours_as_string(time_dur_arg); - BOOST_ASSERT(hours_str.length() <= 2); + AUTOBOOST_ASSERT(hours_str.length() <= 2); autoboost::algorithm::replace_all(format, hours_format, hours_str); } @@ -580,7 +580,7 @@ namespace date_time { ss.imbue(std::locale::classic()); // don't want any formatting ss << std::setw(width) << std::setfill(static_cast('0')); -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) // JDG [7/6/02 VC++ compatibility] char_type buff[34]; ss << _i64toa(static_cast(val), buff, 10); @@ -1253,7 +1253,7 @@ namespace date_time { if(mr.current_match == match_results::PARSE_ERROR) { std::string tmp = convert_string_type(mr.cache); autoboost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + tmp + "'")); - BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return sitr); // should never reach + AUTOBOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return sitr); // should never reach } tt = temporal_type(static_cast(mr.current_match)); return sitr; diff --git a/contrib/autoboost/boost/date_time/time_formatting_streams.hpp b/contrib/autoboost/autoboost/date_time/time_formatting_streams.hpp similarity index 90% rename from contrib/autoboost/boost/date_time/time_formatting_streams.hpp rename to contrib/autoboost/autoboost/date_time/time_formatting_streams.hpp index 72fc7831c..ce267ad74 100644 --- a/contrib/autoboost/boost/date_time/time_formatting_streams.hpp +++ b/contrib/autoboost/autoboost/date_time/time_formatting_streams.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_TIME_FORMATTING_STREAMS_HPP___ -#define DATE_TIME_TIME_FORMATTING_STREAMS_HPP___ +#ifndef AB_DATE_TIME_TIME_FORMATTING_STREAMS_HPP___ +#define AB_DATE_TIME_TIME_FORMATTING_STREAMS_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,15 +9,15 @@ * $Date$ */ -#include +#include -#ifndef BOOST_DATE_TIME_NO_LOCALE +#ifndef AUTOBOOST_DATE_TIME_NO_LOCALE #include #include #include -#include -#include +#include +#include namespace autoboost { namespace date_time { @@ -117,6 +117,6 @@ namespace date_time { } } //namespace date_time -#endif //BOOST_DATE_TIME_NO_LOCALE +#endif //AUTOBOOST_DATE_TIME_NO_LOCALE #endif diff --git a/contrib/autoboost/boost/date_time/time_iterator.hpp b/contrib/autoboost/autoboost/date_time/time_iterator.hpp similarity index 94% rename from contrib/autoboost/boost/date_time/time_iterator.hpp rename to contrib/autoboost/autoboost/date_time/time_iterator.hpp index a778d99f0..387b0c526 100644 --- a/contrib/autoboost/boost/date_time/time_iterator.hpp +++ b/contrib/autoboost/autoboost/date_time/time_iterator.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_TIME_ITERATOR_HPP___ -#define DATE_TIME_TIME_ITERATOR_HPP___ +#ifndef AB_DATE_TIME_TIME_ITERATOR_HPP___ +#define AB_DATE_TIME_TIME_ITERATOR_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/boost/date_time/time_parsing.hpp b/contrib/autoboost/autoboost/date_time/time_parsing.hpp similarity index 96% rename from contrib/autoboost/boost/date_time/time_parsing.hpp rename to contrib/autoboost/autoboost/date_time/time_parsing.hpp index 90e9aa6dc..d6430661c 100644 --- a/contrib/autoboost/boost/date_time/time_parsing.hpp +++ b/contrib/autoboost/autoboost/date_time/time_parsing.hpp @@ -1,5 +1,5 @@ -#ifndef _DATE_TIME_TIME_PARSING_HPP___ -#define _DATE_TIME_TIME_PARSING_HPP___ +#ifndef AB__DATE_TIME_TIME_PARSING_HPP___ +#define AB__DATE_TIME_TIME_PARSING_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -9,10 +9,10 @@ * $Date$ */ -#include "boost/tokenizer.hpp" -#include "boost/lexical_cast.hpp" -#include "boost/date_time/date_parsing.hpp" -#include "boost/cstdint.hpp" +#include "autoboost/tokenizer.hpp" +#include "autoboost/lexical_cast.hpp" +#include "autoboost/date_time/date_parsing.hpp" +#include "autoboost/cstdint.hpp" #include namespace autoboost { @@ -83,7 +83,7 @@ namespace date_time { int digits = static_cast(beg->length()); //Works around a bug in MSVC 6 library that does not support //operator>> thus meaning lexical_cast will fail to compile. -#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER < 1300)) // msvc wouldn't compile 'time_duration::num_fractional_digits()' // (required template argument list) as a workaround a temp // time_duration object was used @@ -249,7 +249,7 @@ namespace date_time { //Works around a bug in MSVC 6 library that does not support //operator>> thus meaning lexical_cast will fail to compile. -#if (defined(BOOST_MSVC) && (_MSC_VER <= 1200)) // 1200 == VC++ 6.0 +#if (defined(AUTOBOOST_MSVC) && (_MSC_VER <= 1200)) // 1200 == VC++ 6.0 // _atoi64 is an MS specific function if(digits >= precision) { // drop excess digits diff --git a/contrib/autoboost/boost/date_time/time_resolution_traits.hpp b/contrib/autoboost/autoboost/date_time/time_resolution_traits.hpp similarity index 89% rename from contrib/autoboost/boost/date_time/time_resolution_traits.hpp rename to contrib/autoboost/autoboost/date_time/time_resolution_traits.hpp index fecdf11b2..8b3c8683e 100644 --- a/contrib/autoboost/boost/date_time/time_resolution_traits.hpp +++ b/contrib/autoboost/autoboost/date_time/time_resolution_traits.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_TIME_RESOLUTION_TRAITS_HPP -#define DATE_TIME_TIME_RESOLUTION_TRAITS_HPP +#ifndef AB_DATE_TIME_TIME_RESOLUTION_TRAITS_HPP +#define AB_DATE_TIME_TIME_RESOLUTION_TRAITS_HPP /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -10,10 +10,10 @@ */ -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { namespace date_time { @@ -62,7 +62,7 @@ namespace date_time { template diff --git a/contrib/autoboost/boost/date_time/time_system_split.hpp b/contrib/autoboost/autoboost/date_time/time_system_split.hpp similarity index 94% rename from contrib/autoboost/boost/date_time/time_system_split.hpp rename to contrib/autoboost/autoboost/date_time/time_system_split.hpp index ff8a602aa..1cbf9507d 100644 --- a/contrib/autoboost/boost/date_time/time_system_split.hpp +++ b/contrib/autoboost/autoboost/date_time/time_system_split.hpp @@ -1,5 +1,5 @@ -#ifndef DATE_TIME_TIME_SYSTEM_SPLIT_HPP -#define DATE_TIME_TIME_SYSTEM_SPLIT_HPP +#ifndef AB_DATE_TIME_TIME_SYSTEM_SPLIT_HPP +#define AB_DATE_TIME_TIME_SYSTEM_SPLIT_HPP /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the @@ -11,14 +11,14 @@ #include -#include "boost/date_time/compiler_config.hpp" -#include "boost/date_time/special_defs.hpp" +#include "autoboost/date_time/compiler_config.hpp" +#include "autoboost/date_time/special_defs.hpp" namespace autoboost { namespace date_time { //! An unadjusted time system implementation. -#if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) +#if (defined(AUTOBOOST_DATE_TIME_NO_MEMBER_INIT)) template #else template @@ -34,13 +34,13 @@ namespace date_time { typedef typename config::resolution_traits resolution_traits; //86400 is number of seconds in a day... -#if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) +#if (defined(AUTOBOOST_DATE_TIME_NO_MEMBER_INIT)) typedef date_time::wrapping_int wrap_int_type; #else private: - BOOST_STATIC_CONSTANT(int_type, ticks_per_day = INT64_C(86400) * config::tick_per_second); + AUTOBOOST_STATIC_CONSTANT(int_type, ticks_per_day = INT64_C(86400) * config::tick_per_second); public: -# if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0X581) ) +# if AUTOBOOST_WORKAROUND( __BORLANDC__, AUTOBOOST_TESTED_AT(0X581) ) typedef date_time::wrapping_int< split_timedate_system::int_type, split_timedate_system::ticks_per_day> wrap_int_type; # else typedef date_time::wrapping_int wrap_int_type; diff --git a/contrib/autoboost/autoboost/date_time/time_zone_base.hpp b/contrib/autoboost/autoboost/date_time/time_zone_base.hpp new file mode 100644 index 000000000..056d52119 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/time_zone_base.hpp @@ -0,0 +1,99 @@ +#ifndef AB__DATE_TIME_TIME_ZONE_BASE__ +#define AB__DATE_TIME_TIME_ZONE_BASE__ + +/* Copyright (c) 2003-2005 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + + +#include +#include + +namespace autoboost { +namespace date_time { + + + + //! Interface class for dynamic time zones. + /*! This class represents the base interface for all timezone + * representations. Subclasses may provide different systems + * for identifying a particular zone. For example some may + * provide a geographical based zone construction while others + * may specify the offset from GMT. Another possible implementation + * would be to convert from POSIX timezone strings. Regardless of + * the construction technique, this is the interface that these + * time zone types must provide. + * + * Note that this class is intended to be used as a shared + * resource (hence the derivation from autoboost::counted_base. + */ + template + class time_zone_base { + public: + typedef CharT char_type; + typedef std::basic_string string_type; + typedef std::basic_ostringstream stringstream_type; + typedef typename time_type::date_type::year_type year_type; + typedef typename time_type::time_duration_type time_duration_type; + + time_zone_base() {} + virtual ~time_zone_base() {} + //!String for the timezone when in daylight savings (eg: EDT) + virtual string_type dst_zone_abbrev() const=0; + //!String for the zone when not in daylight savings (eg: EST) + virtual string_type std_zone_abbrev() const=0; + //!String for the timezone when in daylight savings (eg: Eastern Daylight Time) + virtual string_type dst_zone_name() const=0; + //!String for the zone when not in daylight savings (eg: Eastern Standard Time) + virtual string_type std_zone_name() const=0; + //! True if zone uses daylight savings adjustments otherwise false + virtual bool has_dst() const=0; + //! Local time that DST starts -- undefined if has_dst is false + virtual time_type dst_local_start_time(year_type y) const=0; + //! Local time that DST ends -- undefined if has_dst is false + virtual time_type dst_local_end_time(year_type y) const=0; + //! Base offset from UTC for zone (eg: -07:30:00) + virtual time_duration_type base_utc_offset() const=0; + //! Adjustment forward or back made while DST is in effect + virtual time_duration_type dst_offset() const=0; + //! Returns a POSIX time_zone string for this object + virtual string_type to_posix_string() const =0; + + private: + + }; + + + //! Structure which holds the time offsets associated with daylight savings time + /*! + *@param time_duration_type A type used to represent the offset + */ + template + class dst_adjustment_offsets + { + public: + dst_adjustment_offsets(const time_duration_type& dst_adjust, + const time_duration_type& dst_start_offset, + const time_duration_type& dst_end_offset) : + dst_adjust_(dst_adjust), + dst_start_offset_(dst_start_offset), + dst_end_offset_(dst_end_offset) + {} + + //! Amount DST adjusts the clock eg: plus one hour + time_duration_type dst_adjust_; + //! Time past midnight on start transition day that dst starts + time_duration_type dst_start_offset_; + //! Time past midnight on end transition day that dst ends + time_duration_type dst_end_offset_; + }; + + +} } //namespace date_time + + + +#endif diff --git a/contrib/autoboost/autoboost/date_time/time_zone_names.hpp b/contrib/autoboost/autoboost/date_time/time_zone_names.hpp new file mode 100644 index 000000000..cdb9c1594 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/time_zone_names.hpp @@ -0,0 +1,98 @@ +#ifndef AB_DATE_TIME_TIME_ZONE_NAMES_HPP__ +#define AB_DATE_TIME_TIME_ZONE_NAMES_HPP__ + +/* Copyright (c) 2002-2003,2005 CrystalClear Software, Inc. + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland + * $Date$ + */ + +#include + +namespace autoboost { +namespace date_time { + + template + struct default_zone_names { + public: + typedef CharT char_type; + static const char_type standard_name[9]; + static const char_type standard_abbrev[11]; + static const char_type non_dst_identifier[7]; + }; + template + const typename default_zone_names::char_type + default_zone_names::standard_name[9] = + {'s','t','d','_','n','a','m','e'}; + + template + const typename default_zone_names::char_type + default_zone_names::standard_abbrev[11] = + {'s','t','d','_','a','b','b','r','e','v'}; + + template + const typename default_zone_names::char_type + default_zone_names::non_dst_identifier[7] = + {'n','o','-','d','s','t'}; + + //! Base type that holds various string names for timezone output. + /*! Class that holds various types of strings used for timezones. + * For example, for the western United States there is the full + * name: Pacific Standard Time and the abbreviated name: PST. + * During daylight savings there are additional names: + * Pacific Daylight Time and PDT. + *@parm CharT Allows class to support different character types + */ + template + class time_zone_names_base + { + public: + typedef std::basic_string string_type; + time_zone_names_base() : + std_zone_name_(default_zone_names::standard_name), + std_zone_abbrev_(default_zone_names::standard_abbrev), + dst_zone_name_(default_zone_names::non_dst_identifier), + dst_zone_abbrev_(default_zone_names::non_dst_identifier) + {} + time_zone_names_base(const string_type& std_zone_name_str, + const string_type& std_zone_abbrev_str, + const string_type& dst_zone_name_str, + const string_type& dst_zone_abbrev_str) : + std_zone_name_(std_zone_name_str), + std_zone_abbrev_(std_zone_abbrev_str), + dst_zone_name_(dst_zone_name_str), + dst_zone_abbrev_(dst_zone_abbrev_str) + {} + string_type dst_zone_abbrev() const + { + return dst_zone_abbrev_; + } + string_type std_zone_abbrev() const + { + return std_zone_abbrev_; + } + string_type dst_zone_name() const + { + return dst_zone_name_; + } + string_type std_zone_name() const + { + return std_zone_name_; + } + private: + string_type std_zone_name_; + string_type std_zone_abbrev_; + string_type dst_zone_name_; + string_type dst_zone_abbrev_; + + }; + + //! Specialization of timezone names for standard char. + //typedef time_zone_names_base time_zone_names; + +} } //namespace + + +#endif diff --git a/contrib/autoboost/autoboost/date_time/tz_db_base.hpp b/contrib/autoboost/autoboost/date_time/tz_db_base.hpp new file mode 100644 index 000000000..b5f42ef13 --- /dev/null +++ b/contrib/autoboost/autoboost/date_time/tz_db_base.hpp @@ -0,0 +1,396 @@ +#ifndef AB_DATE_TIME_TZ_DB_BASE_HPP__ +#define AB_DATE_TIME_TZ_DB_BASE_HPP__ + +/* Copyright (c) 2003-2005 CrystalClear Software, Inc. + * Subject to the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + * Author: Jeff Garland, Bart Garst + * $Date$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { + namespace date_time { + + //! Exception thrown when tz database cannot locate requested data file + class data_not_accessible : public std::logic_error + { + public: + data_not_accessible() : + std::logic_error(std::string("Unable to locate or access the required datafile.")) + {} + data_not_accessible(const std::string& filespec) : + std::logic_error(std::string("Unable to locate or access the required datafile. Filespec: " + filespec)) + {} + }; + + //! Exception thrown when tz database locates incorrect field structure in data file + class bad_field_count : public std::out_of_range + { + public: + bad_field_count(const std::string& s) : + std::out_of_range(s) + {} + }; + + //! Creates a database of time_zones from csv datafile + /*! The csv file containing the zone_specs used by the + * tz_db_base is intended to be customized by the + * library user. When customizing this file (or creating your own) the + * file must follow a specific format. + * + * This first line is expected to contain column headings and is therefore + * not processed by the tz_db_base. + * + * Each record (line) must have eleven fields. Some of those fields can + * be empty. Every field (even empty ones) must be enclosed in + * double-quotes. + * Ex: + * @code + * "America/Phoenix" <- string enclosed in quotes + * "" <- empty field + * @endcode + * + * Some fields represent a length of time. The format of these fields + * must be: + * @code + * "{+|-}hh:mm[:ss]" <- length-of-time format + * @endcode + * Where the plus or minus is mandatory and the seconds are optional. + * + * Since some time zones do not use daylight savings it is not always + * necessary for every field in a zone_spec to contain a value. All + * zone_specs must have at least ID and GMT offset. Zones that use + * daylight savings must have all fields filled except: + * STD ABBR, STD NAME, DST NAME. You should take note + * that DST ABBR is mandatory for zones that use daylight savings + * (see field descriptions for further details). + * + * ******* Fields and their description/details ********* + * + * ID: + * Contains the identifying string for the zone_spec. Any string will + * do as long as it's unique. No two ID's can be the same. + * + * STD ABBR: + * STD NAME: + * DST ABBR: + * DST NAME: + * These four are all the names and abbreviations used by the time + * zone being described. While any string will do in these fields, + * care should be taken. These fields hold the strings that will be + * used in the output of many of the local_time classes. + * Ex: + * @code + * time_zone nyc = tz_db.time_zone_from_region("America/New_York"); + * local_time ny_time(date(2004, Aug, 30), IS_DST, nyc); + * cout << ny_time.to_long_string() << endl; + * // 2004-Aug-30 00:00:00 Eastern Daylight Time + * cout << ny_time.to_short_string() << endl; + * // 2004-Aug-30 00:00:00 EDT + * @endcode + * + * NOTE: The exact format/function names may vary - see local_time + * documentation for further details. + * + * GMT offset: + * This is the number of hours added to utc to get the local time + * before any daylight savings adjustments are made. Some examples + * are: America/New_York offset -5 hours, & Africa/Cairo offset +2 hours. + * The format must follow the length-of-time format described above. + * + * DST adjustment: + * The amount of time added to gmt_offset when daylight savings is in + * effect. The format must follow the length-of-time format described + * above. + * + * DST Start Date rule: + * This is a specially formatted string that describes the day of year + * in which the transition take place. It holds three fields of it's own, + * separated by semicolons. + * The first field indicates the "nth" weekday of the month. The possible + * values are: 1 (first), 2 (second), 3 (third), 4 (fourth), 5 (fifth), + * and -1 (last). + * The second field indicates the day-of-week from 0-6 (Sun=0). + * The third field indicates the month from 1-12 (Jan=1). + * + * Examples are: "-1;5;9"="Last Friday of September", + * "2;1;3"="Second Monday of March" + * + * Start time: + * Start time is the number of hours past midnight, on the day of the + * start transition, the transition takes place. More simply put, the + * time of day the transition is made (in 24 hours format). The format + * must follow the length-of-time format described above with the + * exception that it must always be positive. + * + * DST End date rule: + * See DST Start date rule. The difference here is this is the day + * daylight savings ends (transition to STD). + * + * End time: + * Same as Start time. + */ + template + class tz_db_base { + public: + /* Having CharT as a template parameter created problems + * with posix_time::duration_from_string. Templatizing + * duration_from_string was not possible at this time, however, + * it should be possible in the future (when poor compilers get + * fixed or stop being used). + * Since this class was designed to use CharT as a parameter it + * is simply typedef'd here to ease converting in back to a + * parameter the future */ + typedef char char_type; + + typedef typename time_zone_type::base_type time_zone_base_type; + typedef typename time_zone_type::time_duration_type time_duration_type; + typedef time_zone_names_base time_zone_names; + typedef autoboost::date_time::dst_adjustment_offsets dst_adjustment_offsets; + typedef std::basic_string string_type; + + //! Constructs an empty database + tz_db_base() {} + + //! Process csv data file, may throw exceptions + /*! May throw bad_field_count exceptions */ + void load_from_stream(std::istream &in) + { + std::string buff; + while( std::getline(in, buff)) { + parse_string(buff); + } + } + + //! Process csv data file, may throw exceptions + /*! May throw data_not_accessible, or bad_field_count exceptions */ + void load_from_file(const std::string& pathspec) + { + std::string buff; + + std::ifstream ifs(pathspec.c_str()); + if(!ifs){ + autoboost::throw_exception(data_not_accessible(pathspec)); + } + std::getline(ifs, buff); // first line is column headings + this->load_from_stream(ifs); + } + + //! returns true if record successfully added to map + /*! Takes a region name in the form of "America/Phoenix", and a + * time_zone object for that region. The id string must be a unique + * name that does not already exist in the database. */ + bool add_record(const string_type& region, + autoboost::shared_ptr tz) + { + typename map_type::value_type p(region, tz); + return (m_zone_map.insert(p)).second; + } + + //! Returns a time_zone object built from the specs for the given region + /*! Returns a time_zone object built from the specs for the given + * region. If region does not exist a local_time::record_not_found + * exception will be thrown */ + autoboost::shared_ptr + time_zone_from_region(const string_type& region) const + { + // get the record + typename map_type::const_iterator record = m_zone_map.find(region); + if(record == m_zone_map.end()){ + return autoboost::shared_ptr(); //null pointer + } + return record->second; + } + + //! Returns a vector of strings holding the time zone regions in the database + std::vector region_list() const + { + typedef std::vector vector_type; + vector_type regions; + typename map_type::const_iterator itr = m_zone_map.begin(); + while(itr != m_zone_map.end()) { + regions.push_back(itr->first); + ++itr; + } + return regions; + } + + private: + typedef std::map > map_type; + map_type m_zone_map; + + // start and end rule are of the same type + typedef typename rule_type::start_rule::week_num week_num; + + /* TODO: mechanisms need to be put in place to handle different + * types of rule specs. parse_rules() only handles nth_kday + * rule types. */ + + //! parses rule specs for transition day rules + rule_type* parse_rules(const string_type& sr, const string_type& er) const + { + using namespace gregorian; + // start and end rule are of the same type, + // both are included here for readability + typedef typename rule_type::start_rule start_rule; + typedef typename rule_type::end_rule end_rule; + + // these are: [start|end] nth, day, month + int s_nth = 0, s_d = 0, s_m = 0; + int e_nth = 0, e_d = 0, e_m = 0; + split_rule_spec(s_nth, s_d, s_m, sr); + split_rule_spec(e_nth, e_d, e_m, er); + + typename start_rule::week_num s_wn, e_wn; + s_wn = get_week_num(s_nth); + e_wn = get_week_num(e_nth); + + + return new rule_type(start_rule(s_wn, + static_cast(s_d), + static_cast(s_m)), + end_rule(e_wn, + static_cast(e_d), + static_cast(e_m))); + } + //! helper function for parse_rules() + week_num get_week_num(int nth) const + { + typedef typename rule_type::start_rule start_rule; + switch(nth){ + case 1: + return start_rule::first; + case 2: + return start_rule::second; + case 3: + return start_rule::third; + case 4: + return start_rule::fourth; + case 5: + case -1: + return start_rule::fifth; + default: + // shouldn't get here - add error handling later + break; + } + return start_rule::fifth; // silence warnings + } + + //! splits the [start|end]_date_rule string into 3 ints + void split_rule_spec(int& nth, int& d, int& m, string_type rule) const + { + typedef autoboost::char_separator > char_separator_type; + typedef autoboost::tokenizer::const_iterator, + std::basic_string > tokenizer; + typedef autoboost::tokenizer::const_iterator, + std::basic_string >::iterator tokenizer_iterator; + + const char_type sep_char[] = { ';', '\0'}; + char_separator_type sep(sep_char); + tokenizer tokens(rule, sep); // 3 fields + + if ( std::distance ( tokens.begin(), tokens.end ()) != 3 ) { + std::ostringstream msg; + msg << "Expecting 3 fields, got " + << std::distance ( tokens.begin(), tokens.end ()) + << " fields in line: " << rule; + autoboost::throw_exception(bad_field_count(msg.str())); + } + + tokenizer_iterator tok_iter = tokens.begin(); + nth = std::atoi(tok_iter->c_str()); ++tok_iter; + d = std::atoi(tok_iter->c_str()); ++tok_iter; + m = std::atoi(tok_iter->c_str()); + } + + + //! Take a line from the csv, turn it into a time_zone_type. + /*! Take a line from the csv, turn it into a time_zone_type, + * and add it to the map. Zone_specs in csv file are expected to + * have eleven fields that describe the time zone. Returns true if + * zone_spec successfully added to database */ + bool parse_string(string_type& s) + { + std::vector result; + typedef autoboost::token_iterator_generator, string_type::const_iterator, string_type >::type token_iter_type; + + token_iter_type i = autoboost::make_token_iterator(s.begin(), s.end(),autoboost::escaped_list_separator()); + + token_iter_type end; + while (i != end) { + result.push_back(*i); + i++; + } + + enum db_fields { ID, STDABBR, STDNAME, DSTABBR, DSTNAME, GMTOFFSET, + DSTADJUST, START_DATE_RULE, START_TIME, END_DATE_RULE, + END_TIME, FIELD_COUNT }; + + //take a shot at fixing gcc 4.x error + const unsigned int expected_fields = static_cast(FIELD_COUNT); + if (result.size() != expected_fields) { + std::ostringstream msg; + msg << "Expecting " << FIELD_COUNT << " fields, got " + << result.size() << " fields in line: " << s; + autoboost::throw_exception(bad_field_count(msg.str())); + AUTOBOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return false); // should never reach + } + + // initializations + bool has_dst = true; + if(result[DSTABBR] == std::string()){ + has_dst = false; + } + + + // start building components of a time_zone + time_zone_names names(result[STDNAME], result[STDABBR], + result[DSTNAME], result[DSTABBR]); + + time_duration_type utc_offset = + str_from_delimited_time_duration(result[GMTOFFSET]); + + dst_adjustment_offsets adjust(time_duration_type(0,0,0), + time_duration_type(0,0,0), + time_duration_type(0,0,0)); + + autoboost::shared_ptr rules; + + if(has_dst){ + adjust = dst_adjustment_offsets( + str_from_delimited_time_duration(result[DSTADJUST]), + str_from_delimited_time_duration(result[START_TIME]), + str_from_delimited_time_duration(result[END_TIME]) + ); + + rules = + autoboost::shared_ptr(parse_rules(result[START_DATE_RULE], + result[END_DATE_RULE])); + } + string_type id(result[ID]); + autoboost::shared_ptr zone(new time_zone_type(names, utc_offset, adjust, rules)); + return (add_record(id, zone)); + + } + + }; + +} } // namespace + +#endif // DATE_TIME_TZ_DB_BASE_HPP__ diff --git a/contrib/autoboost/boost/date_time/wrapping_int.hpp b/contrib/autoboost/autoboost/date_time/wrapping_int.hpp similarity index 98% rename from contrib/autoboost/boost/date_time/wrapping_int.hpp rename to contrib/autoboost/autoboost/date_time/wrapping_int.hpp index 17a434b4b..11efc40c2 100644 --- a/contrib/autoboost/boost/date_time/wrapping_int.hpp +++ b/contrib/autoboost/autoboost/date_time/wrapping_int.hpp @@ -1,5 +1,5 @@ -#ifndef _DATE_TIME_WRAPPING_INT_HPP__ -#define _DATE_TIME_WRAPPING_INT_HPP__ +#ifndef AB__DATE_TIME_WRAPPING_INT_HPP__ +#define AB__DATE_TIME_WRAPPING_INT_HPP__ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/boost/date_time/year_month_day.hpp b/contrib/autoboost/autoboost/date_time/year_month_day.hpp similarity index 94% rename from contrib/autoboost/boost/date_time/year_month_day.hpp rename to contrib/autoboost/autoboost/date_time/year_month_day.hpp index e3d8395fc..2242b16c4 100644 --- a/contrib/autoboost/boost/date_time/year_month_day.hpp +++ b/contrib/autoboost/autoboost/date_time/year_month_day.hpp @@ -1,5 +1,5 @@ -#ifndef YearMonthDayBase_HPP__ -#define YearMonthDayBase_HPP__ +#ifndef AB_YearMonthDayBase_HPP__ +#define AB_YearMonthDayBase_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the diff --git a/contrib/autoboost/autoboost/detail/algorithm.hpp b/contrib/autoboost/autoboost/detail/algorithm.hpp new file mode 100644 index 000000000..5f1147046 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/algorithm.hpp @@ -0,0 +1,82 @@ +// (C) Copyright Jeremy Siek 2001. +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +#ifndef AUTOBOOST_ALGORITHM_HPP +# define AUTOBOOST_ALGORITHM_HPP +# include +// Algorithms on sequences +// +// The functions in this file have not yet gone through formal +// review, and are subject to change. This is a work in progress. +// They have been checked into the detail directory because +// there are some graph algorithms that use these functions. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { + + template + bool any_if(InputIterator first, InputIterator last, Predicate p) + { + return std::find_if(first, last, p) != last; + } + + template + bool any_if(const Container& c, Predicate p) + { + return any_if(autoboost::begin(c), autoboost::end(c), p); + } + + template + bool container_contains(InputIterator first, InputIterator last, T value) + { + return std::find(first, last, value) != last; + } + template + bool container_contains(const Container& c, const T& value) + { + return container_contains(autoboost::begin(c), autoboost::end(c), value); + } + +} // namespace autoboost + +#endif // AUTOBOOST_ALGORITHM_HPP diff --git a/contrib/autoboost/autoboost/detail/allocator_utilities.hpp b/contrib/autoboost/autoboost/detail/allocator_utilities.hpp new file mode 100644 index 000000000..ebe133fd4 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/allocator_utilities.hpp @@ -0,0 +1,187 @@ +/* Copyright 2003-2013 Joaquin M Lopez Munoz. + * 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 Boost website at http://www.boost.org/ + */ + +#ifndef AUTOBOOST_DETAIL_ALLOCATOR_UTILITIES_HPP +#define AUTOBOOST_DETAIL_ALLOCATOR_UTILITIES_HPP + +#include /* keep it first to prevent nasty warns in MSVC */ +#include +#include +#include +#include +#include +#include + +namespace autoboost{ + +namespace detail{ + +/* Allocator adaption layer. Some stdlibs provide allocators without rebind + * and template ctors. These facilities are simulated with the external + * template class rebind_to and the aid of partial_std_allocator_wrapper. + */ + +namespace allocator{ + +/* partial_std_allocator_wrapper inherits the functionality of a std + * allocator while providing a templatized ctor and other bits missing + * in some stdlib implementation or another. + */ + +template +class partial_std_allocator_wrapper:public std::allocator +{ +public: + /* Oddly enough, STLport does not define std::allocator::value_type + * when configured to work without partial template specialization. + * No harm in supplying the definition here unconditionally. + */ + + typedef Type value_type; + + partial_std_allocator_wrapper(){}; + + template + partial_std_allocator_wrapper(const partial_std_allocator_wrapper&){} + + partial_std_allocator_wrapper(const std::allocator& x): + std::allocator(x) + { + }; + +#if defined(AUTOBOOST_DINKUMWARE_STDLIB) + /* Dinkumware guys didn't provide a means to call allocate() without + * supplying a hint, in disagreement with the standard. + */ + + Type* allocate(std::size_t n,const void* hint=0) + { + std::allocator& a=*this; + return a.allocate(n,hint); + } +#endif + +}; + +/* Detects whether a given allocator belongs to a defective stdlib not + * having the required member templates. + * Note that it does not suffice to check the Boost.Config stdlib + * macros, as the user might have passed a custom, compliant allocator. + * The checks also considers partial_std_allocator_wrapper to be + * a standard defective allocator. + */ + +#if defined(AUTOBOOST_NO_STD_ALLOCATOR)&&\ + (defined(AUTOBOOST_HAS_PARTIAL_STD_ALLOCATOR)||defined(AUTOBOOST_DINKUMWARE_STDLIB)) + +template +struct is_partial_std_allocator +{ + AUTOBOOST_STATIC_CONSTANT(bool, + value= + (is_same< + std::allocator, + Allocator + >::value)|| + (is_same< + partial_std_allocator_wrapper< + AUTOBOOST_DEDUCED_TYPENAME Allocator::value_type>, + Allocator + >::value)); +}; + +#else + +template +struct is_partial_std_allocator +{ + AUTOBOOST_STATIC_CONSTANT(bool,value=false); +}; + +#endif + +/* rebind operations for defective std allocators */ + +template +struct partial_std_allocator_rebind_to +{ + typedef partial_std_allocator_wrapper type; +}; + +/* rebind operation in all other cases */ + +template +struct rebinder +{ + template + struct result + { + typedef typename Allocator::AUTOBOOST_NESTED_TEMPLATE + rebind::other other; + }; +}; + +template +struct compliant_allocator_rebind_to +{ + typedef typename rebinder:: + AUTOBOOST_NESTED_TEMPLATE result::other type; +}; + +/* rebind front-end */ + +template +struct rebind_to: + mpl::eval_if_c< + is_partial_std_allocator::value, + partial_std_allocator_rebind_to, + compliant_allocator_rebind_to + > +{ +}; + +/* allocator-independent versions of construct and destroy */ + +template +void construct(void* p,const Type& t) +{ + new (p) Type(t); +} + +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC,AUTOBOOST_TESTED_AT(1500)) +/* MSVC++ issues spurious warnings about unreferencend formal parameters + * in destroy when Type is a class with trivial dtor. + */ + +#pragma warning(push) +#pragma warning(disable:4100) +#endif + +template +void destroy(const Type* p) +{ + +#if AUTOBOOST_WORKAROUND(__SUNPRO_CC,AUTOBOOST_TESTED_AT(0x590)) + const_cast(p)->~Type(); +#else + p->~Type(); +#endif + +} + +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC,AUTOBOOST_TESTED_AT(1500)) +#pragma warning(pop) +#endif + +} /* namespace autoboost::detail::allocator */ + +} /* namespace autoboost::detail */ + +} /* namespace autoboost */ + +#endif diff --git a/contrib/autoboost/autoboost/detail/atomic_count.hpp b/contrib/autoboost/autoboost/detail/atomic_count.hpp new file mode 100644 index 000000000..4549e7548 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/atomic_count.hpp @@ -0,0 +1,21 @@ +#ifndef AUTOBOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED +#define AUTOBOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// boost/detail/atomic_count.hpp - thread/SMP safe reference counter +// +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// +// 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 + +#include + +#endif // #ifndef AUTOBOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED diff --git a/contrib/autoboost/boost/detail/atomic_redef_macros.hpp b/contrib/autoboost/autoboost/detail/atomic_redef_macros.hpp similarity index 89% rename from contrib/autoboost/boost/detail/atomic_redef_macros.hpp rename to contrib/autoboost/autoboost/detail/atomic_redef_macros.hpp index dfd15f5c7..a3809ad1c 100644 --- a/contrib/autoboost/boost/detail/atomic_redef_macros.hpp +++ b/contrib/autoboost/autoboost/detail/atomic_redef_macros.hpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#if defined(BOOST_INTEL) +#if defined(AUTOBOOST_INTEL) #pragma pop_macro("atomic_compare_exchange") #pragma pop_macro("atomic_compare_exchange_explicit") @@ -16,4 +16,4 @@ #pragma pop_macro("atomic_store") #pragma pop_macro("atomic_store_explicit") -#endif // #if defined(BOOST_INTEL) +#endif // #if defined(AUTOBOOST_INTEL) diff --git a/contrib/autoboost/boost/detail/atomic_undef_macros.hpp b/contrib/autoboost/autoboost/detail/atomic_undef_macros.hpp similarity index 92% rename from contrib/autoboost/boost/detail/atomic_undef_macros.hpp rename to contrib/autoboost/autoboost/detail/atomic_undef_macros.hpp index 18d840a7c..79d540826 100644 --- a/contrib/autoboost/boost/detail/atomic_undef_macros.hpp +++ b/contrib/autoboost/autoboost/detail/atomic_undef_macros.hpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#if defined(BOOST_INTEL) +#if defined(AUTOBOOST_INTEL) #pragma push_macro("atomic_compare_exchange") #undef atomic_compare_exchange @@ -34,6 +34,6 @@ #undef atomic_store_explicit -#endif // #if defined(BOOST_INTEL) +#endif // #if defined(AUTOBOOST_INTEL) diff --git a/contrib/autoboost/boost/detail/basic_pointerbuf.hpp b/contrib/autoboost/autoboost/detail/basic_pointerbuf.hpp similarity index 94% rename from contrib/autoboost/boost/detail/basic_pointerbuf.hpp rename to contrib/autoboost/autoboost/detail/basic_pointerbuf.hpp index 5aae1c4ef..384816b80 100644 --- a/contrib/autoboost/boost/detail/basic_pointerbuf.hpp +++ b/contrib/autoboost/autoboost/detail/basic_pointerbuf.hpp @@ -10,15 +10,15 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_DETAIL_BASIC_POINTERBUF_HPP -#define BOOST_DETAIL_BASIC_POINTERBUF_HPP +#ifndef AUTOBOOST_DETAIL_BASIC_POINTERBUF_HPP +#define AUTOBOOST_DETAIL_BASIC_POINTERBUF_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) # pragma once #endif -#include "boost/config.hpp" +#include "autoboost/config.hpp" #include namespace autoboost { namespace detail { @@ -42,7 +42,7 @@ class basic_pointerbuf : public BufferT { basic_pointerbuf() : base_type() { setbuf(0, 0); } const charT* getnext() { return this->gptr(); } -#ifndef BOOST_NO_USING_TEMPLATE +#ifndef AUTOBOOST_NO_USING_TEMPLATE using base_type::pptr; using base_type::pbase; #else @@ -108,12 +108,12 @@ basic_pointerbuf::seekoff(off_type off, ::std::ios_base::seekdir } default: ; } -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(push) #pragma warning(disable:4244) #endif return static_cast(this->gptr() - this->eback()); -#ifdef BOOST_MSVC +#ifdef AUTOBOOST_MSVC #pragma warning(pop) #endif } @@ -135,5 +135,5 @@ basic_pointerbuf::seekpos(pos_type sp, ::std::ios_base::openmode }} // namespace autoboost::detail -#endif // BOOST_DETAIL_BASIC_POINTERBUF_HPP +#endif // AUTOBOOST_DETAIL_BASIC_POINTERBUF_HPP diff --git a/contrib/autoboost/boost/detail/binary_search.hpp b/contrib/autoboost/autoboost/detail/binary_search.hpp similarity index 98% rename from contrib/autoboost/boost/detail/binary_search.hpp rename to contrib/autoboost/autoboost/detail/binary_search.hpp index fabea87f5..e62d3c906 100644 --- a/contrib/autoboost/boost/detail/binary_search.hpp +++ b/contrib/autoboost/autoboost/detail/binary_search.hpp @@ -25,10 +25,10 @@ // representations about the suitability of this software for any // purpose. It is provided "as is" without express or implied warranty. // -#ifndef BINARY_SEARCH_DWA_122600_H_ -# define BINARY_SEARCH_DWA_122600_H_ +#ifndef AB_BINARY_SEARCH_DWA_122600_H_ +# define AB_BINARY_SEARCH_DWA_122600_H_ -# include +# include # include namespace autoboost { namespace detail { diff --git a/contrib/autoboost/autoboost/detail/bitmask.hpp b/contrib/autoboost/autoboost/detail/bitmask.hpp new file mode 100644 index 000000000..01f13979c --- /dev/null +++ b/contrib/autoboost/autoboost/detail/bitmask.hpp @@ -0,0 +1,47 @@ +// boost/detail/bitmask.hpp ------------------------------------------------// + +// Copyright Beman Dawes 2006 + +// Distributed under the Boost Software License, Version 1.0 +// http://www.boost.org/LICENSE_1_0.txt + +// Usage: enum foo { a=1, b=2, c=4 }; +// AUTOBOOST_BITMASK( foo ); +// +// void f( foo arg ); +// ... +// f( a | c ); + +#ifndef AUTOBOOST_BITMASK_HPP +#define AUTOBOOST_BITMASK_HPP + +#include + +#define AUTOBOOST_BITMASK(Bitmask) \ + \ + inline Bitmask operator| (Bitmask x , Bitmask y ) \ + { return static_cast( static_cast(x) \ + | static_cast(y)); } \ + \ + inline Bitmask operator& (Bitmask x , Bitmask y ) \ + { return static_cast( static_cast(x) \ + & static_cast(y)); } \ + \ + inline Bitmask operator^ (Bitmask x , Bitmask y ) \ + { return static_cast( static_cast(x) \ + ^ static_cast(y)); } \ + \ + inline Bitmask operator~ (Bitmask x ) \ + { return static_cast(~static_cast(x)); } \ + \ + inline Bitmask & operator&=(Bitmask & x , Bitmask y) \ + { x = x & y ; return x ; } \ + \ + inline Bitmask & operator|=(Bitmask & x , Bitmask y) \ + { x = x | y ; return x ; } \ + \ + inline Bitmask & operator^=(Bitmask & x , Bitmask y) \ + { x = x ^ y ; return x ; } + +#endif // AUTOBOOST_BITMASK_HPP + diff --git a/contrib/autoboost/autoboost/detail/call_traits.hpp b/contrib/autoboost/autoboost/detail/call_traits.hpp new file mode 100644 index 000000000..fa1c44fd7 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/call_traits.hpp @@ -0,0 +1,172 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Use, modification and distribution are subject to 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/libs/utility for most recent version including documentation. + +// call_traits: defines typedefs for function usage +// (see libs/utility/call_traits.htm) + +/* Release notes: + 23rd July 2000: + Fixed array specialization. (JM) + Added Borland specific fixes for reference types + (issue raised by Steve Cleary). +*/ + +#ifndef AUTOBOOST_DETAIL_CALL_TRAITS_HPP +#define AUTOBOOST_DETAIL_CALL_TRAITS_HPP + +#ifndef AUTOBOOST_CONFIG_HPP +#include +#endif +#include + +#include +#include +#include +#include + +namespace autoboost{ + +namespace detail{ + +template +struct ct_imp2 +{ + typedef const T& param_type; +}; + +template +struct ct_imp2 +{ + typedef const T param_type; +}; + +template +struct ct_imp +{ + typedef const T& param_type; +}; + +template +struct ct_imp +{ + typedef typename ct_imp2::param_type param_type; +}; + +template +struct ct_imp +{ + typedef typename ct_imp2::param_type param_type; +}; + +template +struct ct_imp +{ + typedef const T param_type; +}; + +} + +template +struct call_traits +{ +public: + typedef T value_type; + typedef T& reference; + typedef const T& const_reference; + // + // C++ Builder workaround: we should be able to define a compile time + // constant and pass that as a single template parameter to ct_imp, + // however compiler bugs prevent this - instead pass three bool's to + // ct_imp and add an extra partial specialisation + // of ct_imp to handle the logic. (JM) + typedef typename autoboost::detail::ct_imp< + T, + ::autoboost::is_pointer::value, + ::autoboost::is_arithmetic::value, + ::autoboost::is_enum::value + >::param_type param_type; +}; + +template +struct call_traits +{ + typedef T& value_type; + typedef T& reference; + typedef const T& const_reference; + typedef T& param_type; // hh removed const +}; + +#if AUTOBOOST_WORKAROUND( __BORLANDC__, < 0x5A0 ) +// these are illegal specialisations; cv-qualifies applied to +// references have no effect according to [8.3.2p1], +// C++ Builder requires them though as it treats cv-qualified +// references as distinct types... +template +struct call_traits +{ + typedef T& value_type; + typedef T& reference; + typedef const T& const_reference; + typedef T& param_type; // hh removed const +}; +template +struct call_traits +{ + typedef T& value_type; + typedef T& reference; + typedef const T& const_reference; + typedef T& param_type; // hh removed const +}; +template +struct call_traits +{ + typedef T& value_type; + typedef T& reference; + typedef const T& const_reference; + typedef T& param_type; // hh removed const +}; + +template +struct call_traits< T * > +{ + typedef T * value_type; + typedef T * & reference; + typedef T * const & const_reference; + typedef T * const param_type; // hh removed const +}; +#endif +#if !defined(AUTOBOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) +template +struct call_traits +{ +private: + typedef T array_type[N]; +public: + // degrades array to pointer: + typedef const T* value_type; + typedef array_type& reference; + typedef const array_type& const_reference; + typedef const T* const param_type; +}; + +template +struct call_traits +{ +private: + typedef const T array_type[N]; +public: + // degrades array to pointer: + typedef const T* value_type; + typedef array_type& reference; + typedef const array_type& const_reference; + typedef const T* const param_type; +}; +#endif + +} + +#endif // AUTOBOOST_DETAIL_CALL_TRAITS_HPP diff --git a/contrib/autoboost/autoboost/detail/catch_exceptions.hpp b/contrib/autoboost/autoboost/detail/catch_exceptions.hpp new file mode 100644 index 000000000..bc3a72d3e --- /dev/null +++ b/contrib/autoboost/autoboost/detail/catch_exceptions.hpp @@ -0,0 +1,142 @@ +// boost/catch_exceptions.hpp -----------------------------------------------// + +// Copyright Beman Dawes 1995-2001. 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/libs/test for documentation. + +// Revision History +// 13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones) +// 26 Feb 01 Numerous changes suggested during formal review. (Beman) +// 25 Jan 01 catch_exceptions.hpp code factored out of cpp_main.cpp. +// 22 Jan 01 Remove test_tools dependencies to reduce coupling. +// 5 Nov 00 Initial boost version (Beman Dawes) + +#ifndef AUTOBOOST_CATCH_EXCEPTIONS_HPP +#define AUTOBOOST_CATCH_EXCEPTIONS_HPP + +// header dependencies are deliberately restricted to the standard library +// to reduce coupling to other boost libraries. +#include // for string +#include // for bad_alloc +#include // for bad_cast, bad_typeid +#include // for exception, bad_exception +#include // for std exception hierarchy +#include // for exit codes +#include // for ostream + +# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551) +# define AUTOBOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT +# endif + +#if defined(MPW_CPLUS) && (MPW_CPLUS <= 0x890) +# define AUTOBOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT + namespace std { class bad_typeid { }; } +# endif + +namespace autoboost +{ + + namespace detail + { + // A separate reporting function was requested during formal review. + inline void report_exception( std::ostream & os, + const char * name, const char * info ) + { os << "\n** uncaught exception: " << name << " " << info << std::endl; } + } + + // catch_exceptions ------------------------------------------------------// + + template< class Generator > // Generator is function object returning int + int catch_exceptions( Generator function_object, + std::ostream & out, std::ostream & err ) + { + int result = 0; // quiet compiler warnings + bool exception_thrown = true; // avoid setting result for each excptn type + +#ifndef AUTOBOOST_NO_EXCEPTIONS + try + { +#endif + result = function_object(); + exception_thrown = false; +#ifndef AUTOBOOST_NO_EXCEPTIONS + } + + // As a result of hard experience with strangely interleaved output + // under some compilers, there is a lot of use of endl in the code below + // where a simple '\n' might appear to do. + + // The rules for catch & arguments are a bit different from function + // arguments (ISO 15.3 paragraphs 18 & 19). Apparently const isn't + // required, but it doesn't hurt and some programmers ask for it. + + catch ( const char * ex ) + { detail::report_exception( out, "", ex ); } + catch ( const std::string & ex ) + { detail::report_exception( out, "", ex.c_str() ); } + + // std:: exceptions + catch ( const std::bad_alloc & ex ) + { detail::report_exception( out, "std::bad_alloc:", ex.what() ); } + +# ifndef AUTOBOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT + catch ( const std::bad_cast & ex ) + { detail::report_exception( out, "std::bad_cast:", ex.what() ); } + catch ( const std::bad_typeid & ex ) + { detail::report_exception( out, "std::bad_typeid:", ex.what() ); } +# else + catch ( const std::bad_cast & ) + { detail::report_exception( out, "std::bad_cast", "" ); } + catch ( const std::bad_typeid & ) + { detail::report_exception( out, "std::bad_typeid", "" ); } +# endif + + catch ( const std::bad_exception & ex ) + { detail::report_exception( out, "std::bad_exception:", ex.what() ); } + catch ( const std::domain_error & ex ) + { detail::report_exception( out, "std::domain_error:", ex.what() ); } + catch ( const std::invalid_argument & ex ) + { detail::report_exception( out, "std::invalid_argument:", ex.what() ); } + catch ( const std::length_error & ex ) + { detail::report_exception( out, "std::length_error:", ex.what() ); } + catch ( const std::out_of_range & ex ) + { detail::report_exception( out, "std::out_of_range:", ex.what() ); } + catch ( const std::range_error & ex ) + { detail::report_exception( out, "std::range_error:", ex.what() ); } + catch ( const std::overflow_error & ex ) + { detail::report_exception( out, "std::overflow_error:", ex.what() ); } + catch ( const std::underflow_error & ex ) + { detail::report_exception( out, "std::underflow_error:", ex.what() ); } + catch ( const std::logic_error & ex ) + { detail::report_exception( out, "std::logic_error:", ex.what() ); } + catch ( const std::runtime_error & ex ) + { detail::report_exception( out, "std::runtime_error:", ex.what() ); } + catch ( const std::exception & ex ) + { detail::report_exception( out, "std::exception:", ex.what() ); } + + catch ( ... ) + { detail::report_exception( out, "unknown exception", "" ); } +#endif // AUTOBOOST_NO_EXCEPTIONS + + if ( exception_thrown ) result = autoboost::exit_exception_failure; + + if ( result != 0 && result != exit_success ) + { + out << std::endl << "**** returning with error code " + << result << std::endl; + err + << "********** errors detected; see stdout for details ***********" + << std::endl; + } +#if !defined(AUTOBOOST_NO_CPP_MAIN_SUCCESS_MESSAGE) + else { out << std::flush << "no errors detected" << std::endl; } +#endif + return result; + } // catch_exceptions + +} // boost + +#endif // AUTOBOOST_CATCH_EXCEPTIONS_HPP + diff --git a/contrib/autoboost/autoboost/detail/compressed_pair.hpp b/contrib/autoboost/autoboost/detail/compressed_pair.hpp new file mode 100644 index 000000000..809a445af --- /dev/null +++ b/contrib/autoboost/autoboost/detail/compressed_pair.hpp @@ -0,0 +1,443 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Use, modification and distribution are subject to 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/libs/utility for most recent version including documentation. + +// compressed_pair: pair that "compresses" empty members +// (see libs/utility/doc/html/compressed_pair.html) +// +// JM changes 25 Jan 2004: +// For the case where T1 == T2 and both are empty, then first() and second() +// should return different objects. +// JM changes 25 Jan 2000: +// Removed default arguments from compressed_pair_switch to get +// C++ Builder 4 to accept them +// rewriten swap to get gcc and C++ builder to compile. +// added partial specialisations for case T1 == T2 to avoid duplicate constructor defs. + +#ifndef AUTOBOOST_DETAIL_COMPRESSED_PAIR_HPP +#define AUTOBOOST_DETAIL_COMPRESSED_PAIR_HPP + +#include + +#include +#include +#include +#include + +#ifdef AUTOBOOST_MSVC +# pragma warning(push) +# pragma warning(disable:4512) +#endif +namespace autoboost +{ + +template +class compressed_pair; + + +// compressed_pair + +namespace details +{ + // JM altered 26 Jan 2000: + template + struct compressed_pair_switch; + + template + struct compressed_pair_switch + {static const int value = 0;}; + + template + struct compressed_pair_switch + {static const int value = 3;}; + + template + struct compressed_pair_switch + {static const int value = 1;}; + + template + struct compressed_pair_switch + {static const int value = 2;}; + + template + struct compressed_pair_switch + {static const int value = 4;}; + + template + struct compressed_pair_switch + {static const int value = 5;}; + + template class compressed_pair_imp; + +#ifdef __GNUC__ + // workaround for GCC (JM): + using std::swap; +#endif + // + // can't call unqualified swap from within classname::swap + // as Koenig lookup rules will find only the classname::swap + // member function not the global declaration, so use cp_swap + // as a forwarding function (JM): + template + inline void cp_swap(T& t1, T& t2) + { +#ifndef __GNUC__ + using std::swap; +#endif + swap(t1, t2); + } + + // 0 derive from neither + + template + class compressed_pair_imp + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_(x), second_(y) {} + + compressed_pair_imp(first_param_type x) + : first_(x) {} + + compressed_pair_imp(second_param_type y) + : second_(y) {} + + first_reference first() {return first_;} + first_const_reference first() const {return first_;} + + second_reference second() {return second_;} + second_const_reference second() const {return second_;} + + void swap(::autoboost::compressed_pair& y) + { + cp_swap(first_, y.first()); + cp_swap(second_, y.second()); + } + private: + first_type first_; + second_type second_; + }; + + // 1 derive from T1 + + template + class compressed_pair_imp + : protected ::autoboost::remove_cv::type + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_type(x), second_(y) {} + + compressed_pair_imp(first_param_type x) + : first_type(x) {} + + compressed_pair_imp(second_param_type y) + : second_(y) {} + + first_reference first() {return *this;} + first_const_reference first() const {return *this;} + + second_reference second() {return second_;} + second_const_reference second() const {return second_;} + + void swap(::autoboost::compressed_pair& y) + { + // no need to swap empty base class: + cp_swap(second_, y.second()); + } + private: + second_type second_; + }; + + // 2 derive from T2 + + template + class compressed_pair_imp + : protected ::autoboost::remove_cv::type + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : second_type(y), first_(x) {} + + compressed_pair_imp(first_param_type x) + : first_(x) {} + + compressed_pair_imp(second_param_type y) + : second_type(y) {} + + first_reference first() {return first_;} + first_const_reference first() const {return first_;} + + second_reference second() {return *this;} + second_const_reference second() const {return *this;} + + void swap(::autoboost::compressed_pair& y) + { + // no need to swap empty base class: + cp_swap(first_, y.first()); + } + + private: + first_type first_; + }; + + // 3 derive from T1 and T2 + + template + class compressed_pair_imp + : protected ::autoboost::remove_cv::type, + protected ::autoboost::remove_cv::type + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_type(x), second_type(y) {} + + compressed_pair_imp(first_param_type x) + : first_type(x) {} + + compressed_pair_imp(second_param_type y) + : second_type(y) {} + + first_reference first() {return *this;} + first_const_reference first() const {return *this;} + + second_reference second() {return *this;} + second_const_reference second() const {return *this;} + // + // no need to swap empty bases: + void swap(::autoboost::compressed_pair&) {} + }; + + // JM + // 4 T1 == T2, T1 and T2 both empty + // Originally this did not store an instance of T2 at all + // but that led to problems beause it meant &x.first() == &x.second() + // which is not true for any other kind of pair, so now we store an instance + // of T2 just in case the user is relying on first() and second() returning + // different objects (albeit both empty). + template + class compressed_pair_imp + : protected ::autoboost::remove_cv::type + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_type(x), m_second(y) {} + + compressed_pair_imp(first_param_type x) + : first_type(x), m_second(x) {} + + first_reference first() {return *this;} + first_const_reference first() const {return *this;} + + second_reference second() {return m_second;} + second_const_reference second() const {return m_second;} + + void swap(::autoboost::compressed_pair&) {} + private: + T2 m_second; + }; + + // 5 T1 == T2 and are not empty: //JM + + template + class compressed_pair_imp + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_(x), second_(y) {} + + compressed_pair_imp(first_param_type x) + : first_(x), second_(x) {} + + first_reference first() {return first_;} + first_const_reference first() const {return first_;} + + second_reference second() {return second_;} + second_const_reference second() const {return second_;} + + void swap(::autoboost::compressed_pair& y) + { + cp_swap(first_, y.first()); + cp_swap(second_, y.second()); + } + private: + first_type first_; + second_type second_; + }; + +} // details + +template +class compressed_pair + : private ::autoboost::details::compressed_pair_imp::type, typename remove_cv::type>::value, + ::autoboost::is_empty::value, + ::autoboost::is_empty::value>::value> +{ +private: + typedef details::compressed_pair_imp::type, typename remove_cv::type>::value, + ::autoboost::is_empty::value, + ::autoboost::is_empty::value>::value> base; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : base() {} + compressed_pair(first_param_type x, second_param_type y) : base(x, y) {} + explicit compressed_pair(first_param_type x) : base(x) {} + explicit compressed_pair(second_param_type y) : base(y) {} + + first_reference first() {return base::first();} + first_const_reference first() const {return base::first();} + + second_reference second() {return base::second();} + second_const_reference second() const {return base::second();} + + void swap(compressed_pair& y) { base::swap(y); } +}; + +// JM +// Partial specialisation for case where T1 == T2: +// +template +class compressed_pair + : private details::compressed_pair_imp::type, typename remove_cv::type>::value, + ::autoboost::is_empty::value, + ::autoboost::is_empty::value>::value> +{ +private: + typedef details::compressed_pair_imp::type, typename remove_cv::type>::value, + ::autoboost::is_empty::value, + ::autoboost::is_empty::value>::value> base; +public: + typedef T first_type; + typedef T second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : base() {} + compressed_pair(first_param_type x, second_param_type y) : base(x, y) {} +#if !(defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) + explicit +#endif + compressed_pair(first_param_type x) : base(x) {} + + first_reference first() {return base::first();} + first_const_reference first() const {return base::first();} + + second_reference second() {return base::second();} + second_const_reference second() const {return base::second();} + + void swap(::autoboost::compressed_pair& y) { base::swap(y); } +}; + +template +inline +void +swap(compressed_pair& x, compressed_pair& y) +{ + x.swap(y); +} + +} // boost + +#ifdef AUTOBOOST_MSVC +# pragma warning(pop) +#endif + +#endif // AUTOBOOST_DETAIL_COMPRESSED_PAIR_HPP + diff --git a/contrib/autoboost/autoboost/detail/container_fwd.hpp b/contrib/autoboost/autoboost/detail/container_fwd.hpp new file mode 100644 index 000000000..d42e16599 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/container_fwd.hpp @@ -0,0 +1,157 @@ + +// Copyright 2005-2011 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) + +// Note: if you change this include guard, you also need to change +// container_fwd_compile_fail.cpp +#if !defined(AUTOBOOST_DETAIL_CONTAINER_FWD_HPP) +#define AUTOBOOST_DETAIL_CONTAINER_FWD_HPP + +#if defined(_MSC_VER) && \ + !defined(AUTOBOOST_DETAIL_TEST_CONFIG_ONLY) +# pragma once +#endif + +#include +#include + +//////////////////////////////////////////////////////////////////////////////// +// // +// Define AUTOBOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to // +// forward declare standard containers. // +// // +// AUTOBOOST_DETAIL_CONTAINER_FWD to make it foward declare containers even if it // +// normally doesn't. // +// // +// AUTOBOOST_DETAIL_NO_CONTAINER_FWD overrides AUTOBOOST_DETAIL_CONTAINER_FWD. // +// // +//////////////////////////////////////////////////////////////////////////////// + +#if !defined(AUTOBOOST_DETAIL_NO_CONTAINER_FWD) +# if defined(AUTOBOOST_DETAIL_CONTAINER_FWD) + // Force forward declarations. +# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) + // STLport +# define AUTOBOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(__LIBCOMO__) + // Comeau STL: +# define AUTOBOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) + // Rogue Wave library: +# define AUTOBOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(_LIBCPP_VERSION) + // libc++ +# define AUTOBOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(__GLIBCPP__) || defined(__GLIBCXX__) + // GNU libstdc++ 3 + // + // Disable forwarding for all recent versions, as the library has a + // versioned namespace mode, and I don't know how to detect it. +# if __GLIBCXX__ >= 20070513 \ + || defined(_GLIBCXX_DEBUG) \ + || defined(_GLIBCXX_PARALLEL) \ + || defined(_GLIBCXX_PROFILE) +# define AUTOBOOST_DETAIL_NO_CONTAINER_FWD +# else +# if defined(__GLIBCXX__) && __GLIBCXX__ >= 20040530 +# define AUTOBOOST_CONTAINER_FWD_COMPLEX_STRUCT +# endif +# endif +# elif defined(__STL_CONFIG_H) + // generic SGI STL + // + // Forward declaration seems to be okay, but it has a couple of odd + // implementations. +# define AUTOBOOST_CONTAINER_FWD_BAD_BITSET +# if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG) +# define AUTOBOOST_CONTAINER_FWD_BAD_DEQUE +# endif +# elif defined(__MSL_CPP__) + // MSL standard lib: +# define AUTOBOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(__IBMCPP__) + // The default VACPP std lib, forward declaration seems to be fine. +# elif defined(MSIPL_COMPILE_H) + // Modena C++ standard library +# define AUTOBOOST_DETAIL_NO_CONTAINER_FWD +# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) + // Dinkumware Library (this has to appear after any possible replacement + // libraries) +# else +# define AUTOBOOST_DETAIL_NO_CONTAINER_FWD +# endif +#endif + +#if !defined(AUTOBOOST_DETAIL_TEST_CONFIG_ONLY) + +#if defined(AUTOBOOST_DETAIL_NO_CONTAINER_FWD) && \ + !defined(AUTOBOOST_DETAIL_TEST_FORCE_CONTAINER_FWD) + +#include +#include +#include +#include +#include +#include +#include +#include + +#else + +#include + +#if defined(AUTOBOOST_CONTAINER_FWD_BAD_DEQUE) +#include +#endif + +#if defined(AUTOBOOST_CONTAINER_FWD_BAD_BITSET) +#include +#endif + +#if defined(AUTOBOOST_MSVC) +#pragma warning(push) +#pragma warning(disable:4099) // struct/class mismatch in fwd declarations +#endif + +namespace std +{ + template class allocator; + template class basic_string; + + template struct char_traits; + +#if defined(AUTOBOOST_CONTAINER_FWD_COMPLEX_STRUCT) + template struct complex; +#else + template class complex; +#endif + +#if !defined(AUTOBOOST_CONTAINER_FWD_BAD_DEQUE) + template class deque; +#endif + + template class list; + template class vector; + template class map; + template + class multimap; + template class set; + template class multiset; + +#if !defined(AUTOBOOST_CONTAINER_FWD_BAD_BITSET) + template class bitset; +#endif + template struct pair; +} + +#if defined(AUTOBOOST_MSVC) +#pragma warning(pop) +#endif + +#endif // AUTOBOOST_DETAIL_NO_CONTAINER_FWD && + // !defined(AUTOBOOST_DETAIL_TEST_FORCE_CONTAINER_FWD) + +#endif // AUTOBOOST_DETAIL_TEST_CONFIG_ONLY + +#endif diff --git a/contrib/autoboost/autoboost/detail/dynamic_bitset.hpp b/contrib/autoboost/autoboost/detail/dynamic_bitset.hpp new file mode 100644 index 000000000..6de44666c --- /dev/null +++ b/contrib/autoboost/autoboost/detail/dynamic_bitset.hpp @@ -0,0 +1,241 @@ +// ----------------------------------------------------------- +// +// Copyright (c) 2001-2002 Chuck Allison and Jeremy Siek +// Copyright (c) 2003-2006, 2008 Gennaro Prota +// +// Copyright (c) 2014 Glen Joseph Fernandes +// glenfe at live dot com +// +// 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) +// +// ----------------------------------------------------------- + +#ifndef AUTOBOOST_DETAIL_DYNAMIC_BITSET_HPP +#define AUTOBOOST_DETAIL_DYNAMIC_BITSET_HPP + +#include +#include +#include "autoboost/config.hpp" +#include "autoboost/detail/workaround.hpp" + + +namespace autoboost { + + namespace detail { + namespace dynamic_bitset_impl { + + // Gives (read-)access to the object representation + // of an object of type T (3.9p4). CANNOT be used + // on a base sub-object + // + template + inline const unsigned char * object_representation (T* p) + { + return static_cast(static_cast(p)); + } + + template + struct shifter + { + static void left_shift(T & v) { + amount >= width ? (v = 0) + : (v >>= AUTOBOOST_DYNAMIC_BITSET_WRAP_CONSTANT(amount)); + } + }; + + // ------- count function implementation -------------- + + typedef unsigned char byte_type; + + // These two entities + // + // enum mode { access_by_bytes, access_by_blocks }; + // template struct mode_to_type {}; + // + // were removed, since the regression logs (as of 24 Aug 2008) + // showed that several compilers had troubles with recognizing + // + // const mode m = access_by_bytes + // + // as a constant expression + // + // * So, we'll use bool, instead of enum *. + // + template + struct value_to_type + { + value_to_type() {} + }; + const bool access_by_bytes = true; + const bool access_by_blocks = false; + + + // the table: wrapped in a class template, so + // that it is only instantiated if/when needed + // + template + struct count_table { static const byte_type table[]; }; + + template <> + struct count_table { /* no table */ }; + + + const unsigned int table_width = 8; + template + const byte_type count_table::table[] = + { + // Automatically generated by GPTableGen.exe v.1.0 + // + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 + }; + + + // overload for access by bytes + // + + template + inline std::size_t do_count(Iterator first, std::size_t length, + int /*dummy param*/, + value_to_type* ) + { + std::size_t num = 0; + if (length) + { + const byte_type * p = object_representation(&*first); + length *= sizeof(*first); + + do { + num += count_table<>::table[*p]; + ++p; + --length; + + } while (length); + } + + return num; + } + + + // overload for access by blocks + // + template + inline std::size_t do_count(Iterator first, std::size_t length, ValueType, + value_to_type*) + { + std::size_t num = 0; + while (length){ + + ValueType value = *first; + while (value) { + num += count_table<>::table[value & ((1u<>= table_width; + } + + ++first; + --length; + } + + return num; + } + + // ------------------------------------------------------- + + + // Some library implementations simply return a dummy + // value such as + // + // size_type(-1) / sizeof(T) + // + // from vector<>::max_size. This tries to get more + // meaningful info. + // + template + inline typename T::size_type vector_max_size_workaround(const T & v) + AUTOBOOST_NOEXCEPT + { + typedef typename T::allocator_type allocator_type; + + const allocator_type& alloc = v.get_allocator(); + +#if !defined(AUTOBOOST_NO_CXX11_ALLOCATOR) + typedef std::allocator_traits allocator_traits; + + const typename allocator_traits::size_type alloc_max = + allocator_traits::max_size(alloc); +#else + const typename allocator_type::size_type alloc_max = alloc.max_size(); +#endif + + const typename T::size_type container_max = v.max_size(); + + return alloc_max < container_max ? alloc_max : container_max; + } + + // for static_asserts + template + struct allowed_block_type { + enum { value = T(-1) > 0 }; // ensure T has no sign + }; + + template <> + struct allowed_block_type { + enum { value = false }; + }; + + + template + struct is_numeric { + enum { value = false }; + }; + +# define AUTOBOOST_dynamic_bitset_is_numeric(x) \ + template<> \ + struct is_numeric< x > { \ + enum { value = true }; \ + } /**/ + + AUTOBOOST_dynamic_bitset_is_numeric(bool); + AUTOBOOST_dynamic_bitset_is_numeric(char); + +#if !defined(AUTOBOOST_NO_INTRINSIC_WCHAR_T) + AUTOBOOST_dynamic_bitset_is_numeric(wchar_t); +#endif + + AUTOBOOST_dynamic_bitset_is_numeric(signed char); + AUTOBOOST_dynamic_bitset_is_numeric(short int); + AUTOBOOST_dynamic_bitset_is_numeric(int); + AUTOBOOST_dynamic_bitset_is_numeric(long int); + + AUTOBOOST_dynamic_bitset_is_numeric(unsigned char); + AUTOBOOST_dynamic_bitset_is_numeric(unsigned short); + AUTOBOOST_dynamic_bitset_is_numeric(unsigned int); + AUTOBOOST_dynamic_bitset_is_numeric(unsigned long); + +#if defined(AUTOBOOST_HAS_LONG_LONG) + AUTOBOOST_dynamic_bitset_is_numeric(::autoboost::long_long_type); + AUTOBOOST_dynamic_bitset_is_numeric(::autoboost::ulong_long_type); +#endif + + // intentionally omitted + //AUTOBOOST_dynamic_bitset_is_numeric(float); + //AUTOBOOST_dynamic_bitset_is_numeric(double); + //AUTOBOOST_dynamic_bitset_is_numeric(long double); + +#undef AUTOBOOST_dynamic_bitset_is_numeric + + } // dynamic_bitset_impl + } // namespace detail + +} // namespace autoboost + +#endif // include guard + diff --git a/contrib/autoboost/autoboost/detail/endian.hpp b/contrib/autoboost/autoboost/detail/endian.hpp new file mode 100644 index 000000000..8b88dd0e8 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/endian.hpp @@ -0,0 +1,11 @@ +// Copyright 2013 Rene Rivera +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef AUTOBOOST_DETAIL_ENDIAN_HPP +#define AUTOBOOST_DETAIL_ENDIAN_HPP + +// Use the Predef library for the detection of endianess. +#include + +#endif diff --git a/contrib/autoboost/boost/detail/fenv.hpp b/contrib/autoboost/autoboost/detail/fenv.hpp similarity index 94% rename from contrib/autoboost/boost/detail/fenv.hpp rename to contrib/autoboost/autoboost/detail/fenv.hpp index b268f5c1c..b77b4383a 100644 --- a/contrib/autoboost/boost/detail/fenv.hpp +++ b/contrib/autoboost/autoboost/detail/fenv.hpp @@ -5,14 +5,14 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ -#include +#include -#if defined(BOOST_NO_FENV_H) +#if defined(AUTOBOOST_NO_FENV_H) #error This platform does not have a floating point environment #endif -#if !defined(BOOST_DETAIL_FENV_HPP) -#define BOOST_DETAIL_FENV_HPP +#if !defined(AUTOBOOST_DETAIL_FENV_HPP) +#define AUTOBOOST_DETAIL_FENV_HPP /* If we're using clang + glibc, we have to get hacky. * See http://llvm.org/bugs/show_bug.cgi?id=6907 */ @@ -98,4 +98,4 @@ #endif -#endif /* BOOST_DETAIL_FENV_HPP */ +#endif /* AUTOBOOST_DETAIL_FENV_HPP */ diff --git a/contrib/autoboost/autoboost/detail/has_default_constructor.hpp b/contrib/autoboost/autoboost/detail/has_default_constructor.hpp new file mode 100644 index 000000000..308c2723d --- /dev/null +++ b/contrib/autoboost/autoboost/detail/has_default_constructor.hpp @@ -0,0 +1,29 @@ + +// (C) Copyright Matthias Troyerk 2006. +// Use, modification and distribution are subject to 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/libs/type_traits for most recent version including documentation. + +#ifndef AUTOBOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED +#define AUTOBOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED + +#include + +namespace autoboost { namespace detail { + +/// type trait to check for a default constructor +/// +/// The default implementation just checks for a trivial constructor. +/// Using some compiler magic it might be possible to provide a better default + +template +struct has_default_constructor + : public has_trivial_constructor +{}; + +} } // namespace autoboost::detail + + +#endif // AUTOBOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/detail/identifier.hpp b/contrib/autoboost/autoboost/detail/identifier.hpp new file mode 100644 index 000000000..da5f65b12 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/identifier.hpp @@ -0,0 +1,87 @@ +// boost/identifier.hpp ----------------------------------------------------// + +// Copyright Beman Dawes 2006 + +// 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 documentation at http://www.boost.org/libs/utility + +#ifndef AUTOBOOST_IDENTIFIER_HPP +#define AUTOBOOST_IDENTIFIER_HPP + +#include +#include +#include + +namespace autoboost +{ + namespace detail + { + // class template identifier ---------------------------------------------// + + // Always used as a base class so that different instantiations result in + // different class types even if instantiated with the same value type T. + + // Expected usage is that T is often an integer type, best passed by + // value. There is no reason why T can't be a possibly larger class such as + // std::string, best passed by const reference. + + // This implementation uses pass by value, based on expected common uses. + + template + class identifier + { + public: + typedef T value_type; + + const value_type value() const { return m_value; } + void assign( value_type v ) { m_value = v; } + + bool operator==( const D & rhs ) const { return m_value == rhs.m_value; } + bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; } + bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; } + bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; } + bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; } + bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; } + + typedef void (*unspecified_bool_type)(D); // without the D, unspecified_bool_type + static void unspecified_bool_true(D){} // conversion allows relational operators + // between different identifier types + + operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; } + bool operator!() const { return m_value == value_type(); } + + // constructors are protected so that class can only be used as a base class + protected: + identifier() {} + explicit identifier( value_type v ) : m_value(v) {} + + private: + T m_value; + }; + + //#ifndef AUTOBOOST_NO_SFINAE + + // template + // typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >, + // Ostream & >::type operator<<( Ostream & os, const Id & id ) + // { + // return os << id.value(); + // } + + // template + // typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >, + // Istream & >::type operator>>( Istream & is, Id & id ) + // { + // typename Id::value_type v; + // is >> v; + // id.value( v ); + // return is; + // } + //#endif + + } // namespace detail +} // namespace autoboost + +#endif // AUTOBOOST_IDENTIFIER_HPP diff --git a/contrib/autoboost/autoboost/detail/indirect_traits.hpp b/contrib/autoboost/autoboost/detail/indirect_traits.hpp new file mode 100644 index 000000000..1af78561b --- /dev/null +++ b/contrib/autoboost/autoboost/detail/indirect_traits.hpp @@ -0,0 +1,205 @@ +// Copyright David Abrahams 2002. +// 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) +#ifndef AB_INDIRECT_TRAITS_DWA2002131_HPP +# define AB_INDIRECT_TRAITS_DWA2002131_HPP +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include +# include + +# include +# include +# include +# include +# include +# include + + +namespace autoboost { namespace detail { + +namespace indirect_traits { + +template +struct is_reference_to_const : mpl::false_ +{ +}; + +template +struct is_reference_to_const : mpl::true_ +{ +}; + +# if defined(AUTOBOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround +template +struct is_reference_to_const : mpl::true_ +{ +}; +# endif + +template +struct is_reference_to_function : mpl::false_ +{ +}; + +template +struct is_reference_to_function : is_function +{ +}; + +template +struct is_pointer_to_function : mpl::false_ +{ +}; + +// There's no such thing as a pointer-to-cv-function, so we don't need +// specializations for those +template +struct is_pointer_to_function : is_function +{ +}; + +template +struct is_reference_to_member_function_pointer_impl : mpl::false_ +{ +}; + +template +struct is_reference_to_member_function_pointer_impl + : is_member_function_pointer::type> +{ +}; + + +template +struct is_reference_to_member_function_pointer + : is_reference_to_member_function_pointer_impl +{ + AUTOBOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T)) +}; + +template +struct is_reference_to_function_pointer_aux + : mpl::and_< + is_reference + , is_pointer_to_function< + typename remove_cv< + typename remove_reference::type + >::type + > + > +{ + // There's no such thing as a pointer-to-cv-function, so we don't need specializations for those +}; + +template +struct is_reference_to_function_pointer + : mpl::if_< + is_reference_to_function + , mpl::false_ + , is_reference_to_function_pointer_aux + >::type +{ +}; + +template +struct is_reference_to_non_const + : mpl::and_< + is_reference + , mpl::not_< + is_reference_to_const + > + > +{ +}; + +template +struct is_reference_to_volatile : mpl::false_ +{ +}; + +template +struct is_reference_to_volatile : mpl::true_ +{ +}; + +# if defined(AUTOBOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround +template +struct is_reference_to_volatile : mpl::true_ +{ +}; +# endif + + +template +struct is_reference_to_pointer : mpl::false_ +{ +}; + +template +struct is_reference_to_pointer : mpl::true_ +{ +}; + +template +struct is_reference_to_pointer : mpl::true_ +{ +}; + +template +struct is_reference_to_pointer : mpl::true_ +{ +}; + +template +struct is_reference_to_pointer : mpl::true_ +{ +}; + +template +struct is_reference_to_class + : mpl::and_< + is_reference + , is_class< + typename remove_cv< + typename remove_reference::type + >::type + > + > +{ + AUTOBOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T)) +}; + +template +struct is_pointer_to_class + : mpl::and_< + is_pointer + , is_class< + typename remove_cv< + typename remove_pointer::type + >::type + > + > +{ + AUTOBOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T)) +}; + + +} + +using namespace indirect_traits; + +}} // namespace autoboost::python::detail + +#endif // INDIRECT_TRAITS_DWA2002131_HPP diff --git a/contrib/autoboost/autoboost/detail/interlocked.hpp b/contrib/autoboost/autoboost/detail/interlocked.hpp new file mode 100644 index 000000000..34924920f --- /dev/null +++ b/contrib/autoboost/autoboost/detail/interlocked.hpp @@ -0,0 +1,218 @@ +#ifndef AUTOBOOST_DETAIL_INTERLOCKED_HPP_INCLUDED +#define AUTOBOOST_DETAIL_INTERLOCKED_HPP_INCLUDED + +// +// boost/detail/interlocked.hpp +// +// Copyright 2005 Peter Dimov +// +// 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) +// + +#include + +// MS compatible compilers support #pragma once +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if defined( AUTOBOOST_USE_WINDOWS_H ) + +# include + +# define AUTOBOOST_INTERLOCKED_INCREMENT InterlockedIncrement +# define AUTOBOOST_INTERLOCKED_DECREMENT InterlockedDecrement +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE InterlockedExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer + +#elif defined( AUTOBOOST_USE_INTRIN_H ) + +#include + +# define AUTOBOOST_INTERLOCKED_INCREMENT _InterlockedIncrement +# define AUTOBOOST_INTERLOCKED_DECREMENT _InterlockedDecrement +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE _InterlockedExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd + +# if defined(_M_IA64) || defined(_M_AMD64) || defined(__x86_64__) || defined(__x86_64) + +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer + +# else + +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)AUTOBOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) + +# endif + +#elif defined(_WIN32_WCE) + +#if _WIN32_WCE >= 0x600 + +extern "C" long __cdecl _InterlockedIncrement( long volatile * ); +extern "C" long __cdecl _InterlockedDecrement( long volatile * ); +extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); +extern "C" long __cdecl _InterlockedExchange( long volatile *, long ); +extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long ); + +# define AUTOBOOST_INTERLOCKED_INCREMENT _InterlockedIncrement +# define AUTOBOOST_INTERLOCKED_DECREMENT _InterlockedDecrement +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE _InterlockedExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd + +#else +// under Windows CE we still have old-style Interlocked* functions + +extern "C" long __cdecl InterlockedIncrement( long* ); +extern "C" long __cdecl InterlockedDecrement( long* ); +extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); +extern "C" long __cdecl InterlockedExchange( long*, long ); +extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); + +# define AUTOBOOST_INTERLOCKED_INCREMENT InterlockedIncrement +# define AUTOBOOST_INTERLOCKED_DECREMENT InterlockedDecrement +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE InterlockedExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd + +#endif + +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare))) +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)AUTOBOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange))) + +#elif defined( AUTOBOOST_MSVC ) || defined( AUTOBOOST_INTEL_WIN ) + +#if defined( AUTOBOOST_MSVC ) && AUTOBOOST_MSVC >= 1400 + +#include + +#else + +# if defined( __CLRCALL_PURE_OR_CDECL ) +# define AUTOBOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL __CLRCALL_PURE_OR_CDECL +# else +# define AUTOBOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL __cdecl +# endif + +extern "C" long AUTOBOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedIncrement( long volatile * ); +extern "C" long AUTOBOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedDecrement( long volatile * ); +extern "C" long AUTOBOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedCompareExchange( long volatile *, long, long ); +extern "C" long AUTOBOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedExchange( long volatile *, long ); +extern "C" long AUTOBOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedExchangeAdd( long volatile *, long ); + +# undef AUTOBOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL + +# if defined( AUTOBOOST_MSVC ) && AUTOBOOST_MSVC >= 1310 +# pragma intrinsic( _InterlockedIncrement ) +# pragma intrinsic( _InterlockedDecrement ) +# pragma intrinsic( _InterlockedCompareExchange ) +# pragma intrinsic( _InterlockedExchange ) +# pragma intrinsic( _InterlockedExchangeAdd ) +# endif + +#endif + +# if defined(_M_IA64) || defined(_M_AMD64) + +extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* ); +extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); + +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer + +# else + +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)AUTOBOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) + +# endif + +# define AUTOBOOST_INTERLOCKED_INCREMENT _InterlockedIncrement +# define AUTOBOOST_INTERLOCKED_DECREMENT _InterlockedDecrement +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE _InterlockedExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd + +// Unlike __MINGW64__, __MINGW64_VERSION_MAJOR is defined by MinGW-w64 for both 32 and 64-bit targets. +#elif defined(__MINGW64_VERSION_MAJOR) + +// MinGW-w64 provides intrin.h for both 32 and 64-bit targets. +#include + +# define AUTOBOOST_INTERLOCKED_INCREMENT _InterlockedIncrement +# define AUTOBOOST_INTERLOCKED_DECREMENT _InterlockedDecrement +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE _InterlockedExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd +# if defined(__x86_64__) || defined(__x86_64) +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer +# else +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)AUTOBOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) +# endif + +#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) + +#define AUTOBOOST_INTERLOCKED_IMPORT __declspec(dllimport) + +namespace autoboost +{ + +namespace detail +{ + +extern "C" AUTOBOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * ); +extern "C" AUTOBOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * ); +extern "C" AUTOBOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long ); +extern "C" AUTOBOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long ); +extern "C" AUTOBOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long ); + +# if defined(_M_IA64) || defined(_M_AMD64) +extern "C" AUTOBOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* ); +extern "C" AUTOBOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* ); +# endif + +} // namespace detail + +} // namespace autoboost + +# define AUTOBOOST_INTERLOCKED_INCREMENT ::autoboost::detail::InterlockedIncrement +# define AUTOBOOST_INTERLOCKED_DECREMENT ::autoboost::detail::InterlockedDecrement +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE ::autoboost::detail::InterlockedCompareExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE ::autoboost::detail::InterlockedExchange +# define AUTOBOOST_INTERLOCKED_EXCHANGE_ADD ::autoboost::detail::InterlockedExchangeAdd + +# if defined(_M_IA64) || defined(_M_AMD64) +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::autoboost::detail::InterlockedCompareExchangePointer +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER ::autoboost::detail::InterlockedExchangePointer +# else +# define AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) +# define AUTOBOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)AUTOBOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) +# endif + +#else + +# error "Interlocked intrinsics not available" + +#endif + +#endif // #ifndef AUTOBOOST_DETAIL_INTERLOCKED_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/detail/is_incrementable.hpp b/contrib/autoboost/autoboost/detail/is_incrementable.hpp new file mode 100644 index 000000000..89341afd6 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/is_incrementable.hpp @@ -0,0 +1,133 @@ +// Copyright David Abrahams 2004. Use, modification and distribution is +// subject to 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) +#ifndef AB_IS_INCREMENTABLE_DWA200415_HPP +# define AB_IS_INCREMENTABLE_DWA200415_HPP + +# include +# include +# include +# include +# include + +// Must be the last include +# include + +namespace autoboost { namespace detail { + +// is_incrementable metafunction +// +// Requires: Given x of type T&, if the expression ++x is well-formed +// it must have complete type; otherwise, it must neither be ambiguous +// nor violate access. + +// This namespace ensures that ADL doesn't mess things up. +namespace is_incrementable_ +{ + // a type returned from operator++ when no increment is found in the + // type's own namespace + struct tag {}; + + // any soaks up implicit conversions and makes the following + // operator++ less-preferred than any other such operator that + // might be found via ADL. + struct any { template any(T const&); }; + + // This is a last-resort operator++ for when none other is found +# if AUTOBOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2 + +} + +namespace is_incrementable_2 +{ + is_incrementable_::tag operator++(is_incrementable_::any const&); + is_incrementable_::tag operator++(is_incrementable_::any const&,int); +} +using namespace is_incrementable_2; + +namespace is_incrementable_ +{ + +# else + + tag operator++(any const&); + tag operator++(any const&,int); + +# endif + +# if AUTOBOOST_WORKAROUND(__MWERKS__, AUTOBOOST_TESTED_AT(0x3202)) +# define AUTOBOOST_comma(a,b) (a) +# else + // In case an operator++ is found that returns void, we'll use ++x,0 + tag operator,(tag,int); +# define AUTOBOOST_comma(a,b) (a,b) +# endif + +# if defined(AUTOBOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4913) // Warning about operator, +# endif + + // two check overloads help us identify which operator++ was picked + char (& check_(tag) )[2]; + + template + char check_(T const&); + + + template + struct impl + { + static typename autoboost::remove_cv::type& x; + + AUTOBOOST_STATIC_CONSTANT( + bool + , value = sizeof(is_incrementable_::check_(AUTOBOOST_comma(++x,0))) == 1 + ); + }; + + template + struct postfix_impl + { + static typename autoboost::remove_cv::type& x; + + AUTOBOOST_STATIC_CONSTANT( + bool + , value = sizeof(is_incrementable_::check_(AUTOBOOST_comma(x++,0))) == 1 + ); + }; + +# if defined(AUTOBOOST_MSVC) +# pragma warning(pop) +# endif + +} + +# undef AUTOBOOST_comma + +template +struct is_incrementable +AUTOBOOST_TT_AUX_BOOL_C_BASE(::autoboost::detail::is_incrementable_::impl::value) +{ + AUTOBOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::autoboost::detail::is_incrementable_::impl::value) + AUTOBOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T)) +}; + +template +struct is_postfix_incrementable +AUTOBOOST_TT_AUX_BOOL_C_BASE(::autoboost::detail::is_incrementable_::impl::value) +{ + AUTOBOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::autoboost::detail::is_incrementable_::postfix_impl::value) + AUTOBOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T)) +}; + +} // namespace detail + +AUTOBOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::autoboost::detail::is_incrementable) +AUTOBOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::autoboost::detail::is_postfix_incrementable) + +} // namespace autoboost + +# include + +#endif // IS_INCREMENTABLE_DWA200415_HPP diff --git a/contrib/autoboost/autoboost/detail/is_sorted.hpp b/contrib/autoboost/autoboost/detail/is_sorted.hpp new file mode 100644 index 000000000..b1ab7865a --- /dev/null +++ b/contrib/autoboost/autoboost/detail/is_sorted.hpp @@ -0,0 +1,56 @@ +/*============================================================================== + Copyright (c) 2010-2011 Bryce Lelbach + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_DETAIL_SORTED_HPP +#define AUTOBOOST_DETAIL_SORTED_HPP + +#include + +#include + +namespace autoboost { +namespace detail { + +template +inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) { + if (first == last) + return last; + + Iterator it = first; ++it; + + for (; it != last; first = it, ++it) + if (c(*it, *first)) + return it; + + return it; +} + +template +inline Iterator is_sorted_until (Iterator first, Iterator last) { + typedef typename autoboost::detail::iterator_traits::value_type + value_type; + + typedef std::less c; + + return ::autoboost::detail::is_sorted_until(first, last, c()); +} + +template +inline bool is_sorted (Iterator first, Iterator last, Comp c) { + return ::autoboost::detail::is_sorted_until(first, last, c) == last; +} + +template +inline bool is_sorted (Iterator first, Iterator last) { + return ::autoboost::detail::is_sorted_until(first, last) == last; +} + +} // detail +} // boost + +#endif // AUTOBOOST_DETAIL_SORTED_HPP + diff --git a/contrib/autoboost/autoboost/detail/is_xxx.hpp b/contrib/autoboost/autoboost/detail/is_xxx.hpp new file mode 100644 index 000000000..536180f34 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/is_xxx.hpp @@ -0,0 +1,27 @@ +// Copyright David Abrahams 2005. 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) +#ifndef AUTOBOOST_DETAIL_IS_XXX_DWA20051011_HPP +# define AUTOBOOST_DETAIL_IS_XXX_DWA20051011_HPP + +# include +# include +# include + + +# define AUTOBOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \ +template \ +struct is_##name : mpl::false_ \ +{ \ +}; \ + \ +template < AUTOBOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \ +struct is_##name< \ + qualified_name< AUTOBOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \ +> \ + : mpl::true_ \ +{ \ +}; + + +#endif // AUTOBOOST_DETAIL_IS_XXX_DWA20051011_HPP diff --git a/contrib/autoboost/autoboost/detail/iterator.hpp b/contrib/autoboost/autoboost/detail/iterator.hpp new file mode 100644 index 000000000..8ef6f3c30 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/iterator.hpp @@ -0,0 +1,26 @@ +// (C) Copyright David Abrahams 2002. +// 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) + +#ifndef AB_ITERATOR_DWA122600_HPP_ +#define AB_ITERATOR_DWA122600_HPP_ + +// This header is obsolete and will be deprecated. + +#include + +namespace autoboost +{ + +namespace detail +{ + +using std::iterator_traits; +using std::distance; + +} // namespace detail + +} // namespace autoboost + +#endif // ITERATOR_DWA122600_HPP_ diff --git a/contrib/autoboost/autoboost/detail/lcast_precision.hpp b/contrib/autoboost/autoboost/detail/lcast_precision.hpp new file mode 100644 index 000000000..6a30c8e2a --- /dev/null +++ b/contrib/autoboost/autoboost/detail/lcast_precision.hpp @@ -0,0 +1,184 @@ +// Copyright Alexander Nasonov & Paul A. Bristow 2006. + +// Use, modification and distribution are subject to 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) + +#ifndef AUTOBOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED +#define AUTOBOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED + +#include +#include +#include + +#include +#include + +#ifndef AUTOBOOST_NO_IS_ABSTRACT +// Fix for SF:1358600 - lexical_cast & pure virtual functions & VC 8 STL +#include +#include +#endif + +#if defined(AUTOBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || \ + (defined(AUTOBOOST_MSVC) && (AUTOBOOST_MSVC<1310)) + +#define AUTOBOOST_LCAST_NO_COMPILE_TIME_PRECISION +#endif + +#ifdef AUTOBOOST_LCAST_NO_COMPILE_TIME_PRECISION +#include +#else +#include +#endif + +namespace autoboost { namespace detail { + +class lcast_abstract_stub {}; + +#ifndef AUTOBOOST_LCAST_NO_COMPILE_TIME_PRECISION +// Calculate an argument to pass to std::ios_base::precision from +// lexical_cast. See alternative implementation for broken standard +// libraries in lcast_get_precision below. Keep them in sync, please. +template +struct lcast_precision +{ +#ifdef AUTOBOOST_NO_IS_ABSTRACT + typedef std::numeric_limits limits; // No fix for SF:1358600. +#else + typedef AUTOBOOST_DEDUCED_TYPENAME autoboost::mpl::if_< + autoboost::is_abstract + , std::numeric_limits + , std::numeric_limits + >::type limits; +#endif + + AUTOBOOST_STATIC_CONSTANT(bool, use_default_precision = + !limits::is_specialized || limits::is_exact + ); + + AUTOBOOST_STATIC_CONSTANT(bool, is_specialized_bin = + !use_default_precision && + limits::radix == 2 && limits::digits > 0 + ); + + AUTOBOOST_STATIC_CONSTANT(bool, is_specialized_dec = + !use_default_precision && + limits::radix == 10 && limits::digits10 > 0 + ); + + AUTOBOOST_STATIC_CONSTANT(std::streamsize, streamsize_max = + autoboost::integer_traits::const_max + ); + + AUTOBOOST_STATIC_CONSTANT(unsigned int, precision_dec = limits::digits10 + 1U); + + AUTOBOOST_STATIC_ASSERT(!is_specialized_dec || + precision_dec <= streamsize_max + 0UL + ); + + AUTOBOOST_STATIC_CONSTANT(unsigned long, precision_bin = + 2UL + limits::digits * 30103UL / 100000UL + ); + + AUTOBOOST_STATIC_ASSERT(!is_specialized_bin || + (limits::digits + 0UL < ULONG_MAX / 30103UL && + precision_bin > limits::digits10 + 0UL && + precision_bin <= streamsize_max + 0UL) + ); + + AUTOBOOST_STATIC_CONSTANT(std::streamsize, value = + is_specialized_bin ? precision_bin + : is_specialized_dec ? precision_dec : 6 + ); +}; +#endif + +template +inline std::streamsize lcast_get_precision(T* = 0) +{ +#ifndef AUTOBOOST_LCAST_NO_COMPILE_TIME_PRECISION + return lcast_precision::value; +#else // Follow lcast_precision algorithm at run-time: + +#ifdef AUTOBOOST_NO_IS_ABSTRACT + typedef std::numeric_limits limits; // No fix for SF:1358600. +#else + typedef AUTOBOOST_DEDUCED_TYPENAME autoboost::mpl::if_< + autoboost::is_abstract + , std::numeric_limits + , std::numeric_limits + >::type limits; +#endif + + bool const use_default_precision = + !limits::is_specialized || limits::is_exact; + + if(!use_default_precision) + { // Includes all built-in floating-point types, float, double ... + // and UDT types for which digits (significand bits) is defined (not zero) + + bool const is_specialized_bin = + limits::radix == 2 && limits::digits > 0; + bool const is_specialized_dec = + limits::radix == 10 && limits::digits10 > 0; + std::streamsize const streamsize_max = + (autoboost::integer_traits::max)(); + + if(is_specialized_bin) + { // Floating-point types with + // limits::digits defined by the specialization. + + unsigned long const digits = limits::digits; + unsigned long const precision = 2UL + digits * 30103UL / 100000UL; + // unsigned long is selected because it is at least 32-bits + // and thus ULONG_MAX / 30103UL is big enough for all types. + AUTOBOOST_ASSERT( + digits < ULONG_MAX / 30103UL && + precision > limits::digits10 + 0UL && + precision <= streamsize_max + 0UL + ); + return precision; + } + else if(is_specialized_dec) + { // Decimal Floating-point type, most likely a User Defined Type + // rather than a real floating-point hardware type. + unsigned int const precision = limits::digits10 + 1U; + AUTOBOOST_ASSERT(precision <= streamsize_max + 0UL); + return precision; + } + } + + // Integral type (for which precision has no effect) + // or type T for which limits is NOT specialized, + // so assume stream precision remains the default 6 decimal digits. + // Warning: if your User-defined Floating-point type T is NOT specialized, + // then you may lose accuracy by only using 6 decimal digits. + // To avoid this, you need to specialize T with either + // radix == 2 and digits == the number of significand bits, + // OR + // radix = 10 and digits10 == the number of decimal digits. + + return 6; +#endif +} + +template +inline void lcast_set_precision(std::ios_base& stream, T*) +{ + stream.precision(lcast_get_precision()); +} + +template +inline void lcast_set_precision(std::ios_base& stream, Source*, Target*) +{ + std::streamsize const s = lcast_get_precision(static_cast(0)); + std::streamsize const t = lcast_get_precision(static_cast(0)); + stream.precision(s > t ? s : t); +} + +}} + +#endif // AUTOBOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED + diff --git a/contrib/autoboost/autoboost/detail/lightweight_main.hpp b/contrib/autoboost/autoboost/detail/lightweight_main.hpp new file mode 100644 index 000000000..170530978 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/lightweight_main.hpp @@ -0,0 +1,36 @@ +// boost/detail/lightweight_main.hpp -------------------------------------------------// + +// Copyright Beman Dawes 2010 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#include +#include + +//--------------------------------------------------------------------------------------// +// // +// exception reporting main() that calls cpp_main() // +// // +//--------------------------------------------------------------------------------------// + +int cpp_main(int argc, char* argv[]); + +int main(int argc, char* argv[]) +{ + try + { + return cpp_main(argc, argv); + } + + catch (const std::exception& ex) + { + std::cout + << "\nERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR\n" + << "\n****************************** std::exception *****************************\n" + << ex.what() + << "\n***************************************************************************\n" + << std::endl; + } + return 1; +} diff --git a/contrib/autoboost/autoboost/detail/lightweight_mutex.hpp b/contrib/autoboost/autoboost/detail/lightweight_mutex.hpp new file mode 100644 index 000000000..a20714c65 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/lightweight_mutex.hpp @@ -0,0 +1,22 @@ +#ifndef AUTOBOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED +#define AUTOBOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// boost/detail/lightweight_mutex.hpp - lightweight mutex +// +// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. +// +// 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 +// + +#include + +#endif // #ifndef AUTOBOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/detail/lightweight_test.hpp b/contrib/autoboost/autoboost/detail/lightweight_test.hpp new file mode 100644 index 000000000..1d9c324f0 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/lightweight_test.hpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2014 Glen Fernandes + * + * 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) + */ + +#ifndef AUTOBOOST_DETAIL_LIGHTWEIGHT_TEST_HPP +#define AUTOBOOST_DETAIL_LIGHTWEIGHT_TEST_HPP + +// The header file at this path is deprecated; +// use boost/core/lightweight_test.hpp instead. + +#include + +#endif diff --git a/contrib/autoboost/autoboost/detail/lightweight_thread.hpp b/contrib/autoboost/autoboost/detail/lightweight_thread.hpp new file mode 100644 index 000000000..4fb51c309 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/lightweight_thread.hpp @@ -0,0 +1,135 @@ +#ifndef AUTOBOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED +#define AUTOBOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// boost/detail/lightweight_thread.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2008 Peter Dimov +// +// 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 + +#include +#include +#include + +// pthread_create, pthread_join + +#if defined( AUTOBOOST_HAS_PTHREADS ) + +#include + +#else + +#include +#include + +typedef HANDLE pthread_t; + +int pthread_create( pthread_t * thread, void const *, unsigned (__stdcall * start_routine) (void*), void* arg ) +{ + HANDLE h = (HANDLE)_beginthreadex( 0, 0, start_routine, arg, 0, 0 ); + + if( h != 0 ) + { + *thread = h; + return 0; + } + else + { + return EAGAIN; + } +} + +int pthread_join( pthread_t thread, void ** /*value_ptr*/ ) +{ + ::WaitForSingleObject( thread, INFINITE ); + ::CloseHandle( thread ); + return 0; +} + +#endif + +// template int lw_thread_create( pthread_t & pt, F f ); + +namespace autoboost +{ + +namespace detail +{ + +class lw_abstract_thread +{ +public: + + virtual ~lw_abstract_thread() {} + virtual void run() = 0; +}; + +#if defined( AUTOBOOST_HAS_PTHREADS ) + +extern "C" void * autoboostlw_thread_routine( void * pv ) +{ + std::auto_ptr pt( static_cast( pv ) ); + + pt->run(); + + return 0; +} + +#else + +unsigned __stdcall autoboostlw_thread_routine( void * pv ) +{ + std::auto_ptr pt( static_cast( pv ) ); + + pt->run(); + + return 0; +} + +#endif + +template class lw_thread_impl: public lw_abstract_thread +{ +public: + + explicit lw_thread_impl( F f ): f_( f ) + { + } + + void run() + { + f_(); + } + +private: + + F f_; +}; + +template int lw_thread_create( pthread_t & pt, F f ) +{ + std::auto_ptr p( new lw_thread_impl( f ) ); + + int r = pthread_create( &pt, 0, autoboostlw_thread_routine, p.get() ); + + if( r == 0 ) + { + p.release(); + } + + return r; +} + +} // namespace detail +} // namespace autoboost + +#endif // #ifndef AUTOBOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/detail/named_template_params.hpp b/contrib/autoboost/autoboost/detail/named_template_params.hpp new file mode 100644 index 000000000..0085b3b48 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/named_template_params.hpp @@ -0,0 +1,177 @@ +// (C) Copyright Jeremy Siek 2001. +// 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) + +// Revision History: + +// 04 Oct 2001 David Abrahams +// Changed name of "bind" to "select" to avoid problems with MSVC. + +#ifndef AUTOBOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP +#define AUTOBOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP + +#include +#include // for is_reference +#if defined(__BORLANDC__) +#include +#endif + +namespace autoboost { + namespace detail { + + struct default_argument { }; + + struct dummy_default_gen { + template + struct select { + typedef default_argument type; + }; + }; + + // This class template is a workaround for MSVC. + template struct default_generator { + typedef detail::dummy_default_gen type; + }; + + template struct is_default { + enum { value = false }; + typedef type_traits::no_type type; + }; + template <> struct is_default { + enum { value = true }; + typedef type_traits::yes_type type; + }; + + struct choose_default { + template + struct select { + typedef typename default_generator::type Gen; + typedef typename Gen::template select::type type; + }; + }; + struct choose_arg { + template + struct select { + typedef Arg type; + }; + }; + +#if defined(__BORLANDC__) + template + struct choose_arg_or_default { typedef choose_arg type; }; + template <> + struct choose_arg_or_default { + typedef choose_default type; + }; +#else + template + struct choose_arg_or_default { typedef choose_arg type; }; + template <> + struct choose_arg_or_default { + typedef choose_default type; + }; +#endif + + template + class resolve_default { +#if defined(__BORLANDC__) + typedef typename choose_arg_or_default::type>::type Selector; +#else + // This usually works for Borland, but I'm seeing weird errors in + // iterator_adaptor_test.cpp when using this method. + enum { is_def = is_default::value }; + typedef typename choose_arg_or_default::type Selector; +#endif + public: + typedef typename Selector + ::template select::type type; + }; + + // To differentiate an unnamed parameter from a traits generator + // we use is_convertible. + struct named_template_param_base { }; + + template + struct is_named_param_list { + enum { value = is_convertible::value }; + }; + + struct choose_named_params { + template struct select { typedef Prev type; }; + }; + struct choose_default_arg { + template struct select { + typedef detail::default_argument type; + }; + }; + + template struct choose_default_dispatch_; + template <> struct choose_default_dispatch_ { + typedef choose_named_params type; + }; + template <> struct choose_default_dispatch_ { + typedef choose_default_arg type; + }; + // The use of inheritance here is a Solaris Forte 6 workaround. + template struct choose_default_dispatch + : public choose_default_dispatch_ { }; + + template + struct choose_default_argument { + enum { is_named = is_named_param_list::value }; + typedef typename choose_default_dispatch::type Selector; + typedef typename Selector::template select::type type; + }; + + // This macro assumes that there is a class named default_##TYPE + // defined before the application of the macro. This class should + // have a single member class template named "select" with two + // template parameters: the type of the class being created (e.g., + // the iterator_adaptor type when creating iterator adaptors) and + // a traits class. The select class should have a single typedef + // named "type" that produces the default for TYPE. See + // boost/iterator_adaptors.hpp for an example usage. Also, + // applications of this macro must be placed in namespace + // autoboost::detail. + +#define AUTOBOOST_NAMED_TEMPLATE_PARAM(TYPE) \ + struct get_##TYPE##_from_named { \ + template \ + struct select { \ + typedef typename NamedParams::traits NamedTraits; \ + typedef typename NamedTraits::TYPE TYPE; \ + typedef typename resolve_default::type type; \ + }; \ + }; \ + struct pass_thru_##TYPE { \ + template struct select { \ + typedef typename resolve_default::type type; \ + };\ + }; \ + template \ + struct get_##TYPE##_dispatch { }; \ + template <> struct get_##TYPE##_dispatch<1> { \ + typedef get_##TYPE##_from_named type; \ + }; \ + template <> struct get_##TYPE##_dispatch<0> { \ + typedef pass_thru_##TYPE type; \ + }; \ + template \ + class get_##TYPE { \ + enum { is_named = is_named_param_list::value }; \ + typedef typename get_##TYPE##_dispatch::type Selector; \ + public: \ + typedef typename Selector::template select::type type; \ + }; \ + template <> struct default_generator { \ + typedef default_##TYPE type; \ + } + + + } // namespace detail +} // namespace autoboost + +#endif // AUTOBOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP diff --git a/contrib/autoboost/autoboost/detail/no_exceptions_support.hpp b/contrib/autoboost/autoboost/detail/no_exceptions_support.hpp new file mode 100644 index 000000000..d6ed1c984 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/no_exceptions_support.hpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2014 Glen Fernandes + * + * 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) + */ + +#ifndef AUTOBOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP +#define AUTOBOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP + +// The header file at this path is deprecated; +// use boost/core/no_exceptions_support.hpp instead. + +#include + +#endif diff --git a/contrib/autoboost/autoboost/detail/numeric_traits.hpp b/contrib/autoboost/autoboost/detail/numeric_traits.hpp new file mode 100644 index 000000000..41842c363 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/numeric_traits.hpp @@ -0,0 +1,182 @@ +// (C) Copyright David Abrahams 2001, Howard Hinnant 2001. +// +// 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) +// +// Template class numeric_traits -- +// +// Supplies: +// +// typedef difference_type -- a type used to represent the difference +// between any two values of Number. +// +// Support: +// 1. Not all specializations are supplied +// +// 2. Use of specializations that are not supplied will cause a +// compile-time error +// +// 3. Users are free to specialize numeric_traits for any type. +// +// 4. Right now, specializations are only supplied for integer types. +// +// 5. On implementations which do not supply compile-time constants in +// std::numeric_limits<>, only specializations for built-in integer types +// are supplied. +// +// 6. Handling of numbers whose range of representation is at least as +// great as autoboost::intmax_t can cause some differences to be +// unrepresentable in difference_type: +// +// Number difference_type +// ------ --------------- +// signed Number +// unsigned intmax_t +// +// template typename numeric_traits::difference_type +// numeric_distance(Number x, Number y) +// computes (y - x), attempting to avoid overflows. +// + +// See http://www.boost.org for most recent version including documentation. + +// Revision History +// 11 Feb 2001 - Use AUTOBOOST_STATIC_CONSTANT (David Abrahams) +// 11 Feb 2001 - Rolled back ineffective Borland-specific code +// (David Abrahams) +// 10 Feb 2001 - Rolled in supposed Borland fixes from John Maddock, but +// not seeing any improvement yet (David Abrahams) +// 06 Feb 2001 - Factored if_true out into boost/detail/select_type.hpp +// (David Abrahams) +// 23 Jan 2001 - Fixed logic of difference_type selection, which was +// completely wack. In the process, added digit_traits<> +// to compute the number of digits in intmax_t even when +// not supplied by numeric_limits<>. (David Abrahams) +// 21 Jan 2001 - Created (David Abrahams) + +#ifndef AUTOBOOST_NUMERIC_TRAITS_HPP_DWA20001901 +# define AUTOBOOST_NUMERIC_TRAITS_HPP_DWA20001901 + +# include +# include +# include +# include +# include +# include + +namespace autoboost { namespace detail { + + // Template class is_signed -- determine whether a numeric type is signed + // Requires that T is constructable from the literals -1 and 0. Compile-time + // error results if that requirement is not met (and thus signedness is not + // likely to have meaning for that type). + template + struct is_signed + { +#if defined(AUTOBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) + AUTOBOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0))); +#else + AUTOBOOST_STATIC_CONSTANT(bool, value = std::numeric_limits::is_signed); +#endif + }; + +# ifndef AUTOBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + // digit_traits - compute the number of digits in a built-in integer + // type. Needed for implementations on which numeric_limits is not specialized + // for intmax_t (e.g. VC6). + template struct digit_traits_select; + + // numeric_limits is specialized; just select that version of digits + template <> struct digit_traits_select + { + template struct traits + { + AUTOBOOST_STATIC_CONSTANT(int, digits = std::numeric_limits::digits); + }; + }; + + // numeric_limits is not specialized; compute digits from sizeof(T) + template <> struct digit_traits_select + { + template struct traits + { + AUTOBOOST_STATIC_CONSTANT(int, digits = ( + sizeof(T) * std::numeric_limits::digits + - (is_signed::value ? 1 : 0)) + ); + }; + }; + + // here's the "usable" template + template struct digit_traits + { + typedef digit_traits_select< + ::std::numeric_limits::is_specialized> selector; + typedef typename selector::template traits traits; + AUTOBOOST_STATIC_CONSTANT(int, digits = traits::digits); + }; +#endif + + // Template class integer_traits -- traits of various integer types + // This should probably be rolled into autoboost::integer_traits one day, but I + // need it to work without + template + struct integer_traits + { +# ifndef AUTOBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + private: + typedef Integer integer_type; + typedef std::numeric_limits x; + public: + typedef typename + if_true<(int(x::is_signed) + && (!int(x::is_bounded) + // digits is the number of no-sign bits + || (int(x::digits) + 1 >= digit_traits::digits)))>::template then< + Integer, + + typename if_true<(int(x::digits) + 1 < digit_traits::digits)>::template then< + signed int, + + typename if_true<(int(x::digits) + 1 < digit_traits::digits)>::template then< + signed long, + + // else + intmax_t + >::type>::type>::type difference_type; +#else + AUTOBOOST_STATIC_ASSERT(autoboost::is_integral::value); + + typedef typename + if_true<(sizeof(Integer) >= sizeof(intmax_t))>::template then< + + typename if_true<(is_signed::value)>::template then< + Integer, + intmax_t + >::type, + + typename if_true<(sizeof(Integer) < sizeof(std::ptrdiff_t))>::template then< + std::ptrdiff_t, + intmax_t + >::type + >::type difference_type; +# endif + }; + + // Right now, only supports integers, but should be expanded. + template + struct numeric_traits + { + typedef typename integer_traits::difference_type difference_type; + }; + + template + typename numeric_traits::difference_type numeric_distance(Number x, Number y) + { + typedef typename numeric_traits::difference_type difference_type; + return difference_type(y) - difference_type(x); + } +}} + +#endif // AUTOBOOST_NUMERIC_TRAITS_HPP_DWA20001901 diff --git a/contrib/autoboost/autoboost/detail/ob_compressed_pair.hpp b/contrib/autoboost/autoboost/detail/ob_compressed_pair.hpp new file mode 100644 index 000000000..abf6b3a05 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/ob_compressed_pair.hpp @@ -0,0 +1,499 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Use, modification and distribution are subject to 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/libs/utility for most recent version including documentation. +// see libs/utility/compressed_pair.hpp +// +/* Release notes: + 20 Jan 2001: + Fixed obvious bugs (David Abrahams) + 07 Oct 2000: + Added better single argument constructor support. + 03 Oct 2000: + Added VC6 support (JM). + 23rd July 2000: + Additional comments added. (JM) + Jan 2000: + Original version: this version crippled for use with crippled compilers + - John Maddock Jan 2000. +*/ + + +#ifndef AUTOBOOST_OB_COMPRESSED_PAIR_HPP +#define AUTOBOOST_OB_COMPRESSED_PAIR_HPP + +#include +#ifndef AUTOBOOST_OBJECT_TYPE_TRAITS_HPP +#include +#endif +#ifndef AUTOBOOST_SAME_TRAITS_HPP +#include +#endif +#ifndef AUTOBOOST_CALL_TRAITS_HPP +#include +#endif + +namespace autoboost +{ +#ifdef AUTOBOOST_MSVC6_MEMBER_TEMPLATES +// +// use member templates to emulate +// partial specialisation. Note that due to +// problems with overload resolution with VC6 +// each of the compressed_pair versions that follow +// have one template single-argument constructor +// in place of two specific constructors: +// + +template +class compressed_pair; + +namespace detail{ + +template +struct best_conversion_traits +{ + typedef char one; + typedef char (&two)[2]; + static A a; + static one test(T1); + static two test(T2); + + enum { value = sizeof(test(a)) }; +}; + +template +struct init_one; + +template <> +struct init_one<1> +{ + template + static void init(const A& a, T1* p1, T2*) + { + *p1 = a; + } +}; + +template <> +struct init_one<2> +{ + template + static void init(const A& a, T1*, T2* p2) + { + *p2 = a; + } +}; + + +// T1 != T2, both non-empty +template +class compressed_pair_0 +{ +private: + T1 _first; + T2 _second; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_0() : _first(), _second() {} + compressed_pair_0(first_param_type x, second_param_type y) : _first(x), _second(y) {} + template + explicit compressed_pair_0(const A& val) + { + init_one::value>::init(val, &_first, &_second); + } + compressed_pair_0(const ::autoboost::compressed_pair& x) + : _first(x.first()), _second(x.second()) {} + +#if 0 + compressed_pair_0& operator=(const compressed_pair_0& x) { + cout << "assigning compressed pair 0" << endl; + _first = x._first; + _second = x._second; + cout << "finished assigning compressed pair 0" << endl; + return *this; + } +#endif + + first_reference first() { return _first; } + first_const_reference first() const { return _first; } + + second_reference second() { return _second; } + second_const_reference second() const { return _second; } + + void swap(compressed_pair_0& y) + { + using std::swap; + swap(_first, y._first); + swap(_second, y._second); + } +}; + +// T1 != T2, T2 empty +template +class compressed_pair_1 : T2 +{ +private: + T1 _first; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_1() : T2(), _first() {} + compressed_pair_1(first_param_type x, second_param_type y) : T2(y), _first(x) {} + + template + explicit compressed_pair_1(const A& val) + { + init_one::value>::init(val, &_first, static_cast(this)); + } + + compressed_pair_1(const ::autoboost::compressed_pair& x) + : T2(x.second()), _first(x.first()) {} + + first_reference first() { return _first; } + first_const_reference first() const { return _first; } + + second_reference second() { return *this; } + second_const_reference second() const { return *this; } + + void swap(compressed_pair_1& y) + { + // no need to swap empty base class: + using std::swap; + swap(_first, y._first); + } +}; + +// T1 != T2, T1 empty +template +class compressed_pair_2 : T1 +{ +private: + T2 _second; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_2() : T1(), _second() {} + compressed_pair_2(first_param_type x, second_param_type y) : T1(x), _second(y) {} + template + explicit compressed_pair_2(const A& val) + { + init_one::value>::init(val, static_cast(this), &_second); + } + compressed_pair_2(const ::autoboost::compressed_pair& x) + : T1(x.first()), _second(x.second()) {} + +#if 0 + compressed_pair_2& operator=(const compressed_pair_2& x) { + cout << "assigning compressed pair 2" << endl; + T1::operator=(x); + _second = x._second; + cout << "finished assigning compressed pair 2" << endl; + return *this; + } +#endif + first_reference first() { return *this; } + first_const_reference first() const { return *this; } + + second_reference second() { return _second; } + second_const_reference second() const { return _second; } + + void swap(compressed_pair_2& y) + { + // no need to swap empty base class: + using std::swap; + swap(_second, y._second); + } +}; + +// T1 != T2, both empty +template +class compressed_pair_3 : T1, T2 +{ +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_3() : T1(), T2() {} + compressed_pair_3(first_param_type x, second_param_type y) : T1(x), T2(y) {} + template + explicit compressed_pair_3(const A& val) + { + init_one::value>::init(val, static_cast(this), static_cast(this)); + } + compressed_pair_3(const ::autoboost::compressed_pair& x) + : T1(x.first()), T2(x.second()) {} + + first_reference first() { return *this; } + first_const_reference first() const { return *this; } + + second_reference second() { return *this; } + second_const_reference second() const { return *this; } + + void swap(compressed_pair_3& y) + { + // no need to swap empty base classes: + } +}; + +// T1 == T2, and empty +template +class compressed_pair_4 : T1 +{ +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_4() : T1() {} + compressed_pair_4(first_param_type x, second_param_type y) : T1(x), m_second(y) {} + // only one single argument constructor since T1 == T2 + explicit compressed_pair_4(first_param_type x) : T1(x), m_second(x) {} + compressed_pair_4(const ::autoboost::compressed_pair& x) + : T1(x.first()), m_second(x.second()) {} + + first_reference first() { return *this; } + first_const_reference first() const { return *this; } + + second_reference second() { return m_second; } + second_const_reference second() const { return m_second; } + + void swap(compressed_pair_4& y) + { + // no need to swap empty base classes: + } +private: + T2 m_second; +}; + +// T1 == T2, not empty +template +class compressed_pair_5 +{ +private: + T1 _first; + T2 _second; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_5() : _first(), _second() {} + compressed_pair_5(first_param_type x, second_param_type y) : _first(x), _second(y) {} + // only one single argument constructor since T1 == T2 + explicit compressed_pair_5(first_param_type x) : _first(x), _second(x) {} + compressed_pair_5(const ::autoboost::compressed_pair& c) + : _first(c.first()), _second(c.second()) {} + + first_reference first() { return _first; } + first_const_reference first() const { return _first; } + + second_reference second() { return _second; } + second_const_reference second() const { return _second; } + + void swap(compressed_pair_5& y) + { + using std::swap; + swap(_first, y._first); + swap(_second, y._second); + } +}; + +template +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_0 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_1 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_2 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_3 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_4 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_5 type; + }; +}; + +template +struct compressed_pair_traits +{ +private: + typedef compressed_pair_chooser::value, is_empty::value, is_same::value> chooser; + typedef typename chooser::template rebind bound_type; +public: + typedef typename bound_type::type type; +}; + +} // namespace detail + +template +class compressed_pair : public detail::compressed_pair_traits::type +{ +private: + typedef typename detail::compressed_pair_traits::type base_type; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : base_type() {} + compressed_pair(first_param_type x, second_param_type y) : base_type(x, y) {} + template + explicit compressed_pair(const A& x) : base_type(x){} + + first_reference first() { return base_type::first(); } + first_const_reference first() const { return base_type::first(); } + + second_reference second() { return base_type::second(); } + second_const_reference second() const { return base_type::second(); } +}; + +template +inline void swap(compressed_pair& x, compressed_pair& y) +{ + x.swap(y); +} + +#else +// no partial specialisation, no member templates: + +template +class compressed_pair +{ +private: + T1 _first; + T2 _second; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : _first(), _second() {} + compressed_pair(first_param_type x, second_param_type y) : _first(x), _second(y) {} + explicit compressed_pair(first_param_type x) : _first(x), _second() {} + // can't define this in case T1 == T2: + // explicit compressed_pair(second_param_type y) : _first(), _second(y) {} + + first_reference first() { return _first; } + first_const_reference first() const { return _first; } + + second_reference second() { return _second; } + second_const_reference second() const { return _second; } + + void swap(compressed_pair& y) + { + using std::swap; + swap(_first, y._first); + swap(_second, y._second); + } +}; + +template +inline void swap(compressed_pair& x, compressed_pair& y) +{ + x.swap(y); +} + +#endif + +} // boost + +#endif // AUTOBOOST_OB_COMPRESSED_PAIR_HPP + + + diff --git a/contrib/autoboost/autoboost/detail/quick_allocator.hpp b/contrib/autoboost/autoboost/detail/quick_allocator.hpp new file mode 100644 index 000000000..bed63ce2c --- /dev/null +++ b/contrib/autoboost/autoboost/detail/quick_allocator.hpp @@ -0,0 +1,23 @@ +#ifndef AUTOBOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED +#define AUTOBOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// detail/quick_allocator.hpp +// +// Copyright (c) 2003 David Abrahams +// Copyright (c) 2003 Peter Dimov +// +// 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 +// + +#include + +#endif // #ifndef AUTOBOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED diff --git a/contrib/autoboost/boost/detail/reference_content.hpp b/contrib/autoboost/autoboost/detail/reference_content.hpp similarity index 87% rename from contrib/autoboost/boost/detail/reference_content.hpp rename to contrib/autoboost/autoboost/detail/reference_content.hpp index 148cfb970..92fd637e1 100644 --- a/contrib/autoboost/boost/detail/reference_content.hpp +++ b/contrib/autoboost/autoboost/detail/reference_content.hpp @@ -10,15 +10,15 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP -#define BOOST_DETAIL_REFERENCE_CONTENT_HPP +#ifndef AUTOBOOST_DETAIL_REFERENCE_CONTENT_HPP +#define AUTOBOOST_DETAIL_REFERENCE_CONTENT_HPP -#include "boost/config.hpp" +#include "autoboost/config.hpp" -# include "boost/mpl/bool.hpp" -# include "boost/type_traits/has_nothrow_copy.hpp" +# include "autoboost/mpl/bool.hpp" +# include "autoboost/type_traits/has_nothrow_copy.hpp" -#include "boost/mpl/void.hpp" +#include "autoboost/mpl/void.hpp" namespace autoboost { @@ -117,4 +117,4 @@ struct has_nothrow_copy< } // namespace autoboost -#endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP +#endif // AUTOBOOST_DETAIL_REFERENCE_CONTENT_HPP diff --git a/contrib/autoboost/autoboost/detail/scoped_enum_emulation.hpp b/contrib/autoboost/autoboost/detail/scoped_enum_emulation.hpp new file mode 100644 index 000000000..7cdc6c5e3 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/scoped_enum_emulation.hpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2014 Andrey Semashev + * + * 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) + */ + +#ifndef AUTOBOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP +#define AUTOBOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP + +// The header file at this path is deprecated; +// use boost/core/scoped_enum.hpp instead. + +#include + +#endif diff --git a/contrib/autoboost/autoboost/detail/select_type.hpp b/contrib/autoboost/autoboost/detail/select_type.hpp new file mode 100644 index 000000000..df2a63ab9 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/select_type.hpp @@ -0,0 +1,36 @@ +// (C) Copyright David Abrahams 2001. +// 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. + +// Revision History +// 09 Feb 01 Applied John Maddock's Borland patch Moving +// specialization to unspecialized template (David Abrahams) +// 06 Feb 01 Created (David Abrahams) + +#ifndef AB_SELECT_TYPE_DWA20010206_HPP +# define AB_SELECT_TYPE_DWA20010206_HPP + +namespace autoboost { namespace detail { + + // Template class if_true -- select among 2 types based on a bool constant expression + // Usage: + // typename if_true<(bool_const_expression)>::template then::type + + // HP aCC cannot deal with missing names for template value parameters + template struct if_true + { + template + struct then { typedef T type; }; + }; + + template <> + struct if_true + { + template + struct then { typedef F type; }; + }; +}} +#endif // SELECT_TYPE_DWA20010206_HPP diff --git a/contrib/autoboost/autoboost/detail/sp_typeinfo.hpp b/contrib/autoboost/autoboost/detail/sp_typeinfo.hpp new file mode 100644 index 000000000..601756706 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/sp_typeinfo.hpp @@ -0,0 +1,36 @@ +#ifndef AUTOBOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED +#define AUTOBOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// detail/sp_typeinfo.hpp +// +// Deprecated, please use boost/core/typeinfo.hpp +// +// Copyright 2007 Peter Dimov +// +// 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) + +#include + +namespace autoboost +{ + +namespace detail +{ + +typedef autoboost::core::typeinfo sp_typeinfo; + +} // namespace detail + +} // namespace autoboost + +#define AUTOBOOST_SP_TYPEID(T) AUTOBOOST_CORE_TYPEID(T) + +#endif // #ifndef AUTOBOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/detail/templated_streams.hpp b/contrib/autoboost/autoboost/detail/templated_streams.hpp new file mode 100644 index 000000000..21b0009c0 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/templated_streams.hpp @@ -0,0 +1,74 @@ +//----------------------------------------------------------------------------- +// boost detail/templated_streams.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman +// +// 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) + +#ifndef AUTOBOOST_DETAIL_TEMPLATED_STREAMS_HPP +#define AUTOBOOST_DETAIL_TEMPLATED_STREAMS_HPP + +#include "autoboost/config.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// (detail) AUTOBOOST_TEMPLATED_STREAM_* macros +// +// Provides workaround platforms without stream class templates. +// + +#if !defined(AUTOBOOST_NO_STD_LOCALE) + +#define AUTOBOOST_TEMPLATED_STREAM_TEMPLATE(E,T) \ + template < typename E , typename T > + +#define AUTOBOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) \ + template < typename E , typename T , typename A > + +#define AUTOBOOST_TEMPLATED_STREAM_ARGS(E,T) \ + typename E , typename T + +#define AUTOBOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) \ + typename E , typename T , typename A + +#define AUTOBOOST_TEMPLATED_STREAM_COMMA , + +#define AUTOBOOST_TEMPLATED_STREAM_ELEM(E) E +#define AUTOBOOST_TEMPLATED_STREAM_TRAITS(T) T +#define AUTOBOOST_TEMPLATED_STREAM_ALLOC(A) A + +#define AUTOBOOST_TEMPLATED_STREAM(X,E,T) \ + AUTOBOOST_JOIN(std::basic_,X)< E , T > + +#define AUTOBOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \ + AUTOBOOST_JOIN(std::basic_,X)< E , T , A > + +#else // defined(AUTOBOOST_NO_STD_LOCALE) + +#define AUTOBOOST_TEMPLATED_STREAM_TEMPLATE(E,T) /**/ + +#define AUTOBOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) /**/ + +#define AUTOBOOST_TEMPLATED_STREAM_ARGS(E,T) /**/ + +#define AUTOBOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) /**/ + +#define AUTOBOOST_TEMPLATED_STREAM_COMMA /**/ + +#define AUTOBOOST_TEMPLATED_STREAM_ELEM(E) char +#define AUTOBOOST_TEMPLATED_STREAM_TRAITS(T) std::char_traits +#define AUTOBOOST_TEMPLATED_STREAM_ALLOC(A) std::allocator + +#define AUTOBOOST_TEMPLATED_STREAM(X,E,T) \ + std::X + +#define AUTOBOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \ + std::X + +#endif // AUTOBOOST_NO_STD_LOCALE + +#endif // AUTOBOOST_DETAIL_TEMPLATED_STREAMS_HPP diff --git a/contrib/autoboost/autoboost/detail/utf8_codecvt_facet.hpp b/contrib/autoboost/autoboost/detail/utf8_codecvt_facet.hpp new file mode 100644 index 000000000..a83500ea2 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/utf8_codecvt_facet.hpp @@ -0,0 +1,191 @@ +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef AUTOBOOST_UTF8_CODECVT_FACET_HPP +#define AUTOBOOST_UTF8_CODECVT_FACET_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// utf8_codecvt_facet.hpp + +// This header defines class utf8_codecvt_facet, derived fro +// std::codecvt, which can be used to convert utf8 data in +// files into wchar_t strings in the application. +// +// The header is NOT STANDALONE, and is not to be included by the USER. +// There are at least two libraries which want to use this functionality, and +// we want to avoid code duplication. It would be possible to create utf8 +// library, but: +// - this requires review process first +// - in the case, when linking the a library which uses utf8 +// (say 'program_options'), user should also link to the utf8 library. +// This seems inconvenient, and asking a user to link to an unrevieved +// library is strange. +// Until the above points are fixed, a library which wants to use utf8 must: +// - include this header from one of it's headers or sources +// - include the corresponding .cpp file from one of the sources +// - before including either file, the library must define +// - AUTOBOOST_UTF8_BEGIN_NAMESPACE to the namespace declaration that must be used +// - AUTOBOOST_UTF8_END_NAMESPACE to the code to close the previous namespace +// - declaration. +// - AUTOBOOST_UTF8_DECL -- to the code which must be used for all 'exportable' +// symbols. +// +// For example, program_options library might contain: +// #define AUTOBOOST_UTF8_BEGIN_NAMESPACE +// namespace autoboost { namespace program_options { +// #define AUTOBOOST_UTF8_END_NAMESPACE }} +// #define AUTOBOOST_UTF8_DECL AUTOBOOST_PROGRAM_OPTIONS_DECL +// #include "../../detail/utf8/utf8_codecvt.cpp" +// +// Essentially, each library will have its own copy of utf8 code, in +// different namespaces. + +// Note:(Robert Ramey). I have made the following alterations in the original +// code. +// a) Rendered utf8_codecvt with using templates +// b) Move longer functions outside class definition to prevent inlining +// and make code smaller +// c) added on a derived class to permit translation to/from current +// locale to utf8 + +// See http://www.boost.org for updates, documentation, and revision history. + +// archives stored as text - note these ar templated on the basic +// stream templates to accommodate wide (and other?) kind of characters +// +// note the fact that on libraries without wide characters, ostream is +// is not a specialization of basic_ostream which in fact is not defined +// in such cases. So we can't use basic_ostream but rather +// use two template parameters +// +// utf8_codecvt_facet +// This is an implementation of a std::codecvt facet for translating +// from UTF-8 externally to UCS-4. Note that this is not tied to +// any specific types in order to allow customization on platforms +// where wchar_t is not big enough. +// +// NOTES: The current implementation jumps through some unpleasant hoops in +// order to deal with signed character types. As a std::codecvt_base::result, +// it is necessary for the ExternType to be convertible to unsigned char. +// I chose not to tie the extern_type explicitly to char. But if any combination +// of types other than is used, then std::codecvt must be +// specialized on those types for this to work. + +#include +#include // for mbstate_t +#include // for std::size_t + +#include +#include + +#if defined(AUTOBOOST_NO_STDC_NAMESPACE) +namespace std { + using ::mbstate_t; + using ::size_t; +} +#endif + +#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) + #define AUTOBOOST_CODECVT_DO_LENGTH_CONST const +#else + #define AUTOBOOST_CODECVT_DO_LENGTH_CONST +#endif + +// maximum lenght of a multibyte string +#define MB_LENGTH_MAX 8 + +AUTOBOOST_UTF8_BEGIN_NAMESPACE + +struct AUTOBOOST_UTF8_DECL utf8_codecvt_facet : + public std::codecvt +{ +public: + explicit utf8_codecvt_facet(std::size_t no_locale_manage=0) + : std::codecvt(no_locale_manage) + {} +protected: + virtual std::codecvt_base::result do_in( + std::mbstate_t& state, + const char * from, + const char * from_end, + const char * & from_next, + wchar_t * to, + wchar_t * to_end, + wchar_t*& to_next + ) const; + + virtual std::codecvt_base::result do_out( + std::mbstate_t & state, + const wchar_t * from, + const wchar_t * from_end, + const wchar_t* & from_next, + char * to, + char * to_end, + char * & to_next + ) const; + + bool invalid_continuing_octet(unsigned char octet_1) const { + return (octet_1 < 0x80|| 0xbf< octet_1); + } + + bool invalid_leading_octet(unsigned char octet_1) const { + return (0x7f < octet_1 && octet_1 < 0xc0) || + (octet_1 > 0xfd); + } + + // continuing octets = octets except for the leading octet + static unsigned int get_cont_octet_count(unsigned char lead_octet) { + return get_octet_count(lead_octet) - 1; + } + + static unsigned int get_octet_count(unsigned char lead_octet); + + // How many "continuing octets" will be needed for this word + // == total octets - 1. + int get_cont_octet_out_count(wchar_t word) const ; + + virtual bool do_always_noconv() const AUTOBOOST_NOEXCEPT_OR_NOTHROW { + return false; + } + + // UTF-8 isn't really stateful since we rewind on partial conversions + virtual std::codecvt_base::result do_unshift( + std::mbstate_t&, + char * from, + char * /*to*/, + char * & next + ) const { + next = from; + return ok; + } + + virtual int do_encoding() const AUTOBOOST_NOEXCEPT_OR_NOTHROW { + const int variable_byte_external_encoding=0; + return variable_byte_external_encoding; + } + + // How many char objects can I process to get <= max_limit + // wchar_t objects? + virtual int do_length( + AUTOBOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &, + const char * from, + const char * from_end, + std::size_t max_limit + ) const; + + // Largest possible value do_length(state,from,from_end,1) could return. + virtual int do_max_length() const AUTOBOOST_NOEXCEPT_OR_NOTHROW { + return 6; // largest UTF-8 encoding of a UCS-4 character + } +}; + +AUTOBOOST_UTF8_END_NAMESPACE + +#endif // AUTOBOOST_UTF8_CODECVT_FACET_HPP diff --git a/contrib/autoboost/boost/detail/utf8_codecvt_facet.ipp b/contrib/autoboost/autoboost/detail/utf8_codecvt_facet.ipp similarity index 94% rename from contrib/autoboost/boost/detail/utf8_codecvt_facet.ipp rename to contrib/autoboost/autoboost/detail/utf8_codecvt_facet.ipp index 8a1312465..61cdb7bfd 100644 --- a/contrib/autoboost/boost/detail/utf8_codecvt_facet.ipp +++ b/contrib/autoboost/autoboost/detail/utf8_codecvt_facet.ipp @@ -7,25 +7,25 @@ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// Please see the comments in to +// Please see the comments in to // learn how this file should be used. -#include +#include #include // for multi-byte converson routines #include -#include -#include +#include +#include // If we don't have wstring, then Unicode support // is not available anyway, so we don't need to even // compiler this file. This also fixes the problem // with mingw, which can compile this file, but will // generate link error when building DLL. -#ifndef BOOST_NO_STD_WSTRING +#ifndef AUTOBOOST_NO_STD_WSTRING -BOOST_UTF8_BEGIN_NAMESPACE +AUTOBOOST_UTF8_BEGIN_NAMESPACE /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // implementation for wchar_t @@ -176,7 +176,7 @@ int utf8_codecvt_facet::do_length( const char * from_end, std::size_t max_limit ) const -#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) +#if AUTOBOOST_WORKAROUND(__IBMCPP__, AUTOBOOST_TESTED_AT(600)) throw() #endif { @@ -216,7 +216,7 @@ unsigned int utf8_codecvt_facet::get_octet_count( else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5; else return 6; } -BOOST_UTF8_END_NAMESPACE +AUTOBOOST_UTF8_END_NAMESPACE namespace { template @@ -243,7 +243,7 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ // where wchar_t is defined as UCS2. The warnings are superfluous as the // specialization is never instantitiated with such compilers, but this // can cause problems if warnings are being treated as errors, so we guard - // against that. Including as we do + // against that. Including as we do // should be enough to get WCHAR_MAX defined. #if !defined(WCHAR_MAX) # error WCHAR_MAX not defined! @@ -271,7 +271,7 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ } // namespace anonymous -BOOST_UTF8_BEGIN_NAMESPACE +AUTOBOOST_UTF8_BEGIN_NAMESPACE // How many "continuing octets" will be needed for this word // == total octets - 1. int utf8_codecvt_facet::get_cont_octet_out_count( @@ -279,6 +279,6 @@ int utf8_codecvt_facet::get_cont_octet_out_count( ) const { return get_cont_octet_out_count_impl(word); } -BOOST_UTF8_END_NAMESPACE +AUTOBOOST_UTF8_END_NAMESPACE #endif diff --git a/contrib/autoboost/autoboost/detail/winapi/GetCurrentProcess.hpp b/contrib/autoboost/autoboost/detail/winapi/GetCurrentProcess.hpp new file mode 100644 index 000000000..4d9bc1b34 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/GetCurrentProcess.hpp @@ -0,0 +1,29 @@ +// GetCurrentProcess.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP +#define AUTOBOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::GetCurrentProcess; +#else + extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentProcess(); +#endif +} +} +} +#endif // AUTOBOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/GetCurrentThread.hpp b/contrib/autoboost/autoboost/detail/winapi/GetCurrentThread.hpp new file mode 100644 index 000000000..bdc2111a5 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/GetCurrentThread.hpp @@ -0,0 +1,38 @@ +// GetCurrentThread.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP +#define AUTOBOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { +#if defined( UNDER_CE ) +// Windows CE define GetCurrentThread as an inline function in kfuncs.h +inline HANDLE_ GetCurrentThread() +{ + return ::GetCurrentThread(); +} +#else +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::GetCurrentThread; +#else + extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread(); +#endif +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/GetLastError.hpp b/contrib/autoboost/autoboost/detail/winapi/GetLastError.hpp new file mode 100644 index 000000000..f5fa6b485 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/GetLastError.hpp @@ -0,0 +1,31 @@ +// GetLastError.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_GETLASTERROR_HPP +#define AUTOBOOST_DETAIL_WINAPI_GETLASTERROR_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::GetLastError; +#else + extern "C" __declspec(dllimport) DWORD_ WINAPI + GetLastError(); +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_GETLASTERROR_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/GetProcessTimes.hpp b/contrib/autoboost/autoboost/detail/winapi/GetProcessTimes.hpp new file mode 100644 index 000000000..1a1e51796 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/GetProcessTimes.hpp @@ -0,0 +1,39 @@ +// GetProcessTimes.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP +#define AUTOBOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { +#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::GetProcessTimes; +#else + extern "C" __declspec(dllimport) BOOL_ WINAPI + GetProcessTimes( + HANDLE_ hProcess, + LPFILETIME_ lpCreationTime, + LPFILETIME_ lpExitTime, + LPFILETIME_ lpKernelTime, + LPFILETIME_ lpUserTime + ); +#endif +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/GetThreadTimes.hpp b/contrib/autoboost/autoboost/detail/winapi/GetThreadTimes.hpp new file mode 100644 index 000000000..4f7751a5f --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/GetThreadTimes.hpp @@ -0,0 +1,37 @@ +// GetThreadTimes.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP +#define AUTOBOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::GetThreadTimes; +#else + extern "C" __declspec(dllimport) BOOL_ WINAPI + GetThreadTimes( + HANDLE_ hThread, + LPFILETIME_ lpCreationTime, + LPFILETIME_ lpExitTime, + LPFILETIME_ lpKernelTime, + LPFILETIME_ lpUserTime + ); +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/LocalFree.hpp b/contrib/autoboost/autoboost/detail/winapi/LocalFree.hpp new file mode 100644 index 000000000..3ae8b81de --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/LocalFree.hpp @@ -0,0 +1,33 @@ +// LocalFree.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_LOCALFREE_HPP +#define AUTOBOOST_DETAIL_WINAPI_LOCALFREE_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { +#if defined( AUTOBOOST_USE_WINDOWS_H ) + typedef HANDLE_ HLOCAL_; + + using ::LocalFree; +#else + extern "C" typedef HANDLE_ HLOCAL_; + extern "C" __declspec(dllimport) HLOCAL_ WINAPI + LocalFree(HLOCAL_ hMem); +#endif +} +} +} +#endif // AUTOBOOST_DETAIL_WINAPI_LOCALFREE_HPP diff --git a/contrib/autoboost/boost/detail/winapi/basic_types.hpp b/contrib/autoboost/autoboost/detail/winapi/basic_types.hpp similarity index 90% rename from contrib/autoboost/boost/detail/winapi/basic_types.hpp rename to contrib/autoboost/autoboost/detail/winapi/basic_types.hpp index f5c3215c0..1128c1b32 100644 --- a/contrib/autoboost/boost/detail/winapi/basic_types.hpp +++ b/contrib/autoboost/autoboost/detail/winapi/basic_types.hpp @@ -6,14 +6,14 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP -#define BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP +#ifndef AUTOBOOST_DETAIL_WINAPI_BASIC_TYPES_HPP +#define AUTOBOOST_DETAIL_WINAPI_BASIC_TYPES_HPP #include -#include -#include +#include +#include -#if defined( BOOST_USE_WINDOWS_H ) +#if defined( AUTOBOOST_USE_WINDOWS_H ) # include #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__) # include @@ -38,14 +38,14 @@ # error "Win32 functions not available" #endif -#ifdef BOOST_HAS_PRAGMA_ONCE +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE #pragma once #endif namespace autoboost { namespace detail { namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) +#if defined( AUTOBOOST_USE_WINDOWS_H ) typedef ::BOOL BOOL_; typedef ::BOOLEAN BOOLEAN_; typedef ::PBOOLEAN PBOOLEAN_; @@ -131,4 +131,4 @@ extern "C" { } } -#endif // BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP +#endif // AUTOBOOST_DETAIL_WINAPI_BASIC_TYPES_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/config.hpp b/contrib/autoboost/autoboost/detail/winapi/config.hpp new file mode 100644 index 000000000..2161c4054 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/config.hpp @@ -0,0 +1,53 @@ +// config.hpp --------------------------------------------------------------// + +// Copyright 2013 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ +#define AUTOBOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +// These constants reflect _WIN32_WINNT_* macros from sdkddkver.h +// See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx#setting_winver_or__win32_winnt +#define AUTOBOOST_WINAPI_VERSION_NT4 0x0400 +#define AUTOBOOST_WINAPI_VERSION_WIN2K 0x0500 +#define AUTOBOOST_WINAPI_VERSION_WINXP 0x0501 +#define AUTOBOOST_WINAPI_VERSION_WS03 0x0502 +#define AUTOBOOST_WINAPI_VERSION_WIN6 0x0600 +#define AUTOBOOST_WINAPI_VERSION_VISTA 0x0600 +#define AUTOBOOST_WINAPI_VERSION_WS08 0x0600 +#define AUTOBOOST_WINAPI_VERSION_LONGHORN 0x0600 +#define AUTOBOOST_WINAPI_VERSION_WIN7 0x0601 +#define AUTOBOOST_WINAPI_VERSION_WIN8 0x0602 +#define AUTOBOOST_WINAPI_VERSION_WINBLUE 0x0603 + +#if !defined(AUTOBOOST_USE_WINAPI_VERSION) +#if defined(_WIN32_WINNT) +#define AUTOBOOST_USE_WINAPI_VERSION _WIN32_WINNT +#elif defined(WINVER) +#define AUTOBOOST_USE_WINAPI_VERSION WINVER +#else +// By default use Windows XP API +#define AUTOBOOST_USE_WINAPI_VERSION AUTOBOOST_WINAPI_VERSION_WINXP +#endif +#endif + +#if defined(AUTOBOOST_USE_WINDOWS_H) +// We have to define the version macros so that windows.h provides the necessary symbols +#if !defined(_WIN32_WINNT) +#define _WIN32_WINNT AUTOBOOST_USE_WINAPI_VERSION +#endif +#if !defined(WINVER) +#define WINVER AUTOBOOST_USE_WINAPI_VERSION +#endif +#endif + +#endif // AUTOBOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ diff --git a/contrib/autoboost/autoboost/detail/winapi/crypt.hpp b/contrib/autoboost/autoboost/detail/winapi/crypt.hpp new file mode 100644 index 000000000..c73b5ca41 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/crypt.hpp @@ -0,0 +1,88 @@ +// crypt.hpp --------------------------------------------------------------// + +// Copyright 2014 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_CRYPT_HPP +#define AUTOBOOST_DETAIL_WINAPI_CRYPT_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + typedef HCRYPTPROV HCRYPTPROV_; + + using ::CryptEnumProvidersA; + using ::CryptAcquireContextA; + using ::CryptGenRandom; + using ::CryptReleaseContext; + + const DWORD_ PROV_RSA_FULL_ = PROV_RSA_FULL; + + const DWORD_ CRYPT_VERIFYCONTEXT_ = CRYPT_VERIFYCONTEXT; + const DWORD_ CRYPT_NEWKEYSET_ = CRYPT_NEWKEYSET; + const DWORD_ CRYPT_DELETEKEYSET_ = CRYPT_DELETEKEYSET; + const DWORD_ CRYPT_MACHINE_KEYSET_ = CRYPT_MACHINE_KEYSET; + const DWORD_ CRYPT_SILENT_ = CRYPT_SILENT; +#else +extern "C" { + typedef ULONG_PTR_ HCRYPTPROV_; + + __declspec(dllimport) BOOL_ __stdcall + CryptEnumProvidersA( + DWORD_ dwIndex, + DWORD_ *pdwReserved, + DWORD_ dwFlags, + DWORD_ *pdwProvType, + LPSTR_ szProvName, + DWORD_ *pcbProvName + ); + + __declspec(dllimport) BOOL_ __stdcall + CryptAcquireContextA( + HCRYPTPROV_ *phProv, + LPCSTR_ pszContainer, + LPCSTR_ pszProvider, + DWORD_ dwProvType, + DWORD_ dwFlags + ); + + __declspec(dllimport) BOOL_ __stdcall + CryptGenRandom( + HCRYPTPROV_ hProv, + DWORD_ dwLen, + BYTE_ *pbBuffer + ); + + __declspec(dllimport) BOOL_ __stdcall + CryptReleaseContext( + HCRYPTPROV_ hProv, + DWORD_ dwFlags + ); + + const DWORD_ PROV_RSA_FULL_ = 1; + + const DWORD_ CRYPT_VERIFYCONTEXT_ = 0xF0000000; + const DWORD_ CRYPT_NEWKEYSET_ = 8; + const DWORD_ CRYPT_DELETEKEYSET_ = 16; + const DWORD_ CRYPT_MACHINE_KEYSET_ = 32; + const DWORD_ CRYPT_SILENT_ = 64; +} +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_CRYPT_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/directory_management.hpp b/contrib/autoboost/autoboost/detail/winapi/directory_management.hpp new file mode 100644 index 000000000..1af317b2e --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/directory_management.hpp @@ -0,0 +1,46 @@ +// directory_management.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP +#define AUTOBOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP + +#include +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::CreateDirectory; + using ::CreateDirectoryA; + using ::GetTempPathA; + using ::RemoveDirectoryA; +#else +extern "C" { + __declspec(dllimport) int __stdcall + CreateDirectory(LPCTSTR_, LPSECURITY_ATTRIBUTES_*); + __declspec(dllimport) int __stdcall + CreateDirectoryA(LPCTSTR_, interprocess_security_attributes*); + __declspec(dllimport) int __stdcall + GetTempPathA(unsigned long length, char *buffer); + __declspec(dllimport) int __stdcall + RemoveDirectoryA(LPCTSTR_); +} +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/dll.hpp b/contrib/autoboost/autoboost/detail/winapi/dll.hpp new file mode 100644 index 000000000..bb3ee157f --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/dll.hpp @@ -0,0 +1,86 @@ +// dll.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_DLL_HPP +#define AUTOBOOST_DETAIL_WINAPI_DLL_HPP + +#include +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + typedef ::FARPROC FARPROC_; + typedef ::NEARPROC NEARPROC_; + typedef ::PROC PROC_; + +# ifdef AUTOBOOST_NO_ANSI_APIS + using ::LoadLibraryW; + using ::GetModuleHandleW; +# else + using ::LoadLibraryA; + using ::GetModuleHandleA; +# endif + using ::FreeLibrary; + using ::GetProcAddress; +#else +extern "C" { +# ifdef _WIN64 + typedef INT_PTR_ (WINAPI *FARPROC_)(); + typedef INT_PTR_ (WINAPI *NEARPROC_)(); + typedef INT_PTR_ (WINAPI *PROC_)(); +# else + typedef int (WINAPI *FARPROC_)(); + typedef int (WINAPI *NEARPROC_)(); + typedef int (WINAPI *PROC_)(); +# endif // _WIN64 + +# ifdef AUTOBOOST_NO_ANSI_APIS + __declspec(dllimport) HMODULE_ WINAPI + LoadLibraryW( + LPCWSTR_ lpFileName + ); + __declspec(dllimport) HMODULE_ WINAPI + GetModuleHandleW( + LPCWSTR_ lpFileName + ); +# else + __declspec(dllimport) HMODULE_ WINAPI + LoadLibraryA( + LPCSTR_ lpFileName + ); + __declspec(dllimport) HMODULE_ WINAPI + GetModuleHandleA( + LPCSTR_ lpFileName + ); +# endif + + __declspec(dllimport) BOOL_ WINAPI + FreeLibrary( + HMODULE_ hModule + ); + __declspec(dllimport) FARPROC_ WINAPI + GetProcAddress( + HMODULE_ hModule, + LPCSTR_ lpProcName + ); +} +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_DLL_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/error_handling.hpp b/contrib/autoboost/autoboost/detail/winapi/error_handling.hpp new file mode 100644 index 000000000..189aa6e4b --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/error_handling.hpp @@ -0,0 +1,93 @@ +// error_handling.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP +#define AUTOBOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP + +#include +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { + +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::FormatMessageA; + using ::FormatMessageW; + + const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER; + const int FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS; + const int FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING; + const int FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE; + const int FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM; + const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY; + const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK; + + const char LANG_NEUTRAL_= LANG_NEUTRAL; + const char LANG_INVARIANT_= LANG_INVARIANT; + + const char SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default + inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) { + return MAKELANGID(p,s); + } +#else +extern "C" { + // using ::FormatMessageA; + __declspec(dllimport) + DWORD_ + WINAPI + FormatMessageA( + DWORD_ dwFlags, + LPCVOID_ lpSource, + DWORD_ dwMessageId, + DWORD_ dwLanguageId, + LPSTR_ lpBuffer, + DWORD_ nSize, + va_list *Arguments + ); + + // using ::FormatMessageW; + __declspec(dllimport) + DWORD_ + WINAPI + FormatMessageW( + DWORD_ dwFlags, + LPCVOID_ lpSource, + DWORD_ dwMessageId, + DWORD_ dwLanguageId, + LPWSTR_ lpBuffer, + DWORD_ nSize, + va_list *Arguments + ); + + const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100; + const int FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200; + const int FORMAT_MESSAGE_FROM_STRING_= 0x00000400; + const int FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800; + const int FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000; + const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000; + const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF; + + const char LANG_NEUTRAL_= 0x00; + const char LANG_INVARIANT_= 0x7f; + + const char SUBLANG_DEFAULT_= 0x01; // user default + inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) { + return ((((WORD_ )(s)) << 10) | (WORD_ )(p)); + } + +} +#endif +} +} +} +#endif // AUTOBOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/file_management.hpp b/contrib/autoboost/autoboost/detail/winapi/file_management.hpp new file mode 100644 index 000000000..caa94ed47 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/file_management.hpp @@ -0,0 +1,130 @@ +// thread.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP +#define AUTOBOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP + +#include +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::CreateFileA; + using ::DeleteFileA; + using ::FindFirstFileA; + using ::FindNextFileA; + using ::FindClose; + using ::GetFileSizeEx; + using ::MoveFileExA; + using ::SetFileValidData; +#else +extern "C" { + typedef struct _OVERLAPPED { + ULONG_PTR Internal; + ULONG_PTR InternalHigh; + union { + struct { + DWORD Offset; + DWORD OffsetHigh; + } ; + PVOID Pointer; + } ; + HANDLE hEvent; + } OVERLAPPED, *LPOVERLAPPED; + + + __declspec(dllimport) void * __stdcall + CreateFileA (const char *, unsigned long, unsigned long, struct SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, void *); + __declspec(dllimport) int __stdcall + DeleteFileA (const char *); + __declspec(dllimport) void *__stdcall + FindFirstFileA(const char *lpFileName, win32_find_data_t *lpFindFileData); + __declspec(dllimport) int __stdcall + FindNextFileA(void *hFindFile, win32_find_data_t *lpFindFileData); + __declspec(dllimport) int __stdcall + FindClose(void *hFindFile); + __declspec(dllimport) BOOL __stdcall + GetFileSizeEx( + HANDLE_ hFile, + PLARGE_INTEGER_ lpFileSize + ); + __declspec(dllimport) int __stdcall + MoveFileExA (const char *, const char *, unsigned long); + __declspec(dllimport) BOOL_ __stdcall + SetFileValidData( + HANDLE_ hFile, + LONGLONG_ ValidDataLength + ); + __declspec(dllimport) BOOL_ __stdcall + SetEndOfFile( + HANDLE_ hFile + ); + __declspec(dllimport) BOOL_ __stdcall + SetFilePointerEx( + HANDLE_ hFile, + LARGE_INTEGER_ liDistanceToMove, + PLARGE_INTEGER_ lpNewFilePointer, + DWORD_ dwMoveMethod + ); + __declspec(dllimport) BOOL_ __stdcall + LockFile( + HANDLE_ hFile, + DWORD_ dwFileOffsetLow, + DWORD_ dwFileOffsetHigh, + DWORD_ nNumberOfBytesToLockLow, + DWORD_ nNumberOfBytesToLockHigh + ); + __declspec(dllimport) BOOL_ __stdcall + UnlockFile( + HANDLE_ hFile, + DWORD_ dwFileOffsetLow, + DWORD_ dwFileOffsetHigh, + DWORD_ nNumberOfBytesToUnlockLow, + DWORD_ nNumberOfBytesToUnlockHigh + ); + __declspec(dllimport) BOOL_ __stdcall + LockFileEx( + HANDLE_ hFile, + DWORD_ dwFlags, + DWORD_ dwReserved, + DWORD_ nNumberOfBytesToLockLow, + DWORD_ nNumberOfBytesToLockHigh, + LPOVERLAPPED_ lpOverlapped + ); + __declspec(dllimport) BOOL_ __stdcall + UnlockFileEx( + HANDLE_ hFile, + DWORD_ dwReserved, + DWORD_ nNumberOfBytesToUnlockLow, + DWORD_ nNumberOfBytesToUnlockHigh, + LPOVERLAPPED_ lpOverlapped + ); + __declspec(dllimport) BOOL_ __stdcall + WriteFile( + HANDLE_ hFile, + LPCVOID_ lpBuffer, + DWORD_ nNumberOfBytesToWrite, + LPDWORD_ lpNumberOfBytesWritten, + LPOVERLAPPED_ lpOverlapped + ); +} +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/handles.hpp b/contrib/autoboost/autoboost/detail/winapi/handles.hpp new file mode 100644 index 000000000..3e4ff99ad --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/handles.hpp @@ -0,0 +1,46 @@ +// memory.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_HANDLES_HPP +#define AUTOBOOST_DETAIL_WINAPI_HANDLES_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::CloseHandle; + using ::DuplicateHandle; + + const DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE; + const DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS; + const HANDLE_ invalid_handle_value = INVALID_HANDLE_VALUE; +#else +extern "C" { + __declspec(dllimport) int __stdcall + CloseHandle(void*); + __declspec(dllimport) int __stdcall + DuplicateHandle(void*,void*,void*,void**,unsigned long,int,unsigned long); +} + const DWORD_ duplicate_close_source = 1; + const DWORD_ duplicate_same_access = 2; + const HANDLE_ invalid_handle_value = (HANDLE_)(-1); +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_HANDLES_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/memory.hpp b/contrib/autoboost/autoboost/detail/winapi/memory.hpp new file mode 100644 index 000000000..a6b63a7db --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/memory.hpp @@ -0,0 +1,60 @@ +// memory.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_MEMORY_HPP +#define AUTOBOOST_DETAIL_WINAPI_MEMORY_HPP + +#include +#include +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::CreateFileMappingA; + using ::FlushViewOfFile; + using ::GetProcessHeap; + using ::HeapAlloc; + using ::HeapFree; + using ::MapViewOfFileEx; + using ::OpenFileMappingA; + using ::UnmapViewOfFile; +#else +#undef HeapAlloc +extern "C" { + __declspec(dllimport) void * __stdcall + CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *); + __declspec(dllimport) int __stdcall + FlushViewOfFile (void *, std::size_t); + __declspec(dllimport) HANDLE_ __stdcall + GetProcessHeap(); + __declspec(dllimport) void* __stdcall + HeapAlloc(HANDLE_,DWORD_,SIZE_T_); + __declspec(dllimport) BOOL_ __stdcall + HeapFree(HANDLE_,DWORD_,LPVOID_); + __declspec(dllimport) void * __stdcall + MapViewOfFileEx (void *, unsigned long, unsigned long, unsigned long, std::size_t, void*); + __declspec(dllimport) void * __stdcall + OpenFileMappingA (unsigned long, int, const char *); + __declspec(dllimport) int __stdcall + UnmapViewOfFile(void *); +} +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_MEMORY_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/process.hpp b/contrib/autoboost/autoboost/detail/winapi/process.hpp new file mode 100644 index 000000000..776e3a8c7 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/process.hpp @@ -0,0 +1,36 @@ +// process.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_PROCESS_HPP +#define AUTOBOOST_DETAIL_WINAPI_PROCESS_HPP + +#include +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::GetCurrentProcessId; +#else +# ifndef UNDER_CE +extern "C" { + __declspec(dllimport) DWORD_ WINAPI GetCurrentProcessId(void); +} +# else + using ::GetCurrentProcessId; +# endif +#endif +} +} +} +#endif // AUTOBOOST_DETAIL_WINAPI_PROCESS_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/security.hpp b/contrib/autoboost/autoboost/detail/winapi/security.hpp new file mode 100644 index 000000000..3b7989c69 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/security.hpp @@ -0,0 +1,65 @@ +// security.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_SECURITY_HPP +#define AUTOBOOST_DETAIL_WINAPI_SECURITY_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) +typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_; +typedef ::PSECURITY_ATTRIBUTES PSECURITY_ATTRIBUTES_; +typedef ::LPSECURITY_ATTRIBUTES LPSECURITY_ATTRIBUTES_; + +#else +extern "C" { + struct SECURITY_DESCRIPTOR_; + typedef SECURITY_DESCRIPTOR_* PSECURITY_DESCRIPTOR_; + typedef struct _ACL { + BYTE_ AclRevision; + BYTE_ Sbz1; + WORD_ AclSize; + WORD_ AceCount; + WORD_ Sbz2; + } ACL_, *PACL_; + + typedef struct _SECURITY_ATTRIBUTES { + DWORD_ nLength; + LPVOID_ lpSecurityDescriptor; + BOOL_ bInheritHandle; + } SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_; + + __declspec(dllimport) BOOL_ __stdcall + InitializeSecurityDescriptor( + PSECURITY_DESCRIPTOR_ pSecurityDescriptor, + DWORD_ dwRevision + ); + __declspec(dllimport) BOOL_ __stdcall + SetSecurityDescriptorDacl( + PSECURITY_DESCRIPTOR_ pSecurityDescriptor, + BOOL_ bDaclPresent, + PACL_ pDacl, + BOOL_ bDaclDefaulted + ); +} +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_SECURITY_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/synchronization.hpp b/contrib/autoboost/autoboost/detail/winapi/synchronization.hpp new file mode 100644 index 000000000..1cdc007ce --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/synchronization.hpp @@ -0,0 +1,293 @@ +// synchronizaion.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP +#define AUTOBOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + typedef ::CRITICAL_SECTION CRITICAL_SECTION_; + typedef ::PAPCFUNC PAPCFUNC_; + +#if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN6 + typedef ::INIT_ONCE INIT_ONCE_; + typedef ::PINIT_ONCE PINIT_ONCE_; + typedef ::LPINIT_ONCE LPINIT_ONCE_; + #define AUTOBOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT INIT_ONCE_STATIC_INIT + typedef ::PINIT_ONCE_FN PINIT_ONCE_FN_; + + typedef ::SRWLOCK SRWLOCK_; + typedef ::PSRWLOCK PSRWLOCK_; + #define AUTOBOOST_DETAIL_WINAPI_SRWLOCK_INIT SRWLOCK_INIT + + typedef ::CONDITION_VARIABLE CONDITION_VARIABLE_; + typedef ::PCONDITION_VARIABLE PCONDITION_VARIABLE_; + #define AUTOBOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT CONDITION_VARIABLE_INIT +#endif + + using ::InitializeCriticalSection; +#if AUTOBOOST_USE_WINAPI_VERSION >= 0x0403 + using ::InitializeCriticalSectionAndSpinCount; +#endif + using ::EnterCriticalSection; + using ::TryEnterCriticalSection; + using ::LeaveCriticalSection; + using ::DeleteCriticalSection; + +# ifdef AUTOBOOST_NO_ANSI_APIS + using ::CreateMutexW; + using ::OpenMutexW; + using ::CreateEventW; + using ::OpenEventW; + using ::CreateSemaphoreW; + using ::OpenSemaphoreW; +# else + using ::CreateMutexA; + using ::OpenMutexA; + using ::CreateEventA; + using ::OpenEventA; + using ::CreateSemaphoreA; + using ::OpenSemaphoreA; +# endif + using ::ReleaseMutex; + using ::ReleaseSemaphore; + using ::SetEvent; + using ::ResetEvent; + using ::WaitForMultipleObjects; + using ::WaitForSingleObject; + using ::QueueUserAPC; + +#if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN6 + using ::InitOnceInitialize; + using ::InitOnceExecuteOnce; + using ::InitOnceBeginInitialize; + using ::InitOnceComplete; + + using ::InitializeSRWLock; + using ::AcquireSRWLockExclusive; + using ::TryAcquireSRWLockExclusive; + using ::ReleaseSRWLockExclusive; + using ::AcquireSRWLockShared; + using ::TryAcquireSRWLockShared; + using ::ReleaseSRWLockShared; + + using ::InitializeConditionVariable; + using ::WakeConditionVariable; + using ::WakeAllConditionVariable; + using ::SleepConditionVariableCS; + using ::SleepConditionVariableSRW; +#endif + + const DWORD_ infinite = INFINITE; + const DWORD_ wait_abandoned = WAIT_ABANDONED; + const DWORD_ wait_object_0 = WAIT_OBJECT_0; + const DWORD_ wait_timeout = WAIT_TIMEOUT; + const DWORD_ wait_failed = WAIT_FAILED; + +#if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN6 + const DWORD_ init_once_async = INIT_ONCE_ASYNC; + const DWORD_ init_once_check_only = INIT_ONCE_CHECK_ONLY; + const DWORD_ init_once_init_failed = INIT_ONCE_INIT_FAILED; + const DWORD_ init_once_ctx_reserved_bits = INIT_ONCE_CTX_RESERVED_BITS; + + const ULONG_ condition_variable_lockmode_shared = CONDITION_VARIABLE_LOCKMODE_SHARED; +#endif + +#else // defined( AUTOBOOST_USE_WINDOWS_H ) + +extern "C" { + + typedef struct CRITICAL_SECTION_ + { + struct critical_section_debug * DebugInfo; + long LockCount; + long RecursionCount; + void * OwningThread; + void * LockSemaphore; + #if defined(_WIN64) + unsigned __int64 SpinCount; + #else + unsigned long SpinCount; + #endif + } + *PCRITICAL_SECTION_; + +#if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN6 + typedef union INIT_ONCE_ + { + PVOID_ Ptr; + } + *PINIT_ONCE_, *LPINIT_ONCE_; + #define AUTOBOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT {0} + typedef BOOL_ (WINAPI *PINIT_ONCE_FN_)(PINIT_ONCE_ InitOnce, PVOID_ Parameter, PVOID_ *Context); + + typedef struct SRWLOCK_ + { + PVOID_ Ptr; + } + * PSRWLOCK_; + #define AUTOBOOST_DETAIL_WINAPI_SRWLOCK_INIT {0} + + typedef struct CONDITION_VARIABLE_ + { + PVOID_ Ptr; + } + * PCONDITION_VARIABLE_; + #define AUTOBOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT {0} + +#endif + + __declspec(dllimport) void WINAPI + InitializeCriticalSection(PCRITICAL_SECTION_); +#if AUTOBOOST_USE_WINAPI_VERSION >= 0x0403 + __declspec(dllimport) BOOL_ WINAPI + InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION_* lpCS, DWORD_ dwSpinCount); +#endif + __declspec(dllimport) void WINAPI + EnterCriticalSection(PCRITICAL_SECTION_); + __declspec(dllimport) BOOL_ WINAPI + TryEnterCriticalSection(PCRITICAL_SECTION_); + __declspec(dllimport) void WINAPI + LeaveCriticalSection(PCRITICAL_SECTION_); + __declspec(dllimport) void WINAPI + DeleteCriticalSection(PCRITICAL_SECTION_); + + struct _SECURITY_ATTRIBUTES; +# ifdef AUTOBOOST_NO_ANSI_APIS + __declspec(dllimport) HANDLE_ WINAPI + CreateMutexW(_SECURITY_ATTRIBUTES*, BOOL_, LPCWSTR_); + __declspec(dllimport) HANDLE_ WINAPI + OpenMutexW(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName); + __declspec(dllimport) HANDLE_ WINAPI + CreateSemaphoreW(_SECURITY_ATTRIBUTES*, LONG_, LONG_, LPCWSTR_); + __declspec(dllimport) HANDLE_ WINAPI + OpenSemaphoreW(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName); + __declspec(dllimport) HANDLE_ WINAPI + CreateEventW(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCWSTR_); + __declspec(dllimport) HANDLE_ WINAPI + OpenEventW(DWORD_, BOOL_, LPCWSTR_); +# else + __declspec(dllimport) HANDLE_ WINAPI + CreateMutexA(_SECURITY_ATTRIBUTES*, BOOL_, LPCSTR_); + __declspec(dllimport) HANDLE_ WINAPI + OpenMutexA(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName); + __declspec(dllimport) HANDLE_ WINAPI + CreateSemaphoreA(_SECURITY_ATTRIBUTES*, LONG_, LONG_, LPCSTR_); + __declspec(dllimport) HANDLE_ WINAPI + OpenSemaphoreA(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName); + __declspec(dllimport) HANDLE_ WINAPI + CreateEventA(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCSTR_); + __declspec(dllimport) HANDLE_ WINAPI + OpenEventA(DWORD_, BOOL_, LPCSTR_); +# endif + __declspec(dllimport) BOOL_ WINAPI + ReleaseMutex(HANDLE_); + __declspec(dllimport) DWORD_ WINAPI + WaitForSingleObject(HANDLE_, DWORD_); + __declspec(dllimport) DWORD_ WINAPI + WaitForMultipleObjects(DWORD_ nCount, + HANDLE_ const * lpHandles, + BOOL_ bWaitAll, + DWORD_ dwMilliseconds); + __declspec(dllimport) BOOL_ WINAPI + ReleaseSemaphore(HANDLE_, LONG_, LONG_*); + __declspec(dllimport) BOOL_ WINAPI + SetEvent(HANDLE_); + __declspec(dllimport) BOOL_ WINAPI + ResetEvent(HANDLE_); + + typedef void (__stdcall *PAPCFUNC_)(ULONG_PTR_); + __declspec(dllimport) DWORD_ WINAPI + QueueUserAPC(PAPCFUNC_, HANDLE_, ULONG_PTR_); + +#if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN6 + __declspec(dllimport) void WINAPI InitOnceInitialize(PINIT_ONCE_); + __declspec(dllimport) BOOL_ WINAPI InitOnceExecuteOnce(PINIT_ONCE_ InitOnce, PINIT_ONCE_FN_ InitFn, PVOID_ Parameter, LPVOID_* Context); + __declspec(dllimport) BOOL_ WINAPI InitOnceBeginInitialize(LPINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, BOOL_* fPending, LPVOID_* lpContext); + __declspec(dllimport) BOOL_ WINAPI InitOnceComplete(LPINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, LPVOID_* lpContext); + + + __declspec(dllimport) void WINAPI InitializeSRWLock(PSRWLOCK_ SRWLock); + __declspec(dllimport) void WINAPI AcquireSRWLockExclusive(PSRWLOCK_ SRWLock); + __declspec(dllimport) BOOLEAN_ WINAPI TryAcquireSRWLockExclusive(PSRWLOCK_ SRWLock); + __declspec(dllimport) void WINAPI ReleaseSRWLockExclusive(PSRWLOCK_ SRWLock); + __declspec(dllimport) void WINAPI AcquireSRWLockShared(PSRWLOCK_ SRWLock); + __declspec(dllimport) BOOLEAN_ WINAPI TryAcquireSRWLockShared(PSRWLOCK_ SRWLock); + __declspec(dllimport) void WINAPI ReleaseSRWLockShared(PSRWLOCK_ SRWLock); + + __declspec(dllimport) void WINAPI InitializeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable); + __declspec(dllimport) void WINAPI WakeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable); + __declspec(dllimport) void WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE_ ConditionVariable); + __declspec(dllimport) BOOL_ WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE_ ConditionVariable, PCRITICAL_SECTION_ CriticalSection, DWORD_ dwMilliseconds); + __declspec(dllimport) BOOL_ WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE_ ConditionVariable, PSRWLOCK_ SRWLock, DWORD_ dwMilliseconds, ULONG_ Flags); +#endif + +} // extern "C" + +const DWORD_ infinite = (DWORD_)0xFFFFFFFF; +const DWORD_ wait_abandoned = 0x00000080L; +const DWORD_ wait_object_0 = 0x00000000L; +const DWORD_ wait_timeout = 0x00000102L; +const DWORD_ wait_failed = (DWORD_)0xFFFFFFFF; + +#if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN6 +const DWORD_ init_once_async = 0x00000002UL; +const DWORD_ init_once_check_only = 0x00000001UL; +const DWORD_ init_once_init_failed = 0x00000004UL; +const DWORD_ init_once_ctx_reserved_bits = 2; + +const ULONG_ condition_variable_lockmode_shared = 0x00000001; +#endif + +#endif // defined( AUTOBOOST_USE_WINDOWS_H ) + +const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE; + +AUTOBOOST_FORCEINLINE HANDLE_ create_anonymous_mutex(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bInitialOwner) +{ +#ifdef AUTOBOOST_NO_ANSI_APIS + return CreateMutexW(lpAttributes, bInitialOwner, 0); +#else + return CreateMutexA(lpAttributes, bInitialOwner, 0); +#endif +} + +AUTOBOOST_FORCEINLINE HANDLE_ create_anonymous_semaphore(_SECURITY_ATTRIBUTES* lpAttributes, LONG_ lInitialCount, LONG_ lMaximumCount) +{ +#ifdef AUTOBOOST_NO_ANSI_APIS + return CreateSemaphoreW(lpAttributes, lInitialCount, lMaximumCount, 0); +#else + return CreateSemaphoreA(lpAttributes, lInitialCount, lMaximumCount, 0); +#endif +} + +AUTOBOOST_FORCEINLINE HANDLE_ create_anonymous_event(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bManualReset, BOOL_ bInitialState) +{ +#ifdef AUTOBOOST_NO_ANSI_APIS + return CreateEventW(lpAttributes, bManualReset, bInitialState, 0); +#else + return CreateEventA(lpAttributes, bManualReset, bInitialState, 0); +#endif +} + +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/system.hpp b/contrib/autoboost/autoboost/detail/winapi/system.hpp new file mode 100644 index 000000000..8631ad51d --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/system.hpp @@ -0,0 +1,62 @@ +// system.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba +// Copyright (c) Microsoft Corporation 2014 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_SYSTEM_HPP +#define AUTOBOOST_DETAIL_WINAPI_SYSTEM_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { +#if defined( AUTOBOOST_USE_WINDOWS_H ) + typedef ::SYSTEM_INFO SYSTEM_INFO_; +# if AUTOBOOST_USE_WINAPI_VERSION < AUTOBOOST_WINAPI_VERSION_WINXP +extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); +# else +extern "C" __declspec(dllimport) void __stdcall GetNativeSystemInfo (struct system_info *); +# endif +#else +extern "C" { + typedef struct _SYSTEM_INFO { + union { + DWORD_ dwOemId; + struct { + WORD_ wProcessorArchitecture; + WORD_ wReserved; + } dummy; + } ; + DWORD_ dwPageSize; + LPVOID_ lpMinimumApplicationAddress; + LPVOID_ lpMaximumApplicationAddress; + DWORD_PTR_ dwActiveProcessorMask; + DWORD_ dwNumberOfProcessors; + DWORD_ dwProcessorType; + DWORD_ dwAllocationGranularity; + WORD_ wProcessorLevel; + WORD_ wProcessorRevision; + } SYSTEM_INFO_; + +# if AUTOBOOST_USE_WINAPI_VERSION < AUTOBOOST_WINAPI_VERSION_WINXP + __declspec(dllimport) void __stdcall + GetSystemInfo (struct system_info *); +# else + __declspec(dllimport) void __stdcall + GetNativeSystemInfo (struct system_info *); +# endif +} +#endif +} +} +} +#endif // AUTOBOOST_DETAIL_WINAPI_SYSTEM_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/thread.hpp b/contrib/autoboost/autoboost/detail/winapi/thread.hpp new file mode 100644 index 000000000..b4f89d9a4 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/thread.hpp @@ -0,0 +1,49 @@ +// thread.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_THREAD_HPP +#define AUTOBOOST_DETAIL_WINAPI_THREAD_HPP + +#include +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::GetCurrentThreadId; + using ::SleepEx; + using ::Sleep; + using ::SwitchToThread; +#else +extern "C" { +# ifndef UNDER_CE + __declspec(dllimport) DWORD_ WINAPI GetCurrentThreadId(void); + __declspec(dllimport) DWORD_ WINAPI SleepEx(DWORD_, BOOL_); + __declspec(dllimport) void WINAPI Sleep(DWORD_); + __declspec(dllimport) BOOL_ WINAPI SwitchToThread(void); +#else + using ::GetCurrentThreadId; + using ::SleepEx; + using ::Sleep; + using ::SwitchToThread; +#endif +} +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/thread_pool.hpp b/contrib/autoboost/autoboost/detail/winapi/thread_pool.hpp new file mode 100644 index 000000000..2a712d240 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/thread_pool.hpp @@ -0,0 +1,96 @@ +// thread_pool.hpp --------------------------------------------------------------// + +// Copyright 2013 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_THREAD_POOL_HPP +#define AUTOBOOST_DETAIL_WINAPI_THREAD_POOL_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN2K + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + +typedef ::WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACKFUNC_; +typedef ::WAITORTIMERCALLBACK WAITORTIMERCALLBACK_; + +using ::RegisterWaitForSingleObject; +using ::UnregisterWait; +using ::UnregisterWaitEx; + +const ULONG_ wt_execute_default = WT_EXECUTEDEFAULT; +const ULONG_ wt_execute_in_io_thread = WT_EXECUTEINIOTHREAD; +const ULONG_ wt_execute_in_ui_thread = WT_EXECUTEINUITHREAD; +const ULONG_ wt_execute_in_wait_thread = WT_EXECUTEINWAITTHREAD; +const ULONG_ wt_execute_only_once = WT_EXECUTEONLYONCE; +const ULONG_ wt_execute_in_timer_thread = WT_EXECUTEINTIMERTHREAD; +const ULONG_ wt_execute_long_function = WT_EXECUTELONGFUNCTION; +const ULONG_ wt_execute_in_persistent_io_thread = WT_EXECUTEINPERSISTENTIOTHREAD; +const ULONG_ wt_execute_in_persistent_thread = WT_EXECUTEINPERSISTENTTHREAD; +const ULONG_ wt_transfer_impersonation = WT_TRANSFER_IMPERSONATION; + +inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit) +{ + return WT_SET_MAX_THREADPOOL_THREADS(flags, limit); +} + +#else + +extern "C" { + +typedef void (NTAPI* WAITORTIMERCALLBACKFUNC_) (PVOID_, BOOLEAN_); +typedef WAITORTIMERCALLBACKFUNC_ WAITORTIMERCALLBACK_; + +__declspec(dllimport) BOOL_ WINAPI RegisterWaitForSingleObject +( + HANDLE_* phNewWaitObject, + HANDLE_ hObject, + WAITORTIMERCALLBACK_ Callback, + PVOID_ Context, + ULONG_ dwMilliseconds, + ULONG_ dwFlags +); + +__declspec(dllimport) BOOL_ WINAPI UnregisterWait(HANDLE_ WaitHandle); +__declspec(dllimport) BOOL_ WINAPI UnregisterWaitEx(HANDLE_ WaitHandle, HANDLE_ CompletionEvent); + +} // extern "C" + +const ULONG_ wt_execute_default = 0x00000000; +const ULONG_ wt_execute_in_io_thread = 0x00000001; +const ULONG_ wt_execute_in_ui_thread = 0x00000002; +const ULONG_ wt_execute_in_wait_thread = 0x00000004; +const ULONG_ wt_execute_only_once = 0x00000008; +const ULONG_ wt_execute_in_timer_thread = 0x00000020; +const ULONG_ wt_execute_long_function = 0x00000010; +const ULONG_ wt_execute_in_persistent_io_thread = 0x00000040; +const ULONG_ wt_execute_in_persistent_thread = 0x00000080; +const ULONG_ wt_transfer_impersonation = 0x00000100; + +inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit) +{ + return flags | (limit << 16); +} + +#endif +} +} +} + +#endif // AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN2K + +#endif // AUTOBOOST_DETAIL_WINAPI_THREAD_POOL_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/time.hpp b/contrib/autoboost/autoboost/detail/winapi/time.hpp new file mode 100644 index 000000000..979add2e8 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/time.hpp @@ -0,0 +1,105 @@ +// time.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba +// Copyright (c) Microsoft Corporation 2014 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_TIME_HPP +#define AUTOBOOST_DETAIL_WINAPI_TIME_HPP + +#include +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost { +namespace detail { +namespace winapi { + +#if defined( AUTOBOOST_USE_WINDOWS_H ) + + typedef FILETIME FILETIME_; + typedef PFILETIME PFILETIME_; + typedef LPFILETIME LPFILETIME_; + + typedef SYSTEMTIME SYSTEMTIME_; + typedef SYSTEMTIME* PSYSTEMTIME_; + + #ifdef AUTOBOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime + using ::GetSystemTimeAsFileTime; + #endif + #if AUTOBOOST_PLAT_WINDOWS_DESKTOP + using ::FileTimeToLocalFileTime; + #endif + using ::GetSystemTime; + using ::SystemTimeToFileTime; + + #if AUTOBOOST_PLAT_WINDOWS_DESKTOP + using ::GetTickCount; + #endif + #if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN6 + using ::GetTickCount64; + #endif + +#else + +extern "C" { + typedef struct _FILETIME { + DWORD_ dwLowDateTime; + DWORD_ dwHighDateTime; + } FILETIME_, *PFILETIME_, *LPFILETIME_; + + typedef struct _SYSTEMTIME { + WORD_ wYear; + WORD_ wMonth; + WORD_ wDayOfWeek; + WORD_ wDay; + WORD_ wHour; + WORD_ wMinute; + WORD_ wSecond; + WORD_ wMilliseconds; + } SYSTEMTIME_, *PSYSTEMTIME_; + + #ifdef AUTOBOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime + __declspec(dllimport) void WINAPI + GetSystemTimeAsFileTime(FILETIME_* lpFileTime); + #endif + __declspec(dllimport) int WINAPI + FileTimeToLocalFileTime(const FILETIME_* lpFileTime, + FILETIME_* lpLocalFileTime); + __declspec(dllimport) void WINAPI + GetSystemTime(SYSTEMTIME_* lpSystemTime); + __declspec(dllimport) int WINAPI + SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, + FILETIME_* lpFileTime); + #if AUTOBOOST_PLAT_WINDOWS_DESKTOP + __declspec(dllimport) DWORD_ WINAPI + GetTickCount(); + #endif + #if AUTOBOOST_USE_WINAPI_VERSION >= AUTOBOOST_WINAPI_VERSION_WIN6 + __declspec(dllimport) ULONGLONG_ WINAPI + GetTickCount64(); + #endif +} + +#endif + +#ifndef AUTOBOOST_HAS_GETSYSTEMTIMEASFILETIME +inline void WINAPI GetSystemTimeAsFileTime(FILETIME_* lpFileTime) +{ + SYSTEMTIME_ st; + GetSystemTime(&st); + SystemTimeToFileTime(&st, lpFileTime); +} +#endif + +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_TIME_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/timers.hpp b/contrib/autoboost/autoboost/detail/winapi/timers.hpp new file mode 100644 index 000000000..638ef6fab --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/timers.hpp @@ -0,0 +1,44 @@ +// timers.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_TIMERS_HPP +#define AUTOBOOST_DETAIL_WINAPI_TIMERS_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + using ::QueryPerformanceCounter; + using ::QueryPerformanceFrequency; +#else +extern "C" { + __declspec(dllimport) BOOL_ WINAPI + QueryPerformanceCounter( + LARGE_INTEGER_ *lpPerformanceCount + ); + + __declspec(dllimport) BOOL_ WINAPI + QueryPerformanceFrequency( + LARGE_INTEGER_ *lpFrequency + ); +} +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_TIMERS_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/tls.hpp b/contrib/autoboost/autoboost/detail/winapi/tls.hpp new file mode 100644 index 000000000..b09b1a06a --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/tls.hpp @@ -0,0 +1,49 @@ +// tls.hpp --------------------------------------------------------------// + +// Copyright 2013 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_TLS_HPP +#define AUTOBOOST_DETAIL_WINAPI_TLS_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + +using ::TlsAlloc; +using ::TlsGetValue; +using ::TlsSetValue; +using ::TlsFree; + +const DWORD_ tls_out_of_indexes = TLS_OUT_OF_INDEXES; + +#else + +extern "C" { +__declspec(dllimport) DWORD_ WINAPI TlsAlloc(void); +__declspec(dllimport) LPVOID_ WINAPI TlsGetValue(DWORD_ dwTlsIndex); +__declspec(dllimport) BOOL_ WINAPI TlsSetValue(DWORD_ dwTlsIndex, LPVOID_ lpTlsValue); +__declspec(dllimport) BOOL_ WINAPI TlsFree(DWORD_ dwTlsIndex); +} + +const DWORD_ tls_out_of_indexes = 0xFFFFFFFF; + +#endif +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_TLS_HPP diff --git a/contrib/autoboost/autoboost/detail/winapi/waitable_timer.hpp b/contrib/autoboost/autoboost/detail/winapi/waitable_timer.hpp new file mode 100644 index 000000000..725070448 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/winapi/waitable_timer.hpp @@ -0,0 +1,110 @@ +// waitable_timer.hpp --------------------------------------------------------------// + +// Copyright 2013 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef AUTOBOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP +#define AUTOBOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP + +#include + +#ifdef AUTOBOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace autoboost +{ +namespace detail +{ +namespace winapi +{ +#if defined( AUTOBOOST_USE_WINDOWS_H ) + +typedef ::PTIMERAPCROUTINE PTIMERAPCROUTINE_; + +# ifdef AUTOBOOST_NO_ANSI_APIS +using ::CreateWaitableTimerW; +using ::OpenWaitableTimerW; +# else +using ::CreateWaitableTimerA; +using ::OpenWaitableTimerA; +# endif +using ::SetWaitableTimer; +using ::CancelWaitableTimer; + +#else + +extern "C" { + +struct _SECURITY_ATTRIBUTES; + +typedef void (WINAPI* PTIMERAPCROUTINE_) +( + LPVOID_ lpArgToCompletionRoutine, + DWORD_ dwTimerLowValue, + DWORD_ dwTimerHighValue +); + +# ifdef AUTOBOOST_NO_ANSI_APIS +__declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerW +( + _SECURITY_ATTRIBUTES* lpTimerAttributes, + BOOL_ bManualReset, + LPCWSTR_ lpTimerName +); + +__declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerW +( + DWORD_ dwDesiredAccess, + BOOL_ bInheritHandle, + LPCWSTR_ lpTimerName +); +# else +__declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerA +( + _SECURITY_ATTRIBUTES* lpTimerAttributes, + BOOL_ bManualReset, + LPCSTR_ lpTimerName +); + +__declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerA +( + DWORD_ dwDesiredAccess, + BOOL_ bInheritHandle, + LPCSTR_ lpTimerName +); +# endif + +__declspec(dllimport) BOOL_ WINAPI SetWaitableTimer +( + HANDLE_ hTimer, + const LARGE_INTEGER_ *lpDueTime, + LONG_ lPeriod, + PTIMERAPCROUTINE_ pfnCompletionRoutine, + LPVOID_ lpArgToCompletionRoutine, + BOOL_ fResume +); + +__declspec(dllimport) BOOL_ WINAPI CancelWaitableTimer(HANDLE_ hTimer); + +} + +#endif + +AUTOBOOST_FORCEINLINE HANDLE_ create_anonymous_waitable_timer(_SECURITY_ATTRIBUTES* lpTimerAttributes, BOOL_ bManualReset) +{ +#ifdef AUTOBOOST_NO_ANSI_APIS + return CreateWaitableTimerW(lpTimerAttributes, bManualReset, 0); +#else + return CreateWaitableTimerA(lpTimerAttributes, bManualReset, 0); +#endif +} + +} +} +} + +#endif // AUTOBOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP diff --git a/contrib/autoboost/autoboost/detail/workaround.hpp b/contrib/autoboost/autoboost/detail/workaround.hpp new file mode 100644 index 000000000..4a485d498 --- /dev/null +++ b/contrib/autoboost/autoboost/detail/workaround.hpp @@ -0,0 +1,267 @@ +// Copyright David Abrahams 2002. +// 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) +#ifndef AB_WORKAROUND_DWA2002126_HPP +# define AB_WORKAROUND_DWA2002126_HPP + +// Compiler/library version workaround macro +// +// Usage: +// +// #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, < 1300) +// // workaround for eVC4 and VC6 +// ... // workaround code here +// #endif +// +// When AUTOBOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the +// first argument must be undefined or expand to a numeric +// value. The above expands to: +// +// (AUTOBOOST_MSVC) != 0 && (AUTOBOOST_MSVC) < 1300 +// +// When used for workarounds that apply to the latest known version +// and all earlier versions of a compiler, the following convention +// should be observed: +// +// #if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, AUTOBOOST_TESTED_AT(1301)) +// +// The version number in this case corresponds to the last version in +// which the workaround was known to have been required. When +// AUTOBOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro +// AUTOBOOST_TESTED_AT(x) expands to "!= 0", which effectively activates +// the workaround for any version of the compiler. When +// AUTOBOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or +// error will be issued if the compiler version exceeds the argument +// to AUTOBOOST_TESTED_AT(). This can be used to locate workarounds which +// may be obsoleted by newer versions. + +# ifndef AUTOBOOST_STRICT_CONFIG + +#include + +#ifndef __BORLANDC__ +#define __BORLANDC___WORKAROUND_GUARD 1 +#else +#define __BORLANDC___WORKAROUND_GUARD 0 +#endif +#ifndef __CODEGEARC__ +#define __CODEGEARC___WORKAROUND_GUARD 1 +#else +#define __CODEGEARC___WORKAROUND_GUARD 0 +#endif +#ifndef _MSC_VER +#define _MSC_VER_WORKAROUND_GUARD 1 +#else +#define _MSC_VER_WORKAROUND_GUARD 0 +#endif +#ifndef _MSC_FULL_VER +#define _MSC_FULL_VER_WORKAROUND_GUARD 1 +#else +#define _MSC_FULL_VER_WORKAROUND_GUARD 0 +#endif +#ifndef AUTOBOOST_MSVC +#define AUTOBOOST_MSVC_WORKAROUND_GUARD 1 +#else +#define AUTOBOOST_MSVC_WORKAROUND_GUARD 0 +#endif +#ifndef AUTOBOOST_MSVC_FULL_VER +#define AUTOBOOST_MSVC_FULL_VER_WORKAROUND_GUARD 1 +#else +#define AUTOBOOST_MSVC_FULL_VER_WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC__ +#define __GNUC___WORKAROUND_GUARD 1 +#else +#define __GNUC___WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC_MINOR__ +#define __GNUC_MINOR___WORKAROUND_GUARD 1 +#else +#define __GNUC_MINOR___WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC_PATCHLEVEL__ +#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 1 +#else +#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 0 +#endif +#ifndef __IBMCPP__ +#define __IBMCPP___WORKAROUND_GUARD 1 +#else +#define __IBMCPP___WORKAROUND_GUARD 0 +#endif +#ifndef __SUNPRO_CC +#define __SUNPRO_CC_WORKAROUND_GUARD 1 +#else +#define __SUNPRO_CC_WORKAROUND_GUARD 0 +#endif +#ifndef __DECCXX_VER +#define __DECCXX_VER_WORKAROUND_GUARD 1 +#else +#define __DECCXX_VER_WORKAROUND_GUARD 0 +#endif +#ifndef __MWERKS__ +#define __MWERKS___WORKAROUND_GUARD 1 +#else +#define __MWERKS___WORKAROUND_GUARD 0 +#endif +#ifndef __EDG__ +#define __EDG___WORKAROUND_GUARD 1 +#else +#define __EDG___WORKAROUND_GUARD 0 +#endif +#ifndef __EDG_VERSION__ +#define __EDG_VERSION___WORKAROUND_GUARD 1 +#else +#define __EDG_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef __HP_aCC +#define __HP_aCC_WORKAROUND_GUARD 1 +#else +#define __HP_aCC_WORKAROUND_GUARD 0 +#endif +#ifndef __hpxstd98 +#define __hpxstd98_WORKAROUND_GUARD 1 +#else +#define __hpxstd98_WORKAROUND_GUARD 0 +#endif +#ifndef _CRAYC +#define _CRAYC_WORKAROUND_GUARD 1 +#else +#define _CRAYC_WORKAROUND_GUARD 0 +#endif +#ifndef __DMC__ +#define __DMC___WORKAROUND_GUARD 1 +#else +#define __DMC___WORKAROUND_GUARD 0 +#endif +#ifndef MPW_CPLUS +#define MPW_CPLUS_WORKAROUND_GUARD 1 +#else +#define MPW_CPLUS_WORKAROUND_GUARD 0 +#endif +#ifndef __COMO__ +#define __COMO___WORKAROUND_GUARD 1 +#else +#define __COMO___WORKAROUND_GUARD 0 +#endif +#ifndef __COMO_VERSION__ +#define __COMO_VERSION___WORKAROUND_GUARD 1 +#else +#define __COMO_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef __INTEL_COMPILER +#define __INTEL_COMPILER_WORKAROUND_GUARD 1 +#else +#define __INTEL_COMPILER_WORKAROUND_GUARD 0 +#endif +#ifndef __ICL +#define __ICL_WORKAROUND_GUARD 1 +#else +#define __ICL_WORKAROUND_GUARD 0 +#endif +#ifndef _COMPILER_VERSION +#define _COMPILER_VERSION_WORKAROUND_GUARD 1 +#else +#define _COMPILER_VERSION_WORKAROUND_GUARD 0 +#endif + +#ifndef _RWSTD_VER +#define _RWSTD_VER_WORKAROUND_GUARD 1 +#else +#define _RWSTD_VER_WORKAROUND_GUARD 0 +#endif +#ifndef AUTOBOOST_RWSTD_VER +#define AUTOBOOST_RWSTD_VER_WORKAROUND_GUARD 1 +#else +#define AUTOBOOST_RWSTD_VER_WORKAROUND_GUARD 0 +#endif +#ifndef __GLIBCPP__ +#define __GLIBCPP___WORKAROUND_GUARD 1 +#else +#define __GLIBCPP___WORKAROUND_GUARD 0 +#endif +#ifndef _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC +#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 1 +#else +#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 0 +#endif +#ifndef __SGI_STL_PORT +#define __SGI_STL_PORT_WORKAROUND_GUARD 1 +#else +#define __SGI_STL_PORT_WORKAROUND_GUARD 0 +#endif +#ifndef _STLPORT_VERSION +#define _STLPORT_VERSION_WORKAROUND_GUARD 1 +#else +#define _STLPORT_VERSION_WORKAROUND_GUARD 0 +#endif +#ifndef __LIBCOMO_VERSION__ +#define __LIBCOMO_VERSION___WORKAROUND_GUARD 1 +#else +#define __LIBCOMO_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef _CPPLIB_VER +#define _CPPLIB_VER_WORKAROUND_GUARD 1 +#else +#define _CPPLIB_VER_WORKAROUND_GUARD 0 +#endif + +#ifndef AUTOBOOST_INTEL_CXX_VERSION +#define AUTOBOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 1 +#else +#define AUTOBOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 0 +#endif +#ifndef AUTOBOOST_INTEL_WIN +#define AUTOBOOST_INTEL_WIN_WORKAROUND_GUARD 1 +#else +#define AUTOBOOST_INTEL_WIN_WORKAROUND_GUARD 0 +#endif +#ifndef AUTOBOOST_DINKUMWARE_STDLIB +#define AUTOBOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 1 +#else +#define AUTOBOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 0 +#endif +#ifndef AUTOBOOST_INTEL +#define AUTOBOOST_INTEL_WORKAROUND_GUARD 1 +#else +#define AUTOBOOST_INTEL_WORKAROUND_GUARD 0 +#endif +// Always define to zero, if it's used it'll be defined my MPL: +#define AUTOBOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0 + +# define AUTOBOOST_WORKAROUND(symbol, test) \ + ((symbol ## _WORKAROUND_GUARD + 0 == 0) && \ + (symbol != 0) && (1 % (( (symbol test) ) + 1))) +// ^ ^ ^ ^ +// The extra level of parenthesis nesting above, along with the +// AUTOBOOST_OPEN_PAREN indirection below, is required to satisfy the +// broken preprocessor in MWCW 8.3 and earlier. +// +// The basic mechanism works as follows: +// (symbol test) + 1 => if (symbol test) then 2 else 1 +// 1 % ((symbol test) + 1) => if (symbol test) then 1 else 0 +// +// The complication with % is for cooperation with AUTOBOOST_TESTED_AT(). +// When "test" is AUTOBOOST_TESTED_AT(x) and +// AUTOBOOST_DETECT_OUTDATED_WORKAROUNDS is #defined, +// +// symbol test => if (symbol <= x) then 1 else -1 +// (symbol test) + 1 => if (symbol <= x) then 2 else 0 +// 1 % ((symbol test) + 1) => if (symbol <= x) then 1 else divide-by-zero +// + +# ifdef AUTOBOOST_DETECT_OUTDATED_WORKAROUNDS +# define AUTOBOOST_OPEN_PAREN ( +# define AUTOBOOST_TESTED_AT(value) > value) ?(-1): AUTOBOOST_OPEN_PAREN 1 +# else +# define AUTOBOOST_TESTED_AT(value) != ((value)-(value)) +# endif + +# else + +# define AUTOBOOST_WORKAROUND(symbol, test) 0 + +# endif + +#endif // WORKAROUND_DWA2002126_HPP diff --git a/contrib/autoboost/autoboost/enable_shared_from_this.hpp b/contrib/autoboost/autoboost/enable_shared_from_this.hpp new file mode 100644 index 000000000..1ee5a8a76 --- /dev/null +++ b/contrib/autoboost/autoboost/enable_shared_from_this.hpp @@ -0,0 +1,18 @@ +#ifndef AUTOBOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED +#define AUTOBOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED + +// +// enable_shared_from_this.hpp +// +// Copyright (c) 2002 Peter Dimov +// +// 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 +// +// http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html +// + +#include + +#endif // #ifndef AUTOBOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/exception/current_exception_cast.hpp b/contrib/autoboost/autoboost/exception/current_exception_cast.hpp new file mode 100644 index 000000000..0dcf9a385 --- /dev/null +++ b/contrib/autoboost/autoboost/exception/current_exception_cast.hpp @@ -0,0 +1,43 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#ifndef AB_UUID_7E83C166200811DE885E826156D89593 +#define AB_UUID_7E83C166200811DE885E826156D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +namespace +autoboost + { + template + inline + E * + current_exception_cast() + { + try + { + throw; + } + catch( + E & e ) + { + return &e; + } + catch( + ...) + { + return 0; + } + } + } + +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/contrib/autoboost/autoboost/exception/detail/clone_current_exception.hpp b/contrib/autoboost/autoboost/exception/detail/clone_current_exception.hpp new file mode 100644 index 000000000..bc1c3e563 --- /dev/null +++ b/contrib/autoboost/autoboost/exception/detail/clone_current_exception.hpp @@ -0,0 +1,56 @@ +//Copyright (c) 2006-2013 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#ifndef AB_UUID_81522C0EB56511DFAB613DB0DFD72085 +#define AB_UUID_81522C0EB56511DFAB613DB0DFD72085 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#ifdef AUTOBOOST_NO_EXCEPTIONS +# error This header requires exception handling to be enabled. +#endif + +namespace +autoboost + { + namespace + exception_detail + { + class clone_base; + +#ifdef AUTOBOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR + int clone_current_exception_non_intrusive( clone_base const * & cloned ); +#endif + + namespace + clone_current_exception_result + { + int const success=0; + int const bad_alloc=1; + int const bad_exception=2; + int const not_supported=3; + } + + inline + int + clone_current_exception( clone_base const * & cloned ) + { +#ifdef AUTOBOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR + return clone_current_exception_non_intrusive(cloned); +#else + return clone_current_exception_result::not_supported; +#endif + } + } + } + +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/contrib/autoboost/boost/exception/detail/error_info_impl.hpp b/contrib/autoboost/autoboost/exception/detail/error_info_impl.hpp similarity index 79% rename from contrib/autoboost/boost/exception/detail/error_info_impl.hpp rename to contrib/autoboost/autoboost/exception/detail/error_info_impl.hpp index e3b0c328b..43eefde78 100644 --- a/contrib/autoboost/boost/exception/detail/error_info_impl.hpp +++ b/contrib/autoboost/autoboost/exception/detail/error_info_impl.hpp @@ -3,12 +3,12 @@ //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) -#ifndef UUID_CE6983AC753411DDA764247956D89593 -#define UUID_CE6983AC753411DDA764247956D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#ifndef AB_UUID_CE6983AC753411DDA764247956D89593 +#define AB_UUID_CE6983AC753411DDA764247956D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif @@ -68,7 +68,7 @@ autoboost }; } -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif diff --git a/contrib/autoboost/autoboost/exception/detail/exception_ptr.hpp b/contrib/autoboost/autoboost/exception/detail/exception_ptr.hpp new file mode 100644 index 000000000..cf86d9ae3 --- /dev/null +++ b/contrib/autoboost/autoboost/exception/detail/exception_ptr.hpp @@ -0,0 +1,513 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#ifndef AB_UUID_618474C2DE1511DEB74A388C56D89593 +#define AB_UUID_618474C2DE1511DEB74A388C56D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include +#ifdef AUTOBOOST_NO_EXCEPTIONS +#error This header requires exception handling to be enabled. +#endif +#include +#include +#include +#include +#include +#ifndef AUTOBOOST_NO_RTTI +#include +#endif +#include +#include +#include +#include +#include + +namespace +autoboost + { + class exception_ptr; + AUTOBOOST_NORETURN void rethrow_exception( exception_ptr const & ); + exception_ptr current_exception(); + + class + exception_ptr + { + typedef autoboost::shared_ptr impl; + impl ptr_; + friend void rethrow_exception( exception_ptr const & ); + typedef exception_detail::clone_base const * (impl::*unspecified_bool_type)() const; + public: + exception_ptr() + { + } + explicit + exception_ptr( impl const & ptr ): + ptr_(ptr) + { + } + bool + operator==( exception_ptr const & other ) const + { + return ptr_==other.ptr_; + } + bool + operator!=( exception_ptr const & other ) const + { + return ptr_!=other.ptr_; + } + operator unspecified_bool_type() const + { + return ptr_?&impl::get:0; + } + }; + + template + inline + exception_ptr + copy_exception( T const & e ) + { + try + { + throw enable_current_exception(e); + } + catch( + ... ) + { + return current_exception(); + } + } + +#ifndef AUTOBOOST_NO_RTTI + typedef error_info original_exception_type; + + inline + std::string + to_string( original_exception_type const & x ) + { + return core::demangle(x.value()->name()); + } +#endif + + namespace + exception_detail + { + struct + bad_alloc_: + autoboost::exception, + std::bad_alloc + { + ~bad_alloc_() throw() { } + }; + + struct + bad_exception_: + autoboost::exception, + std::bad_exception + { + ~bad_exception_() throw() { } + }; + + template + exception_ptr + get_static_exception_object() + { + Exception ba; + exception_detail::clone_impl c(ba); +#ifndef AUTOBOOST_EXCEPTION_DISABLE + c << + throw_function(AUTOBOOST_CURRENT_FUNCTION) << + throw_file(__FILE__) << + throw_line(__LINE__); +#endif + static exception_ptr ep(shared_ptr(new exception_detail::clone_impl(c))); + return ep; + } + + template + struct + exception_ptr_static_exception_object + { + static exception_ptr const e; + }; + + template + exception_ptr const + exception_ptr_static_exception_object:: + e = get_static_exception_object(); + } + +#if defined(__GNUC__) +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# pragma GCC visibility push (default) +# endif +#endif + class + unknown_exception: + public autoboost::exception, + public std::exception + { + public: + + unknown_exception() + { + } + + explicit + unknown_exception( std::exception const & e ) + { + add_original_type(e); + } + + explicit + unknown_exception( autoboost::exception const & e ): + autoboost::exception(e) + { + add_original_type(e); + } + + ~unknown_exception() throw() + { + } + + private: + + template + void + add_original_type( E const & e ) + { +#ifndef AUTOBOOST_NO_RTTI + (*this) << original_exception_type(&typeid(e)); +#endif + } + }; +#if defined(__GNUC__) +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# pragma GCC visibility pop +# endif +#endif + + namespace + exception_detail + { + template + class + current_exception_std_exception_wrapper: + public T, + public autoboost::exception + { + public: + + explicit + current_exception_std_exception_wrapper( T const & e1 ): + T(e1) + { + add_original_type(e1); + } + + current_exception_std_exception_wrapper( T const & e1, autoboost::exception const & e2 ): + T(e1), + autoboost::exception(e2) + { + add_original_type(e1); + } + + ~current_exception_std_exception_wrapper() throw() + { + } + + private: + + template + void + add_original_type( E const & e ) + { +#ifndef AUTOBOOST_NO_RTTI + (*this) << original_exception_type(&typeid(e)); +#endif + } + }; + +#ifdef AUTOBOOST_NO_RTTI + template + autoboost::exception const * + get_boost_exception( T const * ) + { + try + { + throw; + } + catch( + autoboost::exception & x ) + { + return &x; + } + catch(...) + { + return 0; + } + } +#else + template + autoboost::exception const * + get_boost_exception( T const * x ) + { + return dynamic_cast(x); + } +#endif + + template + inline + exception_ptr + current_exception_std_exception( T const & e1 ) + { + if( autoboost::exception const * e2 = get_boost_exception(&e1) ) + return autoboost::copy_exception(current_exception_std_exception_wrapper(e1,*e2)); + else + return autoboost::copy_exception(current_exception_std_exception_wrapper(e1)); + } + + inline + exception_ptr + current_exception_unknown_exception() + { + return autoboost::copy_exception(unknown_exception()); + } + + inline + exception_ptr + current_exception_unknown_boost_exception( autoboost::exception const & e ) + { + return autoboost::copy_exception(unknown_exception(e)); + } + + inline + exception_ptr + current_exception_unknown_std_exception( std::exception const & e ) + { + if( autoboost::exception const * be = get_boost_exception(&e) ) + return current_exception_unknown_boost_exception(*be); + else + return autoboost::copy_exception(unknown_exception(e)); + } + + inline + exception_ptr + current_exception_impl() + { + exception_detail::clone_base const * e=0; + switch( + exception_detail::clone_current_exception(e) ) + { + case exception_detail::clone_current_exception_result:: + success: + { + AUTOBOOST_ASSERT(e!=0); + return exception_ptr(shared_ptr(e)); + } + case exception_detail::clone_current_exception_result:: + bad_alloc: + { + AUTOBOOST_ASSERT(!e); + return exception_detail::exception_ptr_static_exception_object::e; + } + case exception_detail::clone_current_exception_result:: + bad_exception: + { + AUTOBOOST_ASSERT(!e); + return exception_detail::exception_ptr_static_exception_object::e; + } + default: + AUTOBOOST_ASSERT(0); + case exception_detail::clone_current_exception_result:: + not_supported: + { + AUTOBOOST_ASSERT(!e); + try + { + throw; + } + catch( + exception_detail::clone_base & e ) + { + return exception_ptr(shared_ptr(e.clone())); + } + catch( + std::domain_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::invalid_argument & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::length_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::out_of_range & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::logic_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::range_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::overflow_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::underflow_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::ios_base::failure & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::runtime_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::bad_alloc & e ) + { + return exception_detail::current_exception_std_exception(e); + } +#ifndef AUTOBOOST_NO_TYPEID + catch( + std::bad_cast & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::bad_typeid & e ) + { + return exception_detail::current_exception_std_exception(e); + } +#endif + catch( + std::bad_exception & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::exception & e ) + { + return exception_detail::current_exception_unknown_std_exception(e); + } + catch( + autoboost::exception & e ) + { + return exception_detail::current_exception_unknown_boost_exception(e); + } + catch( + ... ) + { + return exception_detail::current_exception_unknown_exception(); + } + } + } + } + } + + inline + exception_ptr + current_exception() + { + exception_ptr ret; + try + { + ret=exception_detail::current_exception_impl(); + } + catch( + std::bad_alloc & ) + { + ret=exception_detail::exception_ptr_static_exception_object::e; + } + catch( + ... ) + { + ret=exception_detail::exception_ptr_static_exception_object::e; + } + AUTOBOOST_ASSERT(ret); + return ret; + } + + AUTOBOOST_NORETURN + inline + void + rethrow_exception( exception_ptr const & p ) + { + AUTOBOOST_ASSERT(p); + p.ptr_->rethrow(); + AUTOBOOST_ASSERT(0); + #if defined(UNDER_CE) + // some CE platforms don't define ::abort() + exit(-1); + #else + abort(); + #endif + } + + inline + std::string + diagnostic_information( exception_ptr const & p, bool verbose=true ) + { + if( p ) + try + { + rethrow_exception(p); + } + catch( + ... ) + { + return current_exception_diagnostic_information(verbose); + } + return ""; + } + + inline + std::string + to_string( exception_ptr const & p ) + { + std::string s='\n'+diagnostic_information(p); + std::string padding(" "); + std::string r; + bool f=false; + for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i ) + { + if( f ) + r+=padding; + char c=*i; + r+=c; + f=(c=='\n'); + } + return r; + } + } + +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/contrib/autoboost/boost/exception/detail/is_output_streamable.hpp b/contrib/autoboost/autoboost/exception/detail/is_output_streamable.hpp similarity index 80% rename from contrib/autoboost/boost/exception/detail/is_output_streamable.hpp rename to contrib/autoboost/autoboost/exception/detail/is_output_streamable.hpp index e7f2780f5..040abf241 100644 --- a/contrib/autoboost/boost/exception/detail/is_output_streamable.hpp +++ b/contrib/autoboost/autoboost/exception/detail/is_output_streamable.hpp @@ -3,12 +3,12 @@ //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) -#ifndef UUID_898984B4076411DD973EDFA055D89593 -#define UUID_898984B4076411DD973EDFA055D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#ifndef AB_UUID_898984B4076411DD973EDFA055D89593 +#define AB_UUID_898984B4076411DD973EDFA055D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif @@ -54,7 +54,7 @@ autoboost }; } -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif diff --git a/contrib/autoboost/boost/exception/detail/object_hex_dump.hpp b/contrib/autoboost/autoboost/exception/detail/object_hex_dump.hpp similarity index 75% rename from contrib/autoboost/boost/exception/detail/object_hex_dump.hpp rename to contrib/autoboost/autoboost/exception/detail/object_hex_dump.hpp index 1ffd734e7..021a5be1f 100644 --- a/contrib/autoboost/boost/exception/detail/object_hex_dump.hpp +++ b/contrib/autoboost/autoboost/exception/detail/object_hex_dump.hpp @@ -3,16 +3,16 @@ //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) -#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593 -#define UUID_6F463AC838DF11DDA3E6909F56D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#ifndef AB_UUID_6F463AC838DF11DDA3E6909F56D89593 +#define AB_UUID_6F463AC838DF11DDA3E6909F56D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif -#include +#include #include #include #include @@ -44,7 +44,7 @@ autoboost } } -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif diff --git a/contrib/autoboost/autoboost/exception/detail/type_info.hpp b/contrib/autoboost/autoboost/exception/detail/type_info.hpp new file mode 100644 index 000000000..d6f8581e3 --- /dev/null +++ b/contrib/autoboost/autoboost/exception/detail/type_info.hpp @@ -0,0 +1,81 @@ +//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#ifndef AB_UUID_C3E1741C754311DDB2834CCA55D89593 +#define AB_UUID_C3E1741C754311DDB2834CCA55D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include +#include +#include +#include +#include + +namespace +autoboost + { + template + inline + std::string + tag_type_name() + { +#ifdef AUTOBOOST_NO_TYPEID + return AUTOBOOST_CURRENT_FUNCTION; +#else + return core::demangle(typeid(T*).name()); +#endif + } + + template + inline + std::string + type_name() + { +#ifdef AUTOBOOST_NO_TYPEID + return AUTOBOOST_CURRENT_FUNCTION; +#else + return core::demangle(typeid(T).name()); +#endif + } + + namespace + exception_detail + { + struct + type_info_ + { + core::typeinfo const * type_; + + explicit + type_info_( core::typeinfo const & type ): + type_(&type) + { + } + + friend + bool + operator<( type_info_ const & a, type_info_ const & b ) + { + return 0!=(a.type_->before(*b.type_)); + } + }; + } + } + +#define AUTOBOOST_EXCEPTION_STATIC_TYPEID(T) ::autoboost::exception_detail::type_info_(AUTOBOOST_CORE_TYPEID(T)) + +#ifndef AUTOBOOST_NO_RTTI +#define AUTOBOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::autoboost::exception_detail::type_info_(typeid(x)) +#endif + +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/contrib/autoboost/boost/exception/diagnostic_information.hpp b/contrib/autoboost/autoboost/exception/diagnostic_information.hpp similarity index 83% rename from contrib/autoboost/boost/exception/diagnostic_information.hpp rename to contrib/autoboost/autoboost/exception/diagnostic_information.hpp index 7427060a0..5f47068e0 100644 --- a/contrib/autoboost/boost/exception/diagnostic_information.hpp +++ b/contrib/autoboost/autoboost/exception/diagnostic_information.hpp @@ -3,28 +3,28 @@ //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) -#ifndef UUID_0552D49838DD11DD90146B8956D89593 -#define UUID_0552D49838DD11DD90146B8956D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#ifndef AB_UUID_0552D49838DD11DD90146B8956D89593 +#define AB_UUID_0552D49838DD11DD90146B8956D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif -#include -#include -#include -#include -#ifndef BOOST_NO_RTTI -#include +#include +#include +#include +#include +#ifndef AUTOBOOST_NO_RTTI +#include #endif #include #include #include -#ifndef BOOST_NO_EXCEPTIONS -#include +#ifndef AUTOBOOST_NO_EXCEPTIONS +#include namespace autoboost { @@ -86,7 +86,7 @@ autoboost char const * get_diagnostic_information( exception const & x, char const * header ) { -#ifndef BOOST_NO_EXCEPTIONS +#ifndef AUTOBOOST_NO_EXCEPTIONS try { #endif @@ -94,9 +94,9 @@ autoboost if( !c ) x.data_.adopt(c=new exception_detail::error_info_container_impl); char const * di=c->diagnostic_information(header); - BOOST_ASSERT(di!=0); + AUTOBOOST_ASSERT(di!=0); return di; -#ifndef BOOST_NO_EXCEPTIONS +#ifndef AUTOBOOST_NO_EXCEPTIONS } catch(...) { @@ -111,7 +111,7 @@ autoboost { if( !be && !se ) return "Unknown exception."; -#ifndef BOOST_NO_RTTI +#ifndef AUTOBOOST_NO_RTTI if( !be ) be=dynamic_cast(se); if( !se ) @@ -131,7 +131,7 @@ autoboost int const * l=get_error_info(*be); char const * const * fn=get_error_info(*be); if( !f && !l && !fn ) - tmp << "Throw location unknown (consider using BOOST_THROW_EXCEPTION)\n"; + tmp << "Throw location unknown (consider using AUTOBOOST_THROW_EXCEPTION)\n"; else { if( f ) @@ -148,10 +148,10 @@ autoboost tmp << '\n'; } } -#ifndef BOOST_NO_RTTI +#ifndef AUTOBOOST_NO_RTTI if ( verbose ) tmp << std::string("Dynamic exception type: ") << - core::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n'; + core::demangle((be?(AUTOBOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(AUTOBOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n'; #endif if( with_what && se && verbose ) tmp << "std::exception::what: " << wh << '\n'; @@ -175,7 +175,7 @@ autoboost diagnostic_information_what( exception const & e, bool verbose=true ) throw() { char const * w=0; -#ifndef BOOST_NO_EXCEPTIONS +#ifndef AUTOBOOST_NO_EXCEPTIONS try { #endif @@ -184,7 +184,7 @@ autoboost return di; else return "Failed to produce autoboost::diagnostic_information_what()"; -#ifndef BOOST_NO_EXCEPTIONS +#ifndef AUTOBOOST_NO_EXCEPTIONS } catch( ... ) @@ -195,7 +195,7 @@ autoboost } } -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif diff --git a/contrib/autoboost/boost/exception/exception.hpp b/contrib/autoboost/autoboost/exception/exception.hpp similarity index 97% rename from contrib/autoboost/boost/exception/exception.hpp rename to contrib/autoboost/autoboost/exception/exception.hpp index 896be6f2d..0df2b83a5 100644 --- a/contrib/autoboost/boost/exception/exception.hpp +++ b/contrib/autoboost/autoboost/exception/exception.hpp @@ -3,12 +3,12 @@ //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) -#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593 -#define UUID_274DA366004E11DCB1DDFE2E56D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#ifndef AB_UUID_274DA366004E11DCB1DDFE2E56D89593 +#define AB_UUID_274DA366004E11DCB1DDFE2E56D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif @@ -483,7 +483,7 @@ autoboost } } -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif diff --git a/contrib/autoboost/boost/exception/get_error_info.hpp b/contrib/autoboost/autoboost/exception/get_error_info.hpp similarity index 80% rename from contrib/autoboost/boost/exception/get_error_info.hpp rename to contrib/autoboost/autoboost/exception/get_error_info.hpp index 62d00e91d..60b033915 100644 --- a/contrib/autoboost/boost/exception/get_error_info.hpp +++ b/contrib/autoboost/autoboost/exception/get_error_info.hpp @@ -3,19 +3,19 @@ //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) -#ifndef UUID_1A590226753311DD9E4CCF6156D89593 -#define UUID_1A590226753311DD9E4CCF6156D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#ifndef AB_UUID_1A590226753311DD9E4CCF6156D89593 +#define AB_UUID_1A590226753311DD9E4CCF6156D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost @@ -32,10 +32,10 @@ autoboost get( exception const & x ) { if( exception_detail::error_info_container * c=x.data_.get() ) - if( shared_ptr eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) ) + if( shared_ptr eib = c->get(AUTOBOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) ) { -#ifndef BOOST_NO_RTTI - BOOST_ASSERT( 0!=dynamic_cast(eib.get()) ); +#ifndef AUTOBOOST_NO_RTTI + AUTOBOOST_ASSERT( 0!=dynamic_cast(eib.get()) ); #endif ErrorInfo * w = static_cast(eib.get()); return &w->value(); @@ -95,7 +95,7 @@ autoboost }; } -#ifdef BOOST_NO_RTTI +#ifdef AUTOBOOST_NO_RTTI template inline typename ErrorInfo::value_type const * @@ -124,7 +124,7 @@ autoboost #endif } -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif diff --git a/contrib/autoboost/boost/exception/info.hpp b/contrib/autoboost/autoboost/exception/info.hpp similarity index 86% rename from contrib/autoboost/boost/exception/info.hpp rename to contrib/autoboost/autoboost/exception/info.hpp index 80f24fec9..8cdf18564 100644 --- a/contrib/autoboost/boost/exception/info.hpp +++ b/contrib/autoboost/autoboost/exception/info.hpp @@ -3,20 +3,20 @@ //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) -#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593 -#define UUID_8D22C4CA9CC811DCAA9133D256D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#ifndef AB_UUID_8D22C4CA9CC811DCAA9133D256D89593 +#define AB_UUID_8D22C4CA9CC811DCAA9133D256D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include namespace @@ -83,7 +83,7 @@ autoboost void set( shared_ptr const & x, type_info_ const & typeid_ ) { - BOOST_ASSERT(x); + AUTOBOOST_ASSERT(x); info_[typeid_] = x; diagnostic_info_str_.clear(); } @@ -95,8 +95,8 @@ autoboost if( info_.end()!=i ) { shared_ptr const & p = i->second; -#ifndef BOOST_NO_RTTI - BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ ); +#ifndef AUTOBOOST_NO_RTTI + AUTOBOOST_ASSERT( *AUTOBOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ ); #endif return p; } @@ -171,7 +171,7 @@ autoboost exception_detail::error_info_container * c=x.data_.get(); if( !c ) x.data_.adopt(c=new exception_detail::error_info_container_impl); - c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t)); + c->set(p,AUTOBOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t)); return x; } @@ -192,7 +192,7 @@ autoboost } } -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif diff --git a/contrib/autoboost/autoboost/exception/to_string.hpp b/contrib/autoboost/autoboost/exception/to_string.hpp new file mode 100644 index 000000000..1c0068662 --- /dev/null +++ b/contrib/autoboost/autoboost/exception/to_string.hpp @@ -0,0 +1,88 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#ifndef AB_UUID_7E48761AD92811DC9011477D56D89593 +#define AB_UUID_7E48761AD92811DC9011477D56D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include +#include +#include + +namespace +autoboost + { + template + std::string to_string( std::pair const & ); + std::string to_string( std::exception const & ); + + namespace + to_string_detail + { + template + typename disable_if,char>::type to_string( T const & ); + using autoboost::to_string; + + template + struct has_to_string_impl; + + template + struct + has_to_string_impl + { + enum e { value=1 }; + }; + + template + struct + has_to_string_impl + { + static T const & f(); + enum e { value=1!=sizeof(to_string(f())) }; + }; + } + + template + inline + typename enable_if,std::string>::type + to_string( T const & x ) + { + std::ostringstream out; + out << x; + return out.str(); + } + + template + struct + has_to_string + { + enum e { value=to_string_detail::has_to_string_impl::value>::value }; + }; + + template + inline + std::string + to_string( std::pair const & x ) + { + return std::string("(") + to_string(x.first) + ',' + to_string(x.second) + ')'; + } + + inline + std::string + to_string( std::exception const & x ) + { + return x.what(); + } + } + +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/contrib/autoboost/boost/exception/to_string_stub.hpp b/contrib/autoboost/autoboost/exception/to_string_stub.hpp similarity index 83% rename from contrib/autoboost/boost/exception/to_string_stub.hpp rename to contrib/autoboost/autoboost/exception/to_string_stub.hpp index 32aa4272d..83794cd2c 100644 --- a/contrib/autoboost/boost/exception/to_string_stub.hpp +++ b/contrib/autoboost/autoboost/exception/to_string_stub.hpp @@ -3,18 +3,18 @@ //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) -#ifndef UUID_E788439ED9F011DCB181F25B55D89593 -#define UUID_E788439ED9F011DCB181F25B55D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#ifndef AB_UUID_E788439ED9F011DCB181F25B55D89593 +#define AB_UUID_E788439ED9F011DCB181F25B55D89593 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif -#include -#include -#include +#include +#include +#include namespace autoboost @@ -60,7 +60,7 @@ autoboost std::string convert( T const & x, char const * s ) { - BOOST_ASSERT(s!=0); + AUTOBOOST_ASSERT(s!=0); return s; } }; @@ -111,7 +111,7 @@ autoboost } } -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if defined(_MSC_VER) && !defined(AUTOBOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif diff --git a/contrib/autoboost/autoboost/exception_ptr.hpp b/contrib/autoboost/autoboost/exception_ptr.hpp new file mode 100644 index 000000000..3a713f116 --- /dev/null +++ b/contrib/autoboost/autoboost/exception_ptr.hpp @@ -0,0 +1,11 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#ifndef AB_UUID_FA5836A2CADA11DC8CD47C8555D89593 +#define AB_UUID_FA5836A2CADA11DC8CD47C8555D89593 + +#include + +#endif diff --git a/contrib/autoboost/autoboost/format.hpp b/contrib/autoboost/autoboost/format.hpp new file mode 100644 index 000000000..3fa46bfa4 --- /dev/null +++ b/contrib/autoboost/autoboost/format.hpp @@ -0,0 +1,59 @@ +// ---------------------------------------------------------------------------- +// format.hpp : primary header +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_HPP +#define AUTOBOOST_FORMAT_HPP + +#include +#include +#include +#include + +#ifndef AUTOBOOST_NO_STD_LOCALE +#include +#endif + +// *** Compatibility framework +#include + +#ifdef AUTOBOOST_NO_LOCALE_ISIDIGIT +#include // we'll use the non-locale 's std::isdigit(int) +#endif + +// **** Forward declarations ---------------------------------- +#include // basic_format, and other frontends +#include // misc forward declarations for internal use + +// **** Auxiliary structs (stream_format_state , and format_item ) +#include + +// **** Format class interface -------------------------------- +#include + +// **** Exceptions ----------------------------------------------- +#include + +// **** Implementation ------------------------------------------- +#include // member functions +#include // class for grouping arguments +#include // argument-feeding functions +#include // format-string parsing (member-)functions + +// **** Implementation of the free functions ---------------------- +#include + + +// *** Undefine 'local' macros : +#include + +#endif // AUTOBOOST_FORMAT_HPP diff --git a/contrib/autoboost/autoboost/format/alt_sstream.hpp b/contrib/autoboost/autoboost/format/alt_sstream.hpp new file mode 100644 index 000000000..656f07c19 --- /dev/null +++ b/contrib/autoboost/autoboost/format/alt_sstream.hpp @@ -0,0 +1,176 @@ +// ---------------------------------------------------------------------------- +// alt_sstream.hpp : alternative stringstream +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + + + +#ifndef AUTOBOOST_SK_ALT_SSTREAM_HPP +#define AUTOBOOST_SK_ALT_SSTREAM_HPP + +#include +#include +#include +#include +#include + +namespace autoboost { + namespace io { + + template, + class Alloc=::std::allocator > + class basic_altstringbuf; + + template, + class Alloc=::std::allocator > + class basic_oaltstringstream; + + + template + class basic_altstringbuf + : public ::std::basic_streambuf + { + typedef ::std::basic_streambuf streambuf_t; + typedef typename CompatAlloc::compatible_type compat_allocator_type; + typedef typename CompatTraits::compatible_type compat_traits_type; + public: + typedef Ch char_type; + typedef Tr traits_type; + typedef typename compat_traits_type::int_type int_type; + typedef typename compat_traits_type::pos_type pos_type; + typedef typename compat_traits_type::off_type off_type; + typedef Alloc allocator_type; + typedef ::std::basic_string string_type; + typedef typename string_type::size_type size_type; + + typedef ::std::streamsize streamsize; + + + explicit basic_altstringbuf(std::ios_base::openmode mode + = std::ios_base::in | std::ios_base::out) + : putend_(NULL), is_allocated_(false), mode_(mode) + {} + explicit basic_altstringbuf(const string_type& s, + ::std::ios_base::openmode mode + = ::std::ios_base::in | ::std::ios_base::out) + : putend_(NULL), is_allocated_(false), mode_(mode) + { dealloc(); str(s); } + virtual ~basic_altstringbuf() + { dealloc(); } + using streambuf_t::pbase; + using streambuf_t::pptr; + using streambuf_t::epptr; + using streambuf_t::eback; + using streambuf_t::gptr; + using streambuf_t::egptr; + + void clear_buffer(); + void str(const string_type& s); + + // 0-copy access : + Ch * begin() const; + size_type size() const; + size_type cur_size() const; // stop at current pointer + Ch * pend() const // the highest position reached by pptr() since creation + { return ((putend_ < pptr()) ? pptr() : putend_); } + size_type pcount() const + { return static_cast( pptr() - pbase()) ;} + + // copy buffer to string : + string_type str() const + { return string_type(begin(), size()); } + string_type cur_str() const + { return string_type(begin(), cur_size()); } + protected: + explicit basic_altstringbuf (basic_altstringbuf * s, + ::std::ios_base::openmode mode + = ::std::ios_base::in | ::std::ios_base::out) + : putend_(NULL), is_allocated_(false), mode_(mode) + { dealloc(); str(s); } + + virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way, + ::std::ios_base::openmode which + = ::std::ios_base::in | ::std::ios_base::out); + virtual pos_type seekpos (pos_type pos, + ::std::ios_base::openmode which + = ::std::ios_base::in | ::std::ios_base::out); + virtual int_type underflow(); + virtual int_type pbackfail(int_type meta = compat_traits_type::eof()); + virtual int_type overflow(int_type meta = compat_traits_type::eof()); + void dealloc(); + private: + enum { alloc_min = 256}; // minimum size of allocations + + Ch *putend_; // remembers (over seeks) the highest value of pptr() + bool is_allocated_; + ::std::ios_base::openmode mode_; + compat_allocator_type alloc_; // the allocator object + }; + + +// --- class basic_oaltstringstream ---------------------------------------- + template + class basic_oaltstringstream + : private base_from_member< shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >, + public ::std::basic_ostream + { + class No_Op { + // used as no-op deleter for (not-owner) shared_pointers + public: + template + const T & operator()(const T & arg) { return arg; } + }; + typedef ::std::basic_ostream stream_t; + typedef autoboost::base_from_member > > + pbase_type; + typedef ::std::basic_string string_type; + typedef typename string_type::size_type size_type; + typedef basic_altstringbuf stringbuf_t; + public: + typedef Alloc allocator_type; + basic_oaltstringstream() + : pbase_type(new stringbuf_t), stream_t(rdbuf()) + { } + basic_oaltstringstream(::autoboost::shared_ptr buf) + : pbase_type(buf), stream_t(rdbuf()) + { } + basic_oaltstringstream(stringbuf_t * buf) + : pbase_type(buf, No_Op() ), stream_t(rdbuf()) + { } + stringbuf_t * rdbuf() const + { return pbase_type::member.get(); } + void clear_buffer() + { rdbuf()->clear_buffer(); } + + // 0-copy access : + Ch * begin() const + { return rdbuf()->begin(); } + size_type size() const + { return rdbuf()->size(); } + size_type cur_size() const // stops at current position + { return rdbuf()->cur_size(); } + + // copy buffer to string : + string_type str() const // [pbase, epptr[ + { return rdbuf()->str(); } + string_type cur_str() const // [pbase, pptr[ + { return rdbuf()->cur_str(); } + void str(const string_type& s) + { rdbuf()->str(s); } + }; + + } // N.S. io +} // N.S. boost + +#include + +#endif // include guard + diff --git a/contrib/autoboost/autoboost/format/alt_sstream_impl.hpp b/contrib/autoboost/autoboost/format/alt_sstream_impl.hpp new file mode 100644 index 000000000..d6598dc64 --- /dev/null +++ b/contrib/autoboost/autoboost/format/alt_sstream_impl.hpp @@ -0,0 +1,313 @@ +// ---------------------------------------------------------------------------- +// alt_sstream_impl.hpp : alternative stringstream, templates implementation +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_SK_ALT_SSTREAM_IMPL_HPP +#define AUTOBOOST_SK_ALT_SSTREAM_IMPL_HPP + +namespace autoboost { + namespace io { +// --- Implementation ------------------------------------------------------// + + template + void basic_altstringbuf:: + clear_buffer () { + const Ch * p = pptr(); + const Ch * b = pbase(); + if(p != NULL && p != b) { + seekpos(0, ::std::ios_base::out); + } + p = gptr(); + b = eback(); + if(p != NULL && p != b) { + seekpos(0, ::std::ios_base::in); + } + } + + template + void basic_altstringbuf:: + str (const string_type& s) { + size_type sz=s.size(); + if(sz != 0 && mode_ & (::std::ios_base::in | ::std::ios_base::out) ) { +#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC + void *vd_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0); + Ch *new_ptr = static_cast(vd_ptr); +#else + Ch *new_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0); +#endif + // if this didnt throw, we're safe, update the buffer + dealloc(); + sz = s.copy(new_ptr, sz); + putend_ = new_ptr + sz; + if(mode_ & ::std::ios_base::in) + streambuf_t::setg(new_ptr, new_ptr, new_ptr + sz); + if(mode_ & ::std::ios_base::out) { + streambuf_t::setp(new_ptr, new_ptr + sz); + if(mode_ & (::std::ios_base::app | ::std::ios_base::ate)) + streambuf_t::pbump(static_cast(sz)); + if(gptr() == NULL) + streambuf_t::setg(new_ptr, NULL, new_ptr); + } + is_allocated_ = true; + } + else + dealloc(); + } + template + Ch* basic_altstringbuf:: + begin () const { + if(mode_ & ::std::ios_base::out && pptr() != NULL) + return pbase(); + else if(mode_ & ::std::ios_base::in && gptr() != NULL) + return eback(); + return NULL; + } + + template + typename std::basic_string::size_type + basic_altstringbuf:: + size () const { + if(mode_ & ::std::ios_base::out && pptr()) + return static_cast(pend() - pbase()); + else if(mode_ & ::std::ios_base::in && gptr()) + return static_cast(egptr() - eback()); + else + return 0; + } + + template + typename std::basic_string::size_type + basic_altstringbuf:: + cur_size () const { + if(mode_ & ::std::ios_base::out && pptr()) + return static_cast( pptr() - pbase()); + else if(mode_ & ::std::ios_base::in && gptr()) + return static_cast( gptr() - eback()); + else + return 0; + } + + template + typename basic_altstringbuf::pos_type + basic_altstringbuf:: + seekoff (off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) { + if(pptr() != NULL && putend_ < pptr()) + putend_ = pptr(); + if(which & ::std::ios_base::in && gptr() != NULL) { + // get area + if(way == ::std::ios_base::end) + off += static_cast(putend_ - gptr()); + else if(way == ::std::ios_base::beg) + off += static_cast(eback() - gptr()); + else if(way != ::std::ios_base::cur || (which & ::std::ios_base::out) ) + // (altering in&out is only supported if way is beg or end, not cur) + return pos_type(off_type(-1)); + if(eback() <= off+gptr() && off+gptr() <= putend_ ) { + // set gptr + streambuf_t::gbump(static_cast(off)); + if(which & ::std::ios_base::out && pptr() != NULL) + // update pptr to match gptr + streambuf_t::pbump(static_cast(gptr()-pptr())); + } + else + off = off_type(-1); + } + else if(which & ::std::ios_base::out && pptr() != NULL) { + // put area + if(way == ::std::ios_base::end) + off += static_cast(putend_ - pptr()); + else if(way == ::std::ios_base::beg) + off += static_cast(pbase() - pptr()); + else if(way != ::std::ios_base::beg) + return pos_type(off_type(-1)); + if(pbase() <= off+pptr() && off+pptr() <= putend_) + // set pptr + streambuf_t::pbump(static_cast(off)); + else + off = off_type(-1); + } + else // neither in nor out + off = off_type(-1); + return (pos_type(off)); + } + //- end seekoff(..) + + + template + typename basic_altstringbuf::pos_type + basic_altstringbuf:: + seekpos (pos_type pos, ::std::ios_base::openmode which) { + off_type off = off_type(pos); // operation guaranteed by 27.4.3.2 table 88 + if(pptr() != NULL && putend_ < pptr()) + putend_ = pptr(); + if(off != off_type(-1)) { + if(which & ::std::ios_base::in && gptr() != NULL) { + // get area + if(0 <= off && off <= putend_ - eback()) { + streambuf_t::gbump(static_cast(eback() - gptr() + off)); + if(which & ::std::ios_base::out && pptr() != NULL) { + // update pptr to match gptr + streambuf_t::pbump(static_cast(gptr()-pptr())); + } + } + else + off = off_type(-1); + } + else if(which & ::std::ios_base::out && pptr() != NULL) { + // put area + if(0 <= off && off <= putend_ - eback()) + streambuf_t::pbump(static_cast(eback() - pptr() + off)); + else + off = off_type(-1); + } + else // neither in nor out + off = off_type(-1); + return (pos_type(off)); + } + else { + AUTOBOOST_ASSERT(0); // §27.4.3.2 allows undefined-behaviour here + return pos_type(off_type(-1)); + } + } + // -end seekpos(..) + + + template + typename basic_altstringbuf::int_type + basic_altstringbuf:: + underflow () { + if(gptr() == NULL) // no get area -> nothing to get. + return (compat_traits_type::eof()); + else if(gptr() < egptr()) // ok, in buffer + return (compat_traits_type::to_int_type(*gptr())); + else if(mode_ & ::std::ios_base::in && pptr() != NULL + && (gptr() < pptr() || gptr() < putend_) ) + { // expand get area + if(putend_ < pptr()) + putend_ = pptr(); // remember pptr reached this far + streambuf_t::setg(eback(), gptr(), putend_); + return (compat_traits_type::to_int_type(*gptr())); + } + else // couldnt get anything. EOF. + return (compat_traits_type::eof()); + } + // -end underflow(..) + + + template + typename basic_altstringbuf::int_type + basic_altstringbuf:: + pbackfail (int_type meta) { + if(gptr() != NULL && (eback() < gptr()) + && (mode_ & (::std::ios_base::out) + || compat_traits_type::eq_int_type(compat_traits_type::eof(), meta) + || compat_traits_type::eq(compat_traits_type::to_char_type(meta), gptr()[-1]) ) ) { + streambuf_t::gbump(-1); // back one character + if(!compat_traits_type::eq_int_type(compat_traits_type::eof(), meta)) + // put-back meta into get area + *gptr() = compat_traits_type::to_char_type(meta); + return (compat_traits_type::not_eof(meta)); + } + else + return (compat_traits_type::eof()); // failed putback + } + // -end pbackfail(..) + + + template + typename basic_altstringbuf::int_type + basic_altstringbuf:: + overflow (int_type meta) { +#ifdef AUTOBOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4996) +#endif + if(compat_traits_type::eq_int_type(compat_traits_type::eof(), meta)) + return compat_traits_type::not_eof(meta); // nothing to do + else if(pptr() != NULL && pptr() < epptr()) { + streambuf_t::sputc(compat_traits_type::to_char_type(meta)); + return meta; + } + else if(! (mode_ & ::std::ios_base::out)) + // no write position, and cant make one + return compat_traits_type::eof(); + else { // make a write position available + std::size_t prev_size = pptr() == NULL ? 0 : epptr() - eback(); + std::size_t new_size = prev_size; + // exponential growth : size *= 1.5 + std::size_t add_size = new_size / 2; + if(add_size < alloc_min) + add_size = alloc_min; + Ch * newptr = NULL, *oldptr = eback(); + + // make sure adding add_size wont overflow size_t + while (0 < add_size && ((std::numeric_limits::max)() + - add_size < new_size) ) + add_size /= 2; + if(0 < add_size) { + new_size += add_size; +#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC + void *vdptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0); + newptr = static_cast(vdptr); +#else + newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0); +#endif + } + + if(0 < prev_size) + compat_traits_type::copy(newptr, oldptr, prev_size); + if(is_allocated_) + alloc_.deallocate(oldptr, prev_size); + is_allocated_=true; + + if(prev_size == 0) { // first allocation + putend_ = newptr; + streambuf_t::setp(newptr, newptr + new_size); + if(mode_ & ::std::ios_base::in) + streambuf_t::setg(newptr, newptr, newptr + 1); + else + streambuf_t::setg(newptr, 0, newptr); + } + else { // update pointers + putend_ = putend_ - oldptr + newptr; + int pptr_count = static_cast(pptr()-pbase()); + int gptr_count = static_cast(gptr()-eback()); + streambuf_t::setp(pbase() - oldptr + newptr, newptr + new_size); + streambuf_t::pbump(pptr_count); + if(mode_ & ::std::ios_base::in) + streambuf_t::setg(newptr, newptr + gptr_count, pptr() + 1); + else + streambuf_t::setg(newptr, 0, newptr); + } + streambuf_t::sputc(compat_traits_type::to_char_type(meta)); + return meta; + } +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + } + // -end overflow(..) + + template + void basic_altstringbuf:: dealloc() { + if(is_allocated_) + alloc_.deallocate(eback(), (pptr() != NULL ? epptr() : egptr()) - eback()); + is_allocated_ = false; + streambuf_t::setg(0, 0, 0); + streambuf_t::setp(0, 0); + putend_ = NULL; + } + + }// N.S. io +} // N.S. boost + +#endif // include guard + diff --git a/contrib/autoboost/autoboost/format/detail/compat_workarounds.hpp b/contrib/autoboost/autoboost/format/detail/compat_workarounds.hpp new file mode 100644 index 000000000..b43aab14e --- /dev/null +++ b/contrib/autoboost/autoboost/format/detail/compat_workarounds.hpp @@ -0,0 +1,86 @@ +// ---------------------------------------------------------------------------- +// compat_workarounds : general framework for non-conformance workarounds +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + + +// this file defines wrapper classes to hide non-conforming +// std::char_traits<> and std::allocator<> traits +// and Includes : config_macros.hpp (defines config macros +// and compiler-specific switches) + +// Non-conformant Std-libs fail to supply conformant traits (std::char_traits, +// std::allocator) and/or the std::string doesnt support them. +// We don't want to have hundreds of #ifdef workarounds, so we define +// replacement traits. +// But both char_traits and allocator traits are visible in the interface, +// (inside the final string type), thus we need to keep both +// the replacement type (typedefed to 'compatible_type') for real use, +// and the original stdlib type (typedef to 'type_for_string') for interface +// visibility. This is what Compat* classes do (as well as be transparent +// when good allocator and char traits are present) + +#ifndef AUTOBOOST_FORMAT_COMPAT_WORKAROUNDS_HPP +#define AUTOBOOST_FORMAT_COMPAT_WORKAROUNDS_HPP + +namespace autoboost { + namespace io { + + // gcc-2.95 char traits (non-conformantly named string_char_traits) + // lack several functions so we extend them in a replacement class. + template + class CompatTraits; + + // std::allocator in gcc-2.95 is ok, but basic_string only works + // with plain 'std::alloc' still, alt_stringbuf requires a functionnal + // alloc template argument, so we need a replacement allocator + template + class CompatAlloc; + } // N.S. io +}// N.S. boost + + +#include + // sets-up macros and load compiler-specific workarounds headers. + +#if !defined(AUTOBOOST_FORMAT_STREAMBUF_DEFINED) +// workarounds-gcc-2.95 might have defined own streambuf +#include +#endif + +#if !defined(AUTOBOOST_FORMAT_OSTREAM_DEFINED) +// workarounds-gcc-2.95 might already have included +#include +#endif + + + +namespace autoboost { + namespace io { + + // **** CompatTraits general definitions : ---------------------------- + template + class CompatTraits + { // general case : be transparent + public: + typedef Tr compatible_type; + }; + + // **** CompatAlloc general definitions : ----------------------------- + template + class CompatAlloc + { // general case : be transparent + public: + typedef Alloc compatible_type; + }; + + } //N.S. io +} // N.S. boost +#endif // include guard diff --git a/contrib/autoboost/autoboost/format/detail/config_macros.hpp b/contrib/autoboost/autoboost/format/detail/config_macros.hpp new file mode 100644 index 000000000..b1566d103 --- /dev/null +++ b/contrib/autoboost/autoboost/format/detail/config_macros.hpp @@ -0,0 +1,95 @@ +// -*- C++ -*- +// ---------------------------------------------------------------------------- +// config_macros.hpp : configuration macros for the format library +// only AUTOBOOST_IO_STD is absolutely needed (it should be 'std::' in general) +// others are compiler-specific workaround macros used in #ifdef switches +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_CONFIG_MACROS_HPP +#define AUTOBOOST_FORMAT_CONFIG_MACROS_HPP + +#include +#include + +// make sure our local macros wont override something : +#if defined(AUTOBOOST_NO_LOCALE_ISDIGIT) || defined(AUTOBOOST_OVERLOAD_FOR_NON_CONST) \ + || defined(AUTOBOOST_IO_STD) || defined( AUTOBOOST_IO_NEEDS_USING_DECLARATION ) \ + || defined(AUTOBOOST_NO_TEMPLATE_STD_STREAM) \ + || defined(AUTOBOOST_FORMAT_STREAMBUF_DEFINED) || defined(AUTOBOOST_FORMAT_OSTREAM_DEFINED) +#error "autoboost::format uses a local macro that is already defined." +#endif + +// specific workarounds. each header can define BOOS_IO_STD if it +// needs. (e.g. because of IO_NEEDS_USING_DECLARATION) +#include +#include + +#ifndef AUTOBOOST_IO_STD +# define AUTOBOOST_IO_STD ::std:: +#endif + +#if defined(AUTOBOOST_NO_STD_LOCALE) || \ + ( AUTOBOOST_WORKAROUND(__BORLANDC__, <= 0x564) \ + || AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT( 0x570 ) ) ) +// some future __BORLANDC__ >0x564 versions might not need this +// 0x570 is Borland's kylix branch +#define AUTOBOOST_NO_LOCALE_ISDIGIT +#endif + +#if AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT(0x570) ) || AUTOBOOST_WORKAROUND( AUTOBOOST_MSVC, AUTOBOOST_TESTED_AT(1300)) +#define AUTOBOOST_NO_OVERLOAD_FOR_NON_CONST +#endif + +// **** Workaround for io streams, stlport and msvc. +#ifdef AUTOBOOST_IO_NEEDS_USING_DECLARATION +namespace autoboost { + using std::char_traits; + using std::basic_ostream; + namespace io { + using std::basic_ostream; + namespace detail { + using std::basic_ios; + using std::basic_ostream; + } + } +#if ! defined(AUTOBOOST_NO_STD_LOCALE) + using std::locale; + namespace io { + using std::locale; + namespace detail { + using std::locale; + } + } +#endif // locale +} + // -end N.S. boost +#endif // needs_using_declaration + +#if ! defined(AUTOBOOST_NO_STD_LOCALE) +#include +#endif + + +// *** hide std::locale if it doesnt exist. +// this typedef is either std::locale or int, avoids placing ifdefs everywhere +namespace autoboost { namespace io { namespace detail { +#if ! defined(AUTOBOOST_NO_STD_LOCALE) + typedef AUTOBOOST_IO_STD locale locale_t; +#else + typedef int locale_t; +#endif +} } } + + +// ---------------------------------------------------------------------------- + +#endif // AUTOBOOST_FORMAT_MACROS_DEFAULT_HPP diff --git a/contrib/autoboost/autoboost/format/detail/msvc_disambiguater.hpp b/contrib/autoboost/autoboost/format/detail/msvc_disambiguater.hpp new file mode 100644 index 000000000..10cf1cd5f --- /dev/null +++ b/contrib/autoboost/autoboost/format/detail/msvc_disambiguater.hpp @@ -0,0 +1,54 @@ +// ---------------------------------------------------------------------------- +// msvc_disambiguater.hpp : msvc workarounds. (for put_{head|last} overloads) +// the trick was described in boost's list by Aleksey Gurtovoy +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_MSVC_DISAMBIGUATER_HPP +#define AUTOBOOST_MSVC_DISAMBIGUATER_HPP + +#if AUTOBOOST_WORKAROUND(__DECCXX_VER, AUTOBOOST_TESTED_AT(60590042)) + +#include +#include + +namespace autoboost { +namespace io { +namespace detail { + +template< class Ch, class Tr, class T > +struct disambiguater +{ + template< typename U > + static void put_head(AUTOBOOST_IO_STD basic_ostream& os, group1 const& x, long) + { + os << group_head(x.a1_); + } + static void put_head(AUTOBOOST_IO_STD basic_ostream& os, T const& x, int) + { + } + template< typename U > + static void put_last(AUTOBOOST_IO_STD basic_ostream& os, group1 const& x, long) + { + os << group_last(x.a1_); + } + static void put_last(AUTOBOOST_IO_STD basic_ostream& os, T const& x, int) + { + os << x; + } +}; + +} // namespace detail +} // namespace io +} // namespace autoboost + +#endif // -__DECCXX_VER + +#endif // -AUTOBOOST_MSVC_DISAMBIGUATER_HPP diff --git a/contrib/autoboost/autoboost/format/detail/unset_macros.hpp b/contrib/autoboost/autoboost/format/detail/unset_macros.hpp new file mode 100644 index 000000000..b86d4b8ea --- /dev/null +++ b/contrib/autoboost/autoboost/format/detail/unset_macros.hpp @@ -0,0 +1,34 @@ +// ---------------------------------------------------------------------------- +// unset_macros.hpp +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +// *** Undefine 'local' macros : +#ifdef AUTOBOOST_NO_OVERLOAD_FOR_NON_CONST +#undef AUTOBOOST_NO_OVERLOAD_FOR_NON_CONST +#endif +#ifdef AUTOBOOST_NO_LOCALE_ISDIGIT +#undef AUTOBOOST_NO_LOCALE_ISDIGIT +#endif +#ifdef AUTOBOOST_IO_STD +#undef AUTOBOOST_IO_STD +#endif +#ifdef AUTOBOOST_IO_NEEDS_USING_DECLARATION +#undef AUTOBOOST_IO_NEEDS_USING_DECLARATION +#endif +#ifdef AUTOBOOST_NO_TEMPLATE_STD_STREAM +#undef AUTOBOOST_NO_TEMPLATE_STD_STREAM +#endif +#ifdef AUTOBOOST_FORMAT_STREAMBUF_DEFINED +#undef AUTOBOOST_FORMAT_STREAMBUF_DEFINED +#endif +#ifdef AUTOBOOST_FORMAT_OSTREAM_DEFINED +#undef AUTOBOOST_FORMAT_OSTREAM_DEFINED +#endif diff --git a/contrib/autoboost/autoboost/format/detail/workarounds_gcc-2_95.hpp b/contrib/autoboost/autoboost/format/detail/workarounds_gcc-2_95.hpp new file mode 100644 index 000000000..44ceabbd5 --- /dev/null +++ b/contrib/autoboost/autoboost/format/detail/workarounds_gcc-2_95.hpp @@ -0,0 +1,162 @@ +// ---------------------------------------------------------------------------- +// workarounds for gcc < 3.0. +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + + +// ---------------------------------------------------------------------------- + +// There's a lot to do, the stdlib shipped with gcc prior to 3.x +// was terribly non-conforming. +// . defines macros switches +// . supplies template classes basic_foo where gcc only supplies foo. +// i.e : +// - basic_ios from ios +// - basic_ostream from ostream +// - basic_srteambuf from streambuf +// these can be used transparently. (it obviously does not work for wchar_t) +// . specialise CompatAlloc and CompatTraits to wrap gcc-2.95's +// string_char_traits and std::alloc + +#if AUTOBOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) + // only for gcc-2.95's native stdlib + +#ifndef AUTOBOOST_FORMAT_WORKAROUNDS_GCC295_H +#define AUTOBOOST_FORMAT_WORKAROUNDS_GCC295_H + +// SGI STL doesnt have and others, so we need iostream. +#include +#define AUTOBOOST_FORMAT_OSTREAM_DEFINED + +#include +#define AUTOBOOST_FORMAT_STREAMBUF_DEFINED + +#define AUTOBOOST_NO_TEMPLATE_STD_STREAM + +#ifndef AUTOBOOST_IO_STD +# define AUTOBOOST_IO_STD std:: +#endif + + + +// *** +// gcc's simple classes turned into standard-like template classes : + +namespace std { + + + // gcc has string_char_traits, it's incomplete. + // we declare a std::char_traits, and specialize CompatTraits<..> on it + // to do what is required + template + class char_traits; // no definition here, we will just use it as a tag. + + template + class basic_streambuf; + + template + class basic_streambuf : public streambuf { + }; + + template > + class basic_ios; + + template + class basic_ios : public ostream { + public: + basic_ios(streambuf * p) : ostream(p) {}; + char fill() const { return ios::fill(); } // gcc returns wchar.. + char fill(char c) { return ios::fill(c); } // gcc takes wchar.. + char widen(char c) { return c; } + char narrow(char c, char def) { return c; } + basic_ios& copyfmt(const ios& right) { + fill(right.fill()); + flags(right.flags() ); + exceptions(right.exceptions()); + width(right.width()); + precision(right.precision()); + return *this; + } + }; + + + typedef ios ios_base; + + template + class basic_ostream; + + template + class basic_ostream : public basic_ios + { + public: + basic_ostream(streambuf * p) : basic_ios (p) {} + }; + +} // namespace std + + +namespace autoboost { + namespace io { + + + // ** CompatTraits gcc2.95 specialisations ---------------------------- + template + class CompatTraits< ::std::string_char_traits > + : public ::std::string_char_traits + { + public: + typedef CompatTraits compatible_type; + + typedef Ch char_type; + typedef int int_type; + typedef ::std::streampos pos_type; + typedef ::std::streamoff off_type; + + static char_type + to_char_type(const int_type& meta) { + return static_cast(meta); } + static int_type + to_int_type(const char_type& ch) { + return static_cast(static_cast(ch) );} + static bool + eq_int_type(const int_type& left, const int_type& right) { + return left == right; } + static int_type + eof() { + return static_cast(EOF); + } + static int_type + not_eof(const int_type& meta) { + return (meta == eof()) ? 0 : meta; + } + }; + + template + class CompatTraits< ::std::char_traits > { + public: + typedef CompatTraits< ::std::string_char_traits > compatible_type; + }; + + // ** CompatAlloc gcc-2.95 specialisations --------------------------- + template<> + class CompatAlloc< ::std::alloc> + { + public: + typedef ::std::allocator compatible_type; + }; + + } // N.S. io +} // N.S. boost + + + + + +#endif // include guard + +#endif // if workaround diff --git a/contrib/autoboost/autoboost/format/detail/workarounds_stlport.hpp b/contrib/autoboost/autoboost/format/detail/workarounds_stlport.hpp new file mode 100644 index 000000000..47c7a38de --- /dev/null +++ b/contrib/autoboost/autoboost/format/detail/workarounds_stlport.hpp @@ -0,0 +1,36 @@ +// ---------------------------------------------------------------------------- +// workarounds_stlport.hpp : workaround STLport issues +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_MACROS_STLPORT_HPP +#define AUTOBOOST_MACROS_STLPORT_HPP + +// *** This should go to "autoboost/config/stdlib/stlport.hpp". + +// If the streams are not native and there are problems with using templates +// accross namespaces, we define some macros to enable a workaround for this. + +// STLport 4.5 +#if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(AUTOBOOST_NO_USING_TEMPLATE) +# define AUTOBOOST_IO_STD +# define AUTOBOOST_IO_NEEDS_USING_DECLARATION +#endif + +// STLport 4.0 +#if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_OWN_NAMESPACE) && defined(AUTOBOOST_NO_USING_TEMPLATE) +# define AUTOBOOST_IO_STD +# define AUTOBOOST_IO_NEEDS_USING_DECLARATION +#endif + + +// ---------------------------------------------------------------------------- + +#endif // AUTOBOOST_MACROS_STLPORT_HPP diff --git a/contrib/autoboost/autoboost/format/exceptions.hpp b/contrib/autoboost/autoboost/format/exceptions.hpp new file mode 100644 index 000000000..4450bb225 --- /dev/null +++ b/contrib/autoboost/autoboost/format/exceptions.hpp @@ -0,0 +1,103 @@ +// ---------------------------------------------------------------------------- +// boost/format/exceptions.hpp +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. +// +// 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/libs/format/ for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_EXCEPTIONS_HPP +#define AUTOBOOST_FORMAT_EXCEPTIONS_HPP + + +#include + + +namespace autoboost { + + namespace io { + +// **** exceptions ----------------------------------------------- + + class format_error : public std::exception + { + public: + format_error() {} + virtual const char *what() const throw() { + return "autoboost::format_error: " + "format generic failure"; + } + }; + + class bad_format_string : public format_error + { + std::size_t pos_, next_; + public: + bad_format_string(std::size_t pos, std::size_t size) + : pos_(pos), next_(size) {} + std::size_t get_pos() const { return pos_; } + std::size_t get_next() const { return next_; } + virtual const char *what() const throw() { + return "autoboost::bad_format_string: format-string is ill-formed"; + } + }; + + class too_few_args : public format_error + { + std::size_t cur_, expected_; + public: + too_few_args(std::size_t cur, std::size_t expected) + : cur_(cur), expected_(expected) {} + std::size_t get_cur() const { return cur_; } + std::size_t get_expected() const { return expected_; } + virtual const char *what() const throw() { + return "autoboost::too_few_args: " + "format-string referred to more arguments than were passed"; + } + }; + + class too_many_args : public format_error + { + std::size_t cur_, expected_; + public: + too_many_args(std::size_t cur, std::size_t expected) + : cur_(cur), expected_(expected) {} + std::size_t get_cur() const { return cur_; } + std::size_t get_expected() const { return expected_; } + virtual const char *what() const throw() { + return "autoboost::too_many_args: " + "format-string referred to less arguments than were passed"; + } + }; + + + class out_of_range : public format_error + { + int index_, beg_, end_; // range is [ beg, end [ + public: + out_of_range(int index, int beg, int end) + : index_(index), beg_(beg), end_(end) {} + int get_index() const { return index_; } + int get_beg() const { return beg_; } + int get_end() const { return end_; } + virtual const char *what() const throw() { + return "autoboost::out_of_range: " + "tried to refer to an argument (or item) number which" + " is out of range, according to the format string"; + } + }; + + + } // namespace io + +} // namespace autoboost + + +#endif // AUTOBOOST_FORMAT_EXCEPTIONS_HPP diff --git a/contrib/autoboost/autoboost/format/feed_args.hpp b/contrib/autoboost/autoboost/format/feed_args.hpp new file mode 100644 index 000000000..932656a30 --- /dev/null +++ b/contrib/autoboost/autoboost/format/feed_args.hpp @@ -0,0 +1,315 @@ +// ---------------------------------------------------------------------------- +// feed_args.hpp : functions for processing each argument +// (feed, feed_manip, and distribute) +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_FEED_ARGS_HPP +#define AUTOBOOST_FORMAT_FEED_ARGS_HPP + +#include +#include +#include + +#include +#include +#include + +namespace autoboost { +namespace io { +namespace detail { + + template + void mk_str( std::basic_string & res, + const Ch * beg, + typename std::basic_string::size_type size, + std::streamsize w, + const Ch fill_char, + std::ios_base::fmtflags f, + const Ch prefix_space, // 0 if no space-padding + bool center) + // applies centered/left/right padding to the string [beg, beg+size[ + // Effects : the result is placed in res. + { + typedef typename std::basic_string::size_type size_type; + res.resize(0); + if(w<=0 || static_cast(w) <=size) { + // no need to pad. + res.reserve(size + !!prefix_space); + if(prefix_space) + res.append(1, prefix_space); + if (size) + res.append(beg, size); + } + else { + std::streamsize n=static_cast(w-size-!!prefix_space); + std::streamsize n_after = 0, n_before = 0; + res.reserve(static_cast(w)); // allocate once for the 2 inserts + if(center) + n_after = n/2, n_before = n - n_after; + else + if(f & std::ios_base::left) + n_after = n; + else + n_before = n; + // now make the res string : + if(n_before) res.append(static_cast(n_before), fill_char); + if(prefix_space) + res.append(1, prefix_space); + if (size) + res.append(beg, size); + if(n_after) res.append(static_cast(n_after), fill_char); + } + } // -mk_str(..) + + +#if AUTOBOOST_WORKAROUND(__DECCXX_VER, AUTOBOOST_TESTED_AT(60590042)) +// __DECCXX needs to be tricked to disambiguate this simple overload.. +// the trick is in "autoboost/format/msvc_disambiguater.hpp" + + template< class Ch, class Tr, class T> inline + void put_head (AUTOBOOST_IO_STD basic_ostream & os, const T& x ) { + disambiguater::put_head(os, x, 1L); + } + template< class Ch, class Tr, class T> inline + void put_last (AUTOBOOST_IO_STD basic_ostream & os, const T& x ) { + disambiguater::put_last(os, x, 1L); + } + +#else + + template< class Ch, class Tr, class T> inline + void put_head (AUTOBOOST_IO_STD basic_ostream &, const T& ) { + } + + template< class Ch, class Tr, class T> inline + void put_head( AUTOBOOST_IO_STD basic_ostream & os, const group1& x ) { + os << group_head(x.a1_); // send the first N-1 items, not the last + } + + template< class Ch, class Tr, class T> inline + void put_last( AUTOBOOST_IO_STD basic_ostream & os, const T& x ) { + os << x ; + } + + template< class Ch, class Tr, class T> inline + void put_last( AUTOBOOST_IO_STD basic_ostream & os, const group1& x ) { + os << group_last(x.a1_); // this selects the last element + } + +#ifndef AUTOBOOST_NO_OVERLOAD_FOR_NON_CONST + template< class Ch, class Tr, class T> inline + void put_head( AUTOBOOST_IO_STD basic_ostream &, T& ) { + } + + template< class Ch, class Tr, class T> inline + void put_last( AUTOBOOST_IO_STD basic_ostream & os, T& x) { + os << x ; + } +#endif +#endif // -__DECCXX workaround + + template< class Ch, class Tr, class T> + void call_put_head(AUTOBOOST_IO_STD basic_ostream & os, const void* x) { + put_head(os, *(typename ::autoboost::remove_reference::type*)x); + } + + template< class Ch, class Tr, class T> + void call_put_last(AUTOBOOST_IO_STD basic_ostream & os, const void* x) { + put_last(os, *(T*)x); + } + + template< class Ch, class Tr> + struct put_holder { + template + put_holder(T& t) + : arg(&t), + put_head(&call_put_head), + put_last(&call_put_last) + {} + const void* arg; + void (*put_head)(AUTOBOOST_IO_STD basic_ostream & os, const void* x); + void (*put_last)(AUTOBOOST_IO_STD basic_ostream & os, const void* x); + }; + + template< class Ch, class Tr> inline + void put_head( AUTOBOOST_IO_STD basic_ostream & os, const put_holder& t) { + t.put_head(os, t.arg); + } + + template< class Ch, class Tr> inline + void put_last( AUTOBOOST_IO_STD basic_ostream & os, const put_holder& t) { + t.put_last(os, t.arg); + } + + + template< class Ch, class Tr, class Alloc, class T> + void put( T x, + const format_item& specs, + typename basic_format::string_type& res, + typename basic_format::internal_streambuf_t & buf, + io::detail::locale_t *loc_p = NULL) + { +#ifdef AUTOBOOST_MSVC + // If std::min or std::max are already instantiated + // at this point then we get a blizzard of warning messages when we call + // those templates with std::size_t as arguments. Weird and very annoyning... +#pragma warning(push) +#pragma warning(disable:4267) +#endif + // does the actual conversion of x, with given params, into a string + // using the supplied stringbuf. + + typedef typename basic_format::string_type string_type; + typedef typename basic_format::format_item_t format_item_t; + typedef typename string_type::size_type size_type; + + basic_oaltstringstream oss( &buf); + specs.fmtstate_.apply_on(oss, loc_p); + + // the stream format state can be modified by manipulators in the argument : + put_head( oss, x ); + // in case x is a group, apply the manip part of it, + // in order to find width + + const std::ios_base::fmtflags fl=oss.flags(); + const bool internal = (fl & std::ios_base::internal) != 0; + const std::streamsize w = oss.width(); + const bool two_stepped_padding= internal && (w!=0); + + res.resize(0); + if(! two_stepped_padding) { + if(w>0) // handle padding via mk_str, not natively in stream + oss.width(0); + put_last( oss, x); + const Ch * res_beg = buf.pbase(); + Ch prefix_space = 0; + if(specs.pad_scheme_ & format_item_t::spacepad) + if(buf.pcount()== 0 || + (res_beg[0] !=oss.widen('+') && res_beg[0] !=oss.widen('-') )) + prefix_space = oss.widen(' '); + size_type res_size = (std::min)( + static_cast(specs.truncate_ - !!prefix_space), + buf.pcount() ); + mk_str(res, res_beg, res_size, w, oss.fill(), fl, + prefix_space, (specs.pad_scheme_ & format_item_t::centered) !=0 ); + } + else { // 2-stepped padding + // internal can be implied by zeropad, or user-set. + // left, right, and centered alignment overrule internal, + // but spacepad or truncate might be mixed with internal (using manipulator) + put_last( oss, x); // may pad + const Ch * res_beg = buf.pbase(); + size_type res_size = buf.pcount(); + bool prefix_space=false; + if(specs.pad_scheme_ & format_item_t::spacepad) + if(buf.pcount()== 0 || + (res_beg[0] !=oss.widen('+') && res_beg[0] !=oss.widen('-') )) + prefix_space = true; + if(res_size == static_cast(w) && w<=specs.truncate_ && !prefix_space) { + // okay, only one thing was printed and padded, so res is fine + res.assign(res_beg, res_size); + } + else { // length w exceeded + // either it was multi-output with first output padding up all width.. + // either it was one big arg and we are fine. + // Note that res_size oss2( &buf); + specs.fmtstate_.apply_on(oss2, loc_p); + put_head( oss2, x ); + + oss2.width(0); + if(prefix_space) + oss2 << ' '; + put_last(oss2, x ); + if(buf.pcount()==0 && specs.pad_scheme_ & format_item_t::spacepad) { + prefix_space =true; + oss2 << ' '; + } + // we now have the minimal-length output + const Ch * tmp_beg = buf.pbase(); + size_type tmp_size = (std::min)(static_cast(specs.truncate_), + buf.pcount() ); + + + if(static_cast(w) <= tmp_size) { + // minimal length is already >= w, so no padding (cool!) + res.assign(tmp_beg, tmp_size); + } + else { // hum.. we need to pad (multi_output, or spacepad present) + //find where we should pad + size_type sz = (std::min)(res_size + (prefix_space ? 1 : 0), tmp_size); + size_type i = prefix_space; + for(; i=tmp_size) i=prefix_space; + res.assign(tmp_beg, i); + std::streamsize d = w - static_cast(tmp_size); + AUTOBOOST_ASSERT(d>0); + res.append(static_cast( d ), oss2.fill()); + res.append(tmp_beg+i, tmp_size-i); + AUTOBOOST_ASSERT(i+(tmp_size-i)+(std::max)(d,(std::streamsize)0) + == static_cast(w)); + AUTOBOOST_ASSERT(res.size() == static_cast(w)); + } + } + } + buf.clear_buffer(); +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + } // end- put(..) + + + template< class Ch, class Tr, class Alloc, class T> + void distribute (basic_format& self, T x) { + // call put(x, ..) on every occurence of the current argument : + if(self.cur_arg_ >= self.num_args_) { + if( self.exceptions() & too_many_args_bit ) + autoboost::throw_exception(too_many_args(self.cur_arg_, self.num_args_)); + else return; + } + for(unsigned long i=0; i < self.items_.size(); ++i) { + if(self.items_[i].argN_ == self.cur_arg_) { + put (x, self.items_[i], self.items_[i].res_, + self.buf_, autoboost::get_pointer(self.loc_) ); + } + } + } + + template + basic_format& + feed_impl (basic_format& self, T x) { + if(self.dumped_) self.clear(); + distribute (self, x); + ++self.cur_arg_; + if(self.bound_.size() != 0) { + while( self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_] ) + ++self.cur_arg_; + } + return self; + } + + template inline + basic_format& + feed (basic_format& self, T x) { + return feed_impl&>(self, put_holder(x)); + } + +} // namespace detail +} // namespace io +} // namespace autoboost + + +#endif // AUTOBOOST_FORMAT_FEED_ARGS_HPP diff --git a/contrib/autoboost/autoboost/format/format_class.hpp b/contrib/autoboost/autoboost/format/format_class.hpp new file mode 100644 index 000000000..0146256ea --- /dev/null +++ b/contrib/autoboost/autoboost/format/format_class.hpp @@ -0,0 +1,168 @@ +// ---------------------------------------------------------------------------- +// format_class.hpp : class interface +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_CLASS_HPP +#define AUTOBOOST_FORMAT_CLASS_HPP + + +#include +#include + +#include // to store locale when needed + +#include +#include +#include +#include + +namespace autoboost { + + template + class basic_format + { + typedef typename io::CompatTraits::compatible_type compat_traits; + public: + typedef Ch CharT; // borland fails in operator% if we use Ch and Tr directly + typedef std::basic_string string_type; + typedef typename string_type::size_type size_type; + typedef io::detail::format_item format_item_t; + typedef io::basic_altstringbuf internal_streambuf_t; + + + explicit basic_format(const Ch* str=NULL); + explicit basic_format(const string_type& s); + basic_format(const basic_format& x); + basic_format& operator= (const basic_format& x); + void swap(basic_format& x); + +#if !defined(AUTOBOOST_NO_STD_LOCALE) + explicit basic_format(const Ch* str, const std::locale & loc); + explicit basic_format(const string_type& s, const std::locale & loc); +#endif + io::detail::locale_t getloc() const; + + basic_format& clear(); // empty all converted string buffers (except bound items) + basic_format& clear_binds(); // unbind all bound items, and call clear() + basic_format& parse(const string_type&); // resets buffers and parse a new format string + + // ** formatted result ** // + size_type size() const; // sum of the current string pieces sizes + string_type str() const; // final string + + // ** arguments passing ** // + template + basic_format& operator%(const T& x) + { return io::detail::feed(*this,x); } + +#ifndef AUTOBOOST_NO_OVERLOAD_FOR_NON_CONST + template basic_format& operator%(T& x) + { return io::detail::feed(*this,x); } +#endif + +#if defined(__GNUC__) + // GCC can't handle anonymous enums without some help + // ** arguments passing ** // + basic_format& operator%(const int& x) + { return io::detail::feed(*this,x); } + +#ifndef AUTOBOOST_NO_OVERLOAD_FOR_NON_CONST + basic_format& operator%(int& x) + { return io::detail::feed(*this,x); } +#endif +#endif + + // The total number of arguments expected to be passed to the format objectt + int expected_args() const + { return num_args_; } + // The number of arguments currently bound (see bind_arg(..) ) + int bound_args() const; + // The number of arguments currently fed to the format object + int fed_args() const; + // The index (1-based) of the current argument (i.e. next to be formatted) + int cur_arg() const; + // The number of arguments still required to be fed + int remaining_args() const; // same as expected_args() - bound_args() - fed_args() + + + // ** object modifying **// + template + basic_format& bind_arg(int argN, const T& val) + { return io::detail::bind_arg_body(*this, argN, val); } + basic_format& clear_bind(int argN); + template + basic_format& modify_item(int itemN, T manipulator) + { return io::detail::modify_item_body (*this, itemN, manipulator);} + + // Choosing which errors will throw exceptions : + unsigned char exceptions() const; + unsigned char exceptions(unsigned char newexcept); + +#if !defined( AUTOBOOST_NO_MEMBER_TEMPLATE_FRIENDS ) \ + && !AUTOBOOST_WORKAROUND(__BORLANDC__, <= 0x570) \ + && !AUTOBOOST_WORKAROUND( _CRAYC, != 0) \ + && !AUTOBOOST_WORKAROUND(__DECCXX_VER, AUTOBOOST_TESTED_AT(60590042)) + // use friend templates and private members only if supported + +#ifndef AUTOBOOST_NO_TEMPLATE_STD_STREAM + template + friend std::basic_ostream & + operator<<( std::basic_ostream & , + const basic_format& ); +#else + template + friend std::ostream & + operator<<( std::ostream & , + const basic_format& ); +#endif + + template + friend basic_format& + io::detail::feed_impl (basic_format&, T); + + template friend + void io::detail::distribute (basic_format&, T); + + template friend + basic_format& + io::detail::modify_item_body (basic_format&, int, T); + + template friend + basic_format& + io::detail::bind_arg_body (basic_format&, int, const T&); + + private: +#endif + typedef io::detail::stream_format_state stream_format_state; + // flag bits, used for style_ + enum style_values { ordered = 1, // set only if all directives are positional + special_needs = 4 }; + + void make_or_reuse_data(std::size_t nbitems);// used for (re-)initialisation + + // member data --------------------------------------------// + std::vector items_; // each '%..' directive leads to a format_item + std::vector bound_; // stores which arguments were bound. size() == 0 || num_args + + int style_; // style of format-string : positional or not, etc + int cur_arg_; // keep track of wich argument is current + int num_args_; // number of expected arguments + mutable bool dumped_; // true only after call to str() or << + string_type prefix_; // piece of string to insert before first item + unsigned char exceptions_; + internal_streambuf_t buf_; // the internal stream buffer. + autoboost::optional loc_; + }; // class basic_format + +} // namespace autoboost + + +#endif // AUTOBOOST_FORMAT_CLASS_HPP diff --git a/contrib/autoboost/autoboost/format/format_fwd.hpp b/contrib/autoboost/autoboost/format/format_fwd.hpp new file mode 100644 index 000000000..e831100dd --- /dev/null +++ b/contrib/autoboost/autoboost/format/format_fwd.hpp @@ -0,0 +1,43 @@ +// ---------------------------------------------------------------------------- +// format_fwd.hpp : forward declarations +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_FWD_HPP +#define AUTOBOOST_FORMAT_FWD_HPP + +#include +#include + +#include + +namespace autoboost { + + template , class Alloc = std::allocator > + class basic_format; + + typedef basic_format format; + +#if !defined(AUTOBOOST_NO_STD_WSTRING) && !defined(AUTOBOOST_NO_STD_WSTREAMBUF) + typedef basic_format wformat; +#endif + + namespace io { + enum format_error_bits { bad_format_string_bit = 1, + too_few_args_bit = 2, too_many_args_bit = 4, + out_of_range_bit = 8, + all_error_bits = 255, no_error_bits=0 }; + + } // namespace io + +} // namespace autoboost + +#endif // AUTOBOOST_FORMAT_FWD_HPP diff --git a/contrib/autoboost/autoboost/format/format_implementation.hpp b/contrib/autoboost/autoboost/format/format_implementation.hpp new file mode 100644 index 000000000..34745cfc6 --- /dev/null +++ b/contrib/autoboost/autoboost/format/format_implementation.hpp @@ -0,0 +1,329 @@ +// ---------------------------------------------------------------------------- +// format_implementation.hpp Implementation of the basic_format class +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_IMPLEMENTATION_HPP +#define AUTOBOOST_FORMAT_IMPLEMENTATION_HPP + +#include +#include +#include +#include +#include // std::swap + +namespace autoboost { + +// --- basic_format implementation -----------------------------------------// + + template< class Ch, class Tr, class Alloc> + basic_format:: basic_format(const Ch* s) + : style_(0), cur_arg_(0), num_args_(0), dumped_(false), + exceptions_(io::all_error_bits) + { + if( s) + parse( s ); + } + +#if !defined(AUTOBOOST_NO_STD_LOCALE) + template< class Ch, class Tr, class Alloc> + basic_format:: basic_format(const Ch* s, const std::locale & loc) + : style_(0), cur_arg_(0), num_args_(0), dumped_(false), + exceptions_(io::all_error_bits), loc_(loc) + { + if(s) parse( s ); + } + + template< class Ch, class Tr, class Alloc> + basic_format:: basic_format(const string_type& s, const std::locale & loc) + : style_(0), cur_arg_(0), num_args_(0), dumped_(false), + exceptions_(io::all_error_bits), loc_(loc) + { + parse(s); + } +#endif // ! AUTOBOOST_NO_STD_LOCALE + template< class Ch, class Tr, class Alloc> + io::detail::locale_t basic_format:: + getloc() const { + return loc_ ? loc_.get() : io::detail::locale_t(); + } + + template< class Ch, class Tr, class Alloc> + basic_format:: basic_format(const string_type& s) + : style_(0), cur_arg_(0), num_args_(0), dumped_(false), + exceptions_(io::all_error_bits) + { + parse(s); + } + + template< class Ch, class Tr, class Alloc> // just don't copy the buf_ member + basic_format:: basic_format(const basic_format& x) + : items_(x.items_), bound_(x.bound_), style_(x.style_), + cur_arg_(x.cur_arg_), num_args_(x.num_args_), dumped_(x.dumped_), + prefix_(x.prefix_), exceptions_(x.exceptions_), loc_(x.loc_) + { + } + + template< class Ch, class Tr, class Alloc> // just don't copy the buf_ member + basic_format& basic_format:: + operator= (const basic_format& x) { + if(this == &x) + return *this; + (basic_format(x)).swap(*this); + return *this; + } + template< class Ch, class Tr, class Alloc> + void basic_format:: + swap (basic_format & x) { + std::swap(exceptions_, x.exceptions_); + std::swap(style_, x.style_); + std::swap(cur_arg_, x.cur_arg_); + std::swap(num_args_, x.num_args_); + std::swap(dumped_, x.dumped_); + + items_.swap(x.items_); + prefix_.swap(x.prefix_); + bound_.swap(x.bound_); + } + + template< class Ch, class Tr, class Alloc> + unsigned char basic_format:: exceptions() const { + return exceptions_; + } + + template< class Ch, class Tr, class Alloc> + unsigned char basic_format:: exceptions(unsigned char newexcept) { + unsigned char swp = exceptions_; + exceptions_ = newexcept; + return swp; + } + + template + void basic_format:: + make_or_reuse_data (std::size_t nbitems) { +#if !defined(AUTOBOOST_NO_STD_LOCALE) + Ch fill = ( AUTOBOOST_USE_FACET(std::ctype, getloc()) ). widen(' '); +#else + Ch fill = ' '; +#endif + if(items_.size() == 0) + items_.assign( nbitems, format_item_t(fill) ); + else { + if(nbitems>items_.size()) + items_.resize(nbitems, format_item_t(fill)); + bound_.resize(0); + for(std::size_t i=0; i < nbitems; ++i) + items_[i].reset(fill); // strings are resized, instead of reallocated + } + prefix_.resize(0); + } + + template< class Ch, class Tr, class Alloc> + basic_format& basic_format:: + clear () { + // empty the string buffers (except bound arguments) + // and make the format object ready for formatting a new set of arguments + + AUTOBOOST_ASSERT( bound_.size()==0 || num_args_ == static_cast(bound_.size()) ); + + for(unsigned long i=0; i + basic_format& basic_format:: + clear_binds () { + // remove all binds, then clear() + bound_.resize(0); + clear(); + return *this; + } + + template< class Ch, class Tr, class Alloc> + basic_format& basic_format:: + clear_bind (int argN) { + // remove the bind of ONE argument then clear() + if(argN<1 || argN > num_args_ || bound_.size()==0 || !bound_[argN-1] ) { + if( exceptions() & io::out_of_range_bit) + autoboost::throw_exception(io::out_of_range(argN, 1, num_args_+1 ) ); + else return *this; + } + bound_[argN-1]=false; + clear(); + return *this; + } + + template< class Ch, class Tr, class Alloc> + int basic_format:: + bound_args() const { + if(bound_.size()==0) + return 0; + int n=0; + for(int i=0; i + int basic_format:: + fed_args() const { + if(bound_.size()==0) + return cur_arg_; + int n=0; + for(int i=0; i + int basic_format:: + cur_arg() const { + return cur_arg_+1; } + + template< class Ch, class Tr, class Alloc> + int basic_format:: + remaining_args() const { + if(bound_.size()==0) + return num_args_-cur_arg_; + int n=0; + for(int i=cur_arg_; i + typename basic_format::string_type + basic_format:: + str () const { + if(items_.size()==0) + return prefix_; + if( cur_arg_ < num_args_) + if( exceptions() & io::too_few_args_bit ) + // not enough variables supplied + autoboost::throw_exception(io::too_few_args(cur_arg_, num_args_)); + + unsigned long i; + string_type res; + res.reserve(size()); + res += prefix_; + for(i=0; i < items_.size(); ++i) { + const format_item_t& item = items_[i]; + res += item.res_; + if( item.argN_ == format_item_t::argN_tabulation) { + AUTOBOOST_ASSERT( item.pad_scheme_ & format_item_t::tabulation); + if( static_cast(item.fmtstate_.width_) > res.size() ) + res.append( static_cast(item.fmtstate_.width_) - res.size(), + item.fmtstate_.fill_ ); + } + res += item.appendix_; + } + dumped_=true; + return res; + } + template< class Ch, class Tr, class Alloc> + typename std::basic_string::size_type basic_format:: + size () const { +#ifdef AUTOBOOST_MSVC + // If std::min or std::max are already instantiated + // at this point then we get a blizzard of warning messages when we call + // those templates with std::size_t as arguments. Weird and very annoyning... +#pragma warning(push) +#pragma warning(disable:4267) +#endif + AUTOBOOST_USING_STD_MAX(); + size_type sz = prefix_.size(); + unsigned long i; + for(i=0; i < items_.size(); ++i) { + const format_item_t& item = items_[i]; + sz += item.res_.size(); + if( item.argN_ == format_item_t::argN_tabulation) + sz = max AUTOBOOST_PREVENT_MACRO_SUBSTITUTION (sz, + static_cast(item.fmtstate_.width_) ); + sz += item.appendix_.size(); + } + return sz; +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + } + +namespace io { +namespace detail { + + template + basic_format& + bind_arg_body (basic_format& self, int argN, const T& val) { + // bind one argument to a fixed value + // this is persistent over clear() calls, thus also over str() and << + if(self.dumped_) + self.clear(); // needed because we will modify cur_arg_ + if(argN<1 || argN > self.num_args_) { + if( self.exceptions() & io::out_of_range_bit ) + autoboost::throw_exception(io::out_of_range(argN, 1, self.num_args_+1 ) ); + else return self; + } + if(self.bound_.size()==0) + self.bound_.assign(self.num_args_,false); + else + AUTOBOOST_ASSERT( self.num_args_ == static_cast(self.bound_.size()) ); + int o_cur_arg = self.cur_arg_; + self.cur_arg_ = argN-1; // arrays begin at 0 + + self.bound_[self.cur_arg_]=false; // if already set, we unset and re-sets.. + self.operator%(val); // put val at the right place, because cur_arg is set + + + // Now re-position cur_arg before leaving : + self.cur_arg_ = o_cur_arg; + self.bound_[argN-1]=true; + if(self.cur_arg_ == argN-1 ) { + // hum, now this arg is bound, so move to next free arg + while(self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_]) + ++self.cur_arg_; + } + // In any case, we either have all args, or are on an unbound arg : + AUTOBOOST_ASSERT( self.cur_arg_ >= self.num_args_ || ! self.bound_[self.cur_arg_]); + return self; + } + + template basic_format& + modify_item_body (basic_format& self, int itemN, T manipulator) { + // applies a manipulator to the format_item describing a given directive. + // this is a permanent change, clear or reset won't cancel that. + if(itemN<1 || itemN > static_cast(self.items_.size() )) { + if( self.exceptions() & io::out_of_range_bit ) + autoboost::throw_exception(io::out_of_range(itemN, 1, static_cast(self.items_.size()) )); + else return self; + } + self.items_[itemN-1].fmtstate_. template apply_manip ( manipulator ); + return self; + } + +} // namespace detail +} // namespace io +} // namespace autoboost + + + +#endif // AUTOBOOST_FORMAT_IMPLEMENTATION_HPP diff --git a/contrib/autoboost/autoboost/format/free_funcs.hpp b/contrib/autoboost/autoboost/format/free_funcs.hpp new file mode 100644 index 000000000..ba5d399ce --- /dev/null +++ b/contrib/autoboost/autoboost/format/free_funcs.hpp @@ -0,0 +1,70 @@ +// ---------------------------------------------------------------------------- +// free_funcs.hpp : implementation of the free functions of autoboost::format +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_FUNCS_HPP +#define AUTOBOOST_FORMAT_FUNCS_HPP + +#include +#include + +namespace autoboost { + + template inline + std::basic_string str(const basic_format& f) { + // adds up all pieces of strings and converted items, and return the formatted string + return f.str(); + } + namespace io { + using ::autoboost::str; // keep compatibility with when it was defined in this N.S. + } // - namespace io + +#ifndef AUTOBOOST_NO_TEMPLATE_STD_STREAM + template + std::basic_ostream & + operator<<( std::basic_ostream & os, + const basic_format& f) +#else + template + std::ostream & + operator<<( std::ostream & os, + const basic_format& f) +#endif + // effect: "return os << str(f);" but we can do it faster + { + typedef autoboost::basic_format format_t; + if(f.items_.size()==0) + os << f.prefix_; + else { + if(f.cur_arg_ < f.num_args_) + if( f.exceptions() & io::too_few_args_bit ) + // not enough variables supplied + autoboost::throw_exception(io::too_few_args(f.cur_arg_, f.num_args_)); + if(f.style_ & format_t::special_needs) + os << f.str(); + else { + // else we dont have to count chars output, so we dump directly to os : + os << f.prefix_; + for(unsigned long i=0; i + + +namespace autoboost { +namespace io { + + +namespace detail { + + +// empty group, but useful even though. +struct group0 +{ + group0() {} +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << ( AUTOBOOST_IO_STD basic_ostream& os, + const group0& ) +{ + return os; +} + +template +struct group1 +{ + T1 a1_; + group1(T1 a1) + : a1_(a1) + {} +private: + group1& operator=(const group1&); +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group1& x) +{ + os << x.a1_; + return os; +} + + + + +template +struct group2 +{ + T1 a1_; + T2 a2_; + group2(T1 a1,T2 a2) + : a1_(a1),a2_(a2) + {} +private: + group2& operator=(const group2&); +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group2& x) +{ + os << x.a1_<< x.a2_; + return os; +} + +template +struct group3 +{ + T1 a1_; + T2 a2_; + T3 a3_; + group3(T1 a1,T2 a2,T3 a3) + : a1_(a1),a2_(a2),a3_(a3) + {} +private: + group3& operator=(const group3&); +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group3& x) +{ + os << x.a1_<< x.a2_<< x.a3_; + return os; +} + +template +struct group4 +{ + T1 a1_; + T2 a2_; + T3 a3_; + T4 a4_; + group4(T1 a1,T2 a2,T3 a3,T4 a4) + : a1_(a1),a2_(a2),a3_(a3),a4_(a4) + {} +private: + group4& operator=(const group4&); +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group4& x) +{ + os << x.a1_<< x.a2_<< x.a3_<< x.a4_; + return os; +} + +template +struct group5 +{ + T1 a1_; + T2 a2_; + T3 a3_; + T4 a4_; + T5 a5_; + group5(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5) + : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5) + {} +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group5& x) +{ + os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_; + return os; +} + +template +struct group6 +{ + T1 a1_; + T2 a2_; + T3 a3_; + T4 a4_; + T5 a5_; + T6 a6_; + group6(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6) + : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6) + {} +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group6& x) +{ + os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_; + return os; +} + +template +struct group7 +{ + T1 a1_; + T2 a2_; + T3 a3_; + T4 a4_; + T5 a5_; + T6 a6_; + T7 a7_; + group7(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7) + : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7) + {} +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group7& x) +{ + os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_; + return os; +} + +template +struct group8 +{ + T1 a1_; + T2 a2_; + T3 a3_; + T4 a4_; + T5 a5_; + T6 a6_; + T7 a7_; + T8 a8_; + group8(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8) + : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8) + {} +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group8& x) +{ + os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_; + return os; +} + +template +struct group9 +{ + T1 a1_; + T2 a2_; + T3 a3_; + T4 a4_; + T5 a5_; + T6 a6_; + T7 a7_; + T8 a8_; + T9 a9_; + group9(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9) + : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8),a9_(a9) + {} +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group9& x) +{ + os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_<< x.a9_; + return os; +} + +template +struct group10 +{ + T1 a1_; + T2 a2_; + T3 a3_; + T4 a4_; + T5 a5_; + T6 a6_; + T7 a7_; + T8 a8_; + T9 a9_; + T10 a10_; + group10(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9,T10 a10) + : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8),a9_(a9),a10_(a10) + {} +}; + +template +inline +AUTOBOOST_IO_STD basic_ostream& +operator << (AUTOBOOST_IO_STD basic_ostream& os, + const group10& x) +{ + os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_<< x.a9_<< x.a10_; + return os; +} + + + + +template +inline +group1 +group_head( group2 const& x) +{ + return group1 (x.a1_); +} + +template +inline +group1 +group_last( group2 const& x) +{ + return group1 (x.a2_); +} + + + +template +inline +group2 +group_head( group3 const& x) +{ + return group2 (x.a1_,x.a2_); +} + +template +inline +group1 +group_last( group3 const& x) +{ + return group1 (x.a3_); +} + + + +template +inline +group3 +group_head( group4 const& x) +{ + return group3 (x.a1_,x.a2_,x.a3_); +} + +template +inline +group1 +group_last( group4 const& x) +{ + return group1 (x.a4_); +} + + + +template +inline +group4 +group_head( group5 const& x) +{ + return group4 (x.a1_,x.a2_,x.a3_,x.a4_); +} + +template +inline +group1 +group_last( group5 const& x) +{ + return group1 (x.a5_); +} + + + +template +inline +group5 +group_head( group6 const& x) +{ + return group5 (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_); +} + +template +inline +group1 +group_last( group6 const& x) +{ + return group1 (x.a6_); +} + + + +template +inline +group6 +group_head( group7 const& x) +{ + return group6 (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_); +} + +template +inline +group1 +group_last( group7 const& x) +{ + return group1 (x.a7_); +} + + + +template +inline +group7 +group_head( group8 const& x) +{ + return group7 (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_); +} + +template +inline +group1 +group_last( group8 const& x) +{ + return group1 (x.a8_); +} + + + +template +inline +group8 +group_head( group9 const& x) +{ + return group8 (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_,x.a8_); +} + +template +inline +group1 +group_last( group9 const& x) +{ + return group1 (x.a9_); +} + + + +template +inline +group9 +group_head( group10 const& x) +{ + return group9 (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_,x.a8_,x.a9_); +} + +template +inline +group1 +group_last( group10 const& x) +{ + return group1 (x.a10_); +} + + + + + +} // namespace detail + + + +// helper functions + + +inline detail::group1< detail::group0 > +group() { return detail::group1< detail::group0 > ( detail::group0() ); } + +template +inline +detail::group1< detail::group2 > + group(T1 a1, Var const& var) +{ + return detail::group1< detail::group2 > + ( detail::group2 + (a1, var) + ); +} + +template +inline +detail::group1< detail::group3 > + group(T1 a1,T2 a2, Var const& var) +{ + return detail::group1< detail::group3 > + ( detail::group3 + (a1,a2, var) + ); +} + +template +inline +detail::group1< detail::group4 > + group(T1 a1,T2 a2,T3 a3, Var const& var) +{ + return detail::group1< detail::group4 > + ( detail::group4 + (a1,a2,a3, var) + ); +} + +template +inline +detail::group1< detail::group5 > + group(T1 a1,T2 a2,T3 a3,T4 a4, Var const& var) +{ + return detail::group1< detail::group5 > + ( detail::group5 + (a1,a2,a3,a4, var) + ); +} + +template +inline +detail::group1< detail::group6 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5, Var const& var) +{ + return detail::group1< detail::group6 > + ( detail::group6 + (a1,a2,a3,a4,a5, var) + ); +} + +template +inline +detail::group1< detail::group7 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6, Var const& var) +{ + return detail::group1< detail::group7 > + ( detail::group7 + (a1,a2,a3,a4,a5,a6, var) + ); +} + +template +inline +detail::group1< detail::group8 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7, Var const& var) +{ + return detail::group1< detail::group8 > + ( detail::group8 + (a1,a2,a3,a4,a5,a6,a7, var) + ); +} + +template +inline +detail::group1< detail::group9 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8, Var const& var) +{ + return detail::group1< detail::group9 > + ( detail::group9 + (a1,a2,a3,a4,a5,a6,a7,a8, var) + ); +} + +template +inline +detail::group1< detail::group10 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9, Var const& var) +{ + return detail::group1< detail::group10 > + ( detail::group10 + (a1,a2,a3,a4,a5,a6,a7,a8,a9, var) + ); +} + + +#ifndef AUTOBOOST_NO_OVERLOAD_FOR_NON_CONST + +template +inline +detail::group1< detail::group2 > + group(T1 a1, Var& var) +{ + return detail::group1< detail::group2 > + ( detail::group2 + (a1, var) + ); +} + +template +inline +detail::group1< detail::group3 > + group(T1 a1,T2 a2, Var& var) +{ + return detail::group1< detail::group3 > + ( detail::group3 + (a1,a2, var) + ); +} + +template +inline +detail::group1< detail::group4 > + group(T1 a1,T2 a2,T3 a3, Var& var) +{ + return detail::group1< detail::group4 > + ( detail::group4 + (a1,a2,a3, var) + ); +} + +template +inline +detail::group1< detail::group5 > + group(T1 a1,T2 a2,T3 a3,T4 a4, Var& var) +{ + return detail::group1< detail::group5 > + ( detail::group5 + (a1,a2,a3,a4, var) + ); +} + +template +inline +detail::group1< detail::group6 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5, Var& var) +{ + return detail::group1< detail::group6 > + ( detail::group6 + (a1,a2,a3,a4,a5, var) + ); +} + +template +inline +detail::group1< detail::group7 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6, Var& var) +{ + return detail::group1< detail::group7 > + ( detail::group7 + (a1,a2,a3,a4,a5,a6, var) + ); +} + +template +inline +detail::group1< detail::group8 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7, Var& var) +{ + return detail::group1< detail::group8 > + ( detail::group8 + (a1,a2,a3,a4,a5,a6,a7, var) + ); +} + +template +inline +detail::group1< detail::group9 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8, Var& var) +{ + return detail::group1< detail::group9 > + ( detail::group9 + (a1,a2,a3,a4,a5,a6,a7,a8, var) + ); +} + +template +inline +detail::group1< detail::group10 > + group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9, Var& var) +{ + return detail::group1< detail::group10 > + ( detail::group10 + (a1,a2,a3,a4,a5,a6,a7,a8,a9, var) + ); +} + + +#endif // - AUTOBOOST_NO_OVERLOAD_FOR_NON_CONST + + +} // namespace io + +} // namespace autoboost + + +#endif // AUTOBOOST_FORMAT_GROUP_HPP diff --git a/contrib/autoboost/autoboost/format/internals.hpp b/contrib/autoboost/autoboost/format/internals.hpp new file mode 100644 index 000000000..a63866a3f --- /dev/null +++ b/contrib/autoboost/autoboost/format/internals.hpp @@ -0,0 +1,202 @@ +// ---------------------------------------------------------------------------- +// internals.hpp : internal structs : stream_format_state, format_item. +// included by format.hpp +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_INTERNALS_HPP +#define AUTOBOOST_FORMAT_INTERNALS_HPP + + +#include +#include +#include +#include +#include +#include // used as a dummy stream + +namespace autoboost { +namespace io { +namespace detail { + + +//---- stream_format_state --------------------------------------------------// + +// set of params that define the format state of a stream + template + struct stream_format_state + { + typedef AUTOBOOST_IO_STD basic_ios basic_ios; + + stream_format_state(Ch fill) { reset(fill); } +// stream_format_state(const basic_ios& os) { set_by_stream(os); } + + void reset(Ch fill); //- sets to default state. + void set_by_stream(const basic_ios& os); //- sets to os's state. + void apply_on(basic_ios & os, //- applies format_state to the stream + autoboost::io::detail::locale_t * loc_default = 0) const; + template + void apply_manip(T manipulator) //- modifies state by applying manipulator + { apply_manip_body( *this, manipulator) ; } + + // --- data --- + std::streamsize width_; + std::streamsize precision_; + Ch fill_; + std::ios_base::fmtflags flags_; + std::ios_base::iostate rdstate_; + std::ios_base::iostate exceptions_; + autoboost::optional loc_; + }; + + +//---- format_item ---------------------------------------------------------// + +// stores all parameters that can be specified in format strings + template + struct format_item + { + enum pad_values { zeropad = 1, spacepad =2, centered=4, tabulation = 8 }; + // 1. if zeropad is set, all other bits are not, + // 2. if tabulation is set, all others are not. + // centered and spacepad can be mixed freely. + enum arg_values { argN_no_posit = -1, // non-positional directive. will set argN later + argN_tabulation = -2, // tabulation directive. (no argument read) + argN_ignored = -3 // ignored directive. (no argument read) + }; + typedef AUTOBOOST_IO_STD basic_ios basic_ios; + typedef detail::stream_format_state stream_format_state; + typedef ::std::basic_string string_type; + + format_item(Ch fill) :argN_(argN_no_posit), fmtstate_(fill), + truncate_(max_streamsize()), pad_scheme_(0) {} + void reset(Ch fill); + void compute_states(); // sets states according to truncate and pad_scheme. + + static std::streamsize max_streamsize() { + return (std::numeric_limits::max)(); + } + + // --- data --- + int argN_; //- argument number (starts at 0, eg : %1 => argN=0) + // negative values for items that don't process an argument + string_type res_; //- result of the formatting of this item + string_type appendix_; //- piece of string between this item and the next + + stream_format_state fmtstate_;// set by parsing, is only affected by modify_item + + std::streamsize truncate_;//- is set for directives like %.5s that ask truncation + unsigned int pad_scheme_;//- several possible padding schemes can mix. see pad_values + }; + + + +//--- Definitions ------------------------------------------------------------ + +// - stream_format_state:: ------------------------------------------------- + template + void stream_format_state:: apply_on (basic_ios & os, + autoboost::io::detail::locale_t * loc_default) const { + // If a locale is available, set it first. "os.fill(fill_);" may chrash otherwise. +#if !defined(AUTOBOOST_NO_STD_LOCALE) + if(loc_) + os.imbue(loc_.get()); + else if(loc_default) + os.imbue(*loc_default); +#else + (void) loc_default; // keep compiler quiet if we don't support locales +#endif + // set the state of this stream according to our params + if(width_ != -1) + os.width(width_); + if(precision_ != -1) + os.precision(precision_); + if(fill_ != 0) + os.fill(fill_); + os.flags(flags_); + os.clear(rdstate_); + os.exceptions(exceptions_); + } + + template + void stream_format_state:: set_by_stream(const basic_ios& os) { + // set our params according to the state of this stream + flags_ = os.flags(); + width_ = os.width(); + precision_ = os.precision(); + fill_ = os.fill(); + rdstate_ = os.rdstate(); + exceptions_ = os.exceptions(); + } + + + template + void apply_manip_body( stream_format_state& self, + T manipulator) { + // modify our params according to the manipulator + basic_oaltstringstream ss; + self.apply_on( ss ); + ss << manipulator; + self.set_by_stream( ss ); + } + + template inline + void stream_format_state:: reset(Ch fill) { + // set our params to standard's default state. cf 27.4.4.1 of the C++ norm + width_=0; precision_=6; + fill_=fill; // default is widen(' '), but we cant compute it without the locale + flags_ = std::ios_base::dec | std::ios_base::skipws; + // the adjust_field part is left equal to 0, which means right. + exceptions_ = std::ios_base::goodbit; + rdstate_ = std::ios_base::goodbit; + } + + +// --- format_item:: -------------------------------------------------------- + + template + void format_item:: + reset (Ch fill) { + argN_=argN_no_posit; truncate_ = max_streamsize(); pad_scheme_ =0; + res_.resize(0); appendix_.resize(0); + fmtstate_.reset(fill); + } + + template + void format_item:: + compute_states() { + // reflect pad_scheme_ on fmt_state_ + // because some pad_schemes has complex consequences on several state params. + if(pad_scheme_ & zeropad) { + // ignore zeropad in left alignment : + if(fmtstate_.flags_ & std::ios_base::left) { + AUTOBOOST_ASSERT(!(fmtstate_.flags_ &(std::ios_base::adjustfield ^std::ios_base::left))); + // only left bit might be set. (not right, nor internal) + pad_scheme_ = pad_scheme_ & (~zeropad); + } + else { + pad_scheme_ &= ~spacepad; // printf ignores spacepad when zeropadding + fmtstate_.fill_='0'; + fmtstate_.flags_ = (fmtstate_.flags_ & ~std::ios_base::adjustfield) + | std::ios_base::internal; + // removes all adjustfield bits, and adds internal. + } + } + if(pad_scheme_ & spacepad) { + if(fmtstate_.flags_ & std::ios_base::showpos) + pad_scheme_ &= ~spacepad; + } + } + + +} } } // namespaces autoboost :: io :: detail + + +#endif // AUTOBOOST_FORMAT_INTERNALS_HPP diff --git a/contrib/autoboost/autoboost/format/internals_fwd.hpp b/contrib/autoboost/autoboost/format/internals_fwd.hpp new file mode 100644 index 000000000..54be1ba36 --- /dev/null +++ b/contrib/autoboost/autoboost/format/internals_fwd.hpp @@ -0,0 +1,64 @@ +// ---------------------------------------------------------------------------- +// internals_fwd.hpp : forward declarations, for internal headers +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_INTERNAL_FWD_HPP +#define AUTOBOOST_FORMAT_INTERNAL_FWD_HPP + +#include +#include + + +namespace autoboost { +namespace io { + +namespace detail { + template struct stream_format_state; + template struct format_item; + + + // these functions were intended as methods, + // but MSVC have problems with template member functions : + // defined in format_implementation.hpp : + template + basic_format& + modify_item_body (basic_format& self, + int itemN, T manipulator); + + template + basic_format& + bind_arg_body (basic_format& self, + int argN, const T& val); + + // in internals.hpp : + template + void apply_manip_body (stream_format_state& self, + T manipulator); + + // argument feeding (defined in feed_args.hpp ) : + template + void distribute (basic_format& self, T x); + + template + basic_format& + feed (basic_format& self, T x); + + template + basic_format& + feed_impl (basic_format& self, T x); + +} // namespace detail + +} // namespace io +} // namespace autoboost + + +#endif // AUTOBOOST_FORMAT_INTERNAL_FWD_HPP diff --git a/contrib/autoboost/autoboost/format/parsing.hpp b/contrib/autoboost/autoboost/format/parsing.hpp new file mode 100644 index 000000000..22835c005 --- /dev/null +++ b/contrib/autoboost/autoboost/format/parsing.hpp @@ -0,0 +1,500 @@ +// ---------------------------------------------------------------------------- +// parsing.hpp : implementation of the parsing member functions +// ( parse, parse_printf_directive) +// ---------------------------------------------------------------------------- + +// Copyright Samuel Krempp 2003. Use, modification, and distribution are +// subject to 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/libs/format for library home page + +// ---------------------------------------------------------------------------- + +#ifndef AUTOBOOST_FORMAT_PARSING_HPP +#define AUTOBOOST_FORMAT_PARSING_HPP + + +#include +#include +#include +#include + + +namespace autoboost { +namespace io { +namespace detail { + +#if defined(AUTOBOOST_NO_STD_LOCALE) + // streams will be used for narrow / widen. but these methods are not const + template + T& const_or_not(const T& x) { + return const_cast (x); + } +#else + template + const T& const_or_not(const T& x) { + return x; + } +#endif + + template inline + char wrap_narrow(const Facet& fac, Ch c, char deflt) { + return const_or_not(fac).narrow(c, deflt); + } + + template inline + bool wrap_isdigit(const Facet& fac, Ch c) { +#if ! defined( AUTOBOOST_NO_LOCALE_ISDIGIT ) + return fac.is(std::ctype::digit, c); +# else + (void) fac; // remove "unused parameter" warning + using namespace std; + return isdigit(c); +#endif + } + + template + Iter wrap_scan_notdigit(const Facet & fac, Iter beg, Iter end) { + using namespace std; + for( ; beg!=end && wrap_isdigit(fac, *beg); ++beg) ; + return beg; + } + + + // Input : [start, last) iterators range and a + // a Facet to use its widen/narrow member function + // Effects : read sequence and convert digits into integral n, of type Res + // Returns : n + template + Iter str2int (const Iter & start, const Iter & last, Res & res, + const Facet& fac) + { + using namespace std; + Iter it; + res=0; + for(it=start; it != last && wrap_isdigit(fac, *it); ++it ) { + char cur_ch = wrap_narrow(fac, *it, 0); // cant fail. + res *= 10; + res += cur_ch - '0'; // 22.2.1.1.2.13 of the C++ standard + } + return it; + } + + // skip printf's "asterisk-fields" directives in the format-string buf + // Input : char string, with starting index *pos_p + // a Facet merely to use its widen/narrow member function + // Effects : advance *pos_p by skipping printf's asterisk fields. + // Returns : nothing + template + Iter skip_asterisk(Iter start, Iter last, const Facet& fac) + { + using namespace std; + ++ start; + start = wrap_scan_notdigit(fac, start, last); + if(start!=last && *start== const_or_not(fac).widen( '$') ) + ++start; + return start; + } + + + // auxiliary func called by parse_printf_directive + // for centralising error handling + // it either throws if user sets the corresponding flag, or does nothing. + inline void maybe_throw_exception(unsigned char exceptions, + std::size_t pos, std::size_t size) + { + if(exceptions & io::bad_format_string_bit) + autoboost::throw_exception(io::bad_format_string(pos, size) ); + } + + + // Input: the position of a printf-directive in the format-string + // a basic_ios& merely to use its widen/narrow member function + // a bitset'exceptions' telling whether to throw exceptions on errors. + // Returns: + // true if parse succeeded (ignore some errors if exceptions disabled) + // false if it failed so bad that the directive should be printed verbatim + // Effects: + // start is incremented so that *start is the first char after + // this directive + // *fpar is set with the parameters read in the directive + template + bool parse_printf_directive(Iter & start, const Iter& last, + detail::format_item * fpar, + const Facet& fac, + std::size_t offset, unsigned char exceptions) + { + typedef typename basic_format::format_item_t format_item_t; + + fpar->argN_ = format_item_t::argN_no_posit; // if no positional-directive + bool precision_set = false; + bool in_brackets=false; + Iter start0 = start; + std::size_t fstring_size = last-start0+offset; + + if(start>= last) { // empty directive : this is a trailing % + maybe_throw_exception(exceptions, start-start0 + offset, fstring_size); + return false; + } + + if(*start== const_or_not(fac).widen( '|')) { + in_brackets=true; + if( ++start >= last ) { + maybe_throw_exception(exceptions, start-start0 + offset, fstring_size); + return false; + } + } + + // the flag '0' would be picked as a digit for argument order, but here it's a flag : + if(*start== const_or_not(fac).widen( '0')) + goto parse_flags; + + // handle argument order (%2$d) or possibly width specification: %2d + if(wrap_isdigit(fac, *start)) { + int n; + start = str2int(start, last, n, fac); + if( start >= last ) { + maybe_throw_exception(exceptions, start-start0+offset, fstring_size); + return false; + } + + // %N% case : this is already the end of the directive + if( *start == const_or_not(fac).widen( '%') ) { + fpar->argN_ = n-1; + ++start; + if( in_brackets) + maybe_throw_exception(exceptions, start-start0+offset, fstring_size); + // but don't return. maybe "%" was used in lieu of '$', so we go on. + else + return true; + } + + if ( *start== const_or_not(fac).widen( '$') ) { + fpar->argN_ = n-1; + ++start; + } + else { + // non-positionnal directive + fpar->fmtstate_.width_ = n; + fpar->argN_ = format_item_t::argN_no_posit; + goto parse_precision; + } + } + + parse_flags: + // handle flags + while ( start != last) { // as long as char is one of + - = _ # 0 l h or ' ' + // misc switches + switch ( wrap_narrow(fac, *start, 0)) { + case '\'' : break; // no effect yet. (painful to implement) + case 'l': + case 'h': // short/long modifier : for printf-comaptibility (no action needed) + break; + case '-': + fpar->fmtstate_.flags_ |= std::ios_base::left; + break; + case '=': + fpar->pad_scheme_ |= format_item_t::centered; + break; + case '_': + fpar->fmtstate_.flags_ |= std::ios_base::internal; + break; + case ' ': + fpar->pad_scheme_ |= format_item_t::spacepad; + break; + case '+': + fpar->fmtstate_.flags_ |= std::ios_base::showpos; + break; + case '0': + fpar->pad_scheme_ |= format_item_t::zeropad; + // need to know alignment before really setting flags, + // so just add 'zeropad' flag for now, it will be processed later. + break; + case '#': + fpar->fmtstate_.flags_ |= std::ios_base::showpoint | std::ios_base::showbase; + break; + default: + goto parse_width; + } + ++start; + } // loop on flag. + + if( start>=last) { + maybe_throw_exception(exceptions, start-start0+offset, fstring_size); + return true; + } + parse_width: + // handle width spec + // first skip 'asterisk fields' : *, or *N$ + if(*start == const_or_not(fac).widen( '*') ) + start = skip_asterisk(start, last, fac); + if(start!=last && wrap_isdigit(fac, *start)) + start = str2int(start, last, fpar->fmtstate_.width_, fac); + + parse_precision: + if( start>= last) { + maybe_throw_exception(exceptions, start-start0+offset, fstring_size); + return true; + } + // handle precision spec + if (*start== const_or_not(fac).widen( '.')) { + ++start; + if(start != last && *start == const_or_not(fac).widen( '*') ) + start = skip_asterisk(start, last, fac); + if(start != last && wrap_isdigit(fac, *start)) { + start = str2int(start, last, fpar->fmtstate_.precision_, fac); + precision_set = true; + } + else + fpar->fmtstate_.precision_ =0; + } + + // handle formatting-type flags : + while( start != last && ( *start== const_or_not(fac).widen( 'l') + || *start== const_or_not(fac).widen( 'L') + || *start== const_or_not(fac).widen( 'h')) ) + ++start; + if( start>=last) { + maybe_throw_exception(exceptions, start-start0+offset, fstring_size); + return true; + } + + if( in_brackets && *start== const_or_not(fac).widen( '|') ) { + ++start; + return true; + } + switch ( wrap_narrow(fac, *start, 0) ) { + case 'X': + fpar->fmtstate_.flags_ |= std::ios_base::uppercase; + case 'p': // pointer => set hex. + case 'x': + fpar->fmtstate_.flags_ &= ~std::ios_base::basefield; + fpar->fmtstate_.flags_ |= std::ios_base::hex; + break; + + case 'o': + fpar->fmtstate_.flags_ &= ~std::ios_base::basefield; + fpar->fmtstate_.flags_ |= std::ios_base::oct; + break; + + case 'E': + fpar->fmtstate_.flags_ |= std::ios_base::uppercase; + case 'e': + fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield; + fpar->fmtstate_.flags_ |= std::ios_base::scientific; + + fpar->fmtstate_.flags_ &= ~std::ios_base::basefield; + fpar->fmtstate_.flags_ |= std::ios_base::dec; + break; + + case 'f': + fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield; + fpar->fmtstate_.flags_ |= std::ios_base::fixed; + case 'u': + case 'd': + case 'i': + fpar->fmtstate_.flags_ &= ~std::ios_base::basefield; + fpar->fmtstate_.flags_ |= std::ios_base::dec; + break; + + case 'T': + ++start; + if( start >= last) + maybe_throw_exception(exceptions, start-start0+offset, fstring_size); + else + fpar->fmtstate_.fill_ = *start; + fpar->pad_scheme_ |= format_item_t::tabulation; + fpar->argN_ = format_item_t::argN_tabulation; + break; + case 't': + fpar->fmtstate_.fill_ = const_or_not(fac).widen( ' '); + fpar->pad_scheme_ |= format_item_t::tabulation; + fpar->argN_ = format_item_t::argN_tabulation; + break; + + case 'G': + fpar->fmtstate_.flags_ |= std::ios_base::uppercase; + break; + case 'g': // 'g' conversion is default for floats. + fpar->fmtstate_.flags_ &= ~std::ios_base::basefield; + fpar->fmtstate_.flags_ |= std::ios_base::dec; + + // CLEAR all floatield flags, so stream will CHOOSE + fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield; + break; + + case 'C': + case 'c': + fpar->truncate_ = 1; + break; + case 'S': + case 's': + if(precision_set) // handle truncation manually, with own parameter. + fpar->truncate_ = fpar->fmtstate_.precision_; + fpar->fmtstate_.precision_ = 6; // default stream precision. + break; + case 'n' : + fpar->argN_ = format_item_t::argN_ignored; + break; + default: + maybe_throw_exception(exceptions, start-start0+offset, fstring_size); + } + ++start; + + if( in_brackets ) { + if( start != last && *start== const_or_not(fac).widen( '|') ) { + ++start; + return true; + } + else maybe_throw_exception(exceptions, start-start0+offset, fstring_size); + } + return true; + } + // -end parse_printf_directive() + + template + int upper_bound_from_fstring(const String& buf, + const typename String::value_type arg_mark, + const Facet& fac, + unsigned char exceptions) + { + // quick-parsing of the format-string to count arguments mark (arg_mark, '%') + // returns : upper bound on the number of format items in the format strings + using namespace autoboost::io; + typename String::size_type i1=0; + int num_items=0; + while( (i1=buf.find(arg_mark,i1)) != String::npos ) { + if( i1+1 >= buf.size() ) { + if(exceptions & bad_format_string_bit) + autoboost::throw_exception(bad_format_string(i1, buf.size() )); // must not end in ".. %" + else { + ++num_items; + break; + } + } + if(buf[i1+1] == buf[i1] ) {// escaped "%%" + i1+=2; continue; + } + + ++i1; + // in case of %N% directives, dont count it double (wastes allocations..) : + i1 = detail::wrap_scan_notdigit(fac, buf.begin()+i1, buf.end()) - buf.begin(); + if( i1 < buf.size() && buf[i1] == arg_mark ) + ++i1; + ++num_items; + } + return num_items; + } + template inline + void append_string(String& dst, const String& src, + const typename String::size_type beg, + const typename String::size_type end) { + dst.append(src.begin()+beg, src.begin()+end); + } + +} // detail namespace +} // io namespace + + + +// ----------------------------------------------- +// format :: parse(..) + + template + basic_format& basic_format:: + parse (const string_type& buf) { + // parse the format-string + using namespace std; +#if !defined(AUTOBOOST_NO_STD_LOCALE) + const std::ctype & fac = AUTOBOOST_USE_FACET( std::ctype, getloc()); +#else + io::basic_oaltstringstream fac; + //has widen and narrow even on compilers without locale +#endif + + const Ch arg_mark = io::detail::const_or_not(fac).widen( '%'); + bool ordered_args=true; + int max_argN=-1; + + // A: find upper_bound on num_items and allocates arrays + int num_items = io::detail::upper_bound_from_fstring(buf, arg_mark, fac, exceptions()); + make_or_reuse_data(num_items); + + // B: Now the real parsing of the format string : + num_items=0; + typename string_type::size_type i0=0, i1=0; + typename string_type::const_iterator it; + bool special_things=false; + int cur_item=0; + while( (i1=buf.find(arg_mark,i1)) != string_type::npos ) { + string_type & piece = (cur_item==0) ? prefix_ : items_[cur_item-1].appendix_; + if( buf[i1+1] == buf[i1] ) { // escaped mark, '%%' + io::detail::append_string(piece, buf, i0, i1+1); + i1+=2; i0=i1; + continue; + } + AUTOBOOST_ASSERT( static_cast(cur_item) < items_.size() || cur_item==0); + + if(i1!=i0) { + io::detail::append_string(piece, buf, i0, i1); + i0=i1; + } + ++i1; + it = buf.begin()+i1; + bool parse_ok = io::detail::parse_printf_directive( + it, buf.end(), &items_[cur_item], fac, i1, exceptions()); + i1 = it - buf.begin(); + if( ! parse_ok ) // the directive will be printed verbatim + continue; + i0=i1; + items_[cur_item].compute_states(); // process complex options, like zeropad, into params + + int argN=items_[cur_item].argN_; + if(argN == format_item_t::argN_ignored) + continue; + if(argN ==format_item_t::argN_no_posit) + ordered_args=false; + else if(argN == format_item_t::argN_tabulation) special_things=true; + else if(argN > max_argN) max_argN = argN; + ++num_items; + ++cur_item; + } // loop on %'s + AUTOBOOST_ASSERT(cur_item == num_items); + + // store the final piece of string + { + string_type & piece = (cur_item==0) ? prefix_ : items_[cur_item-1].appendix_; + io::detail::append_string(piece, buf, i0, buf.size()); + } + + if( !ordered_args) { + if(max_argN >= 0 ) { // dont mix positional with non-positionnal directives + if(exceptions() & io::bad_format_string_bit) + autoboost::throw_exception(io::bad_format_string(max_argN, 0)); + // else do nothing. => positionnal arguments are processed as non-positionnal + } + // set things like it would have been with positional directives : + int non_ordered_items = 0; + for(int i=0; i< num_items; ++i) + if(items_[i].argN_ == format_item_t::argN_no_posit) { + items_[i].argN_ = non_ordered_items; + ++non_ordered_items; + } + max_argN = non_ordered_items-1; + } + + // C: set some member data : + items_.resize(num_items, format_item_t(io::detail::const_or_not(fac).widen( ' ')) ); + + if(special_things) style_ |= special_needs; + num_args_ = max_argN + 1; + if(ordered_args) style_ |= ordered; + else style_ &= ~ordered; + return *this; + } + +} // namespace autoboost + + +#endif // AUTOBOOST_FORMAT_PARSING_HPP diff --git a/contrib/autoboost/autoboost/function.hpp b/contrib/autoboost/autoboost/function.hpp new file mode 100644 index 000000000..b03075dcf --- /dev/null +++ b/contrib/autoboost/autoboost/function.hpp @@ -0,0 +1,66 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2001-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org/libs/function + +// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the +// design of this library. + +#include // unary_function, binary_function + +#include +#include + +#ifndef AUTOBOOST_FUNCTION_MAX_ARGS +# define AUTOBOOST_FUNCTION_MAX_ARGS 10 +#endif // AUTOBOOST_FUNCTION_MAX_ARGS + +// Include the prologue here so that the use of file-level iteration +// in anything that may be included by function_template.hpp doesn't break +#include + +// Older Visual Age C++ version do not handle the file iteration well +#if AUTOBOOST_WORKAROUND(__IBMCPP__, >= 500) && AUTOBOOST_WORKAROUND(__IBMCPP__, < 800) +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 0 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 1 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 2 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 3 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 4 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 5 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 6 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 7 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 8 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 9 +# include +# endif +# if AUTOBOOST_FUNCTION_MAX_ARGS >= 10 +# include +# endif +#else +// What is the '3' for? +# define AUTOBOOST_PP_ITERATION_PARAMS_1 (3,(0,AUTOBOOST_FUNCTION_MAX_ARGS,)) +# include AUTOBOOST_PP_ITERATE() +# undef AUTOBOOST_PP_ITERATION_PARAMS_1 +#endif diff --git a/contrib/autoboost/autoboost/function/detail/function_iterate.hpp b/contrib/autoboost/autoboost/function/detail/function_iterate.hpp new file mode 100644 index 000000000..da97472fa --- /dev/null +++ b/contrib/autoboost/autoboost/function/detail/function_iterate.hpp @@ -0,0 +1,16 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org +#if !defined(AUTOBOOST_PP_IS_ITERATING) +# error Boost.Function - do not include this file! +#endif + +#define AUTOBOOST_FUNCTION_NUM_ARGS AUTOBOOST_PP_ITERATION() +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS + diff --git a/contrib/autoboost/boost/function/detail/gen_maybe_include.pl b/contrib/autoboost/autoboost/function/detail/gen_maybe_include.pl similarity index 81% rename from contrib/autoboost/boost/function/detail/gen_maybe_include.pl rename to contrib/autoboost/autoboost/function/detail/gen_maybe_include.pl index d0629205e..d1ec8623d 100644 --- a/contrib/autoboost/boost/function/detail/gen_maybe_include.pl +++ b/contrib/autoboost/autoboost/function/detail/gen_maybe_include.pl @@ -26,10 +26,10 @@ else { print OUT "#elif"; } - print OUT " BOOST_FUNCTION_NUM_ARGS == $on_arg\n"; - print OUT "# ifndef BOOST_FUNCTION_$on_arg\n"; - print OUT "# define BOOST_FUNCTION_$on_arg\n"; - print OUT "# include \n"; + print OUT " AUTOBOOST_FUNCTION_NUM_ARGS == $on_arg\n"; + print OUT "# ifndef AUTOBOOST_FUNCTION_$on_arg\n"; + print OUT "# define AUTOBOOST_FUNCTION_$on_arg\n"; + print OUT "# include \n"; print OUT "# endif\n"; } print OUT "#else\n"; diff --git a/contrib/autoboost/autoboost/function/detail/maybe_include.hpp b/contrib/autoboost/autoboost/function/detail/maybe_include.hpp new file mode 100644 index 000000000..c1892b373 --- /dev/null +++ b/contrib/autoboost/autoboost/function/detail/maybe_include.hpp @@ -0,0 +1,267 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#if AUTOBOOST_FUNCTION_NUM_ARGS == 0 +# ifndef AUTOBOOST_FUNCTION_0 +# define AUTOBOOST_FUNCTION_0 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 1 +# ifndef AUTOBOOST_FUNCTION_1 +# define AUTOBOOST_FUNCTION_1 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 2 +# ifndef AUTOBOOST_FUNCTION_2 +# define AUTOBOOST_FUNCTION_2 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 3 +# ifndef AUTOBOOST_FUNCTION_3 +# define AUTOBOOST_FUNCTION_3 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 4 +# ifndef AUTOBOOST_FUNCTION_4 +# define AUTOBOOST_FUNCTION_4 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 5 +# ifndef AUTOBOOST_FUNCTION_5 +# define AUTOBOOST_FUNCTION_5 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 6 +# ifndef AUTOBOOST_FUNCTION_6 +# define AUTOBOOST_FUNCTION_6 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 7 +# ifndef AUTOBOOST_FUNCTION_7 +# define AUTOBOOST_FUNCTION_7 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 8 +# ifndef AUTOBOOST_FUNCTION_8 +# define AUTOBOOST_FUNCTION_8 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 9 +# ifndef AUTOBOOST_FUNCTION_9 +# define AUTOBOOST_FUNCTION_9 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 10 +# ifndef AUTOBOOST_FUNCTION_10 +# define AUTOBOOST_FUNCTION_10 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 11 +# ifndef AUTOBOOST_FUNCTION_11 +# define AUTOBOOST_FUNCTION_11 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 12 +# ifndef AUTOBOOST_FUNCTION_12 +# define AUTOBOOST_FUNCTION_12 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 13 +# ifndef AUTOBOOST_FUNCTION_13 +# define AUTOBOOST_FUNCTION_13 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 14 +# ifndef AUTOBOOST_FUNCTION_14 +# define AUTOBOOST_FUNCTION_14 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 15 +# ifndef AUTOBOOST_FUNCTION_15 +# define AUTOBOOST_FUNCTION_15 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 16 +# ifndef AUTOBOOST_FUNCTION_16 +# define AUTOBOOST_FUNCTION_16 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 17 +# ifndef AUTOBOOST_FUNCTION_17 +# define AUTOBOOST_FUNCTION_17 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 18 +# ifndef AUTOBOOST_FUNCTION_18 +# define AUTOBOOST_FUNCTION_18 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 19 +# ifndef AUTOBOOST_FUNCTION_19 +# define AUTOBOOST_FUNCTION_19 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 20 +# ifndef AUTOBOOST_FUNCTION_20 +# define AUTOBOOST_FUNCTION_20 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 21 +# ifndef AUTOBOOST_FUNCTION_21 +# define AUTOBOOST_FUNCTION_21 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 22 +# ifndef AUTOBOOST_FUNCTION_22 +# define AUTOBOOST_FUNCTION_22 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 23 +# ifndef AUTOBOOST_FUNCTION_23 +# define AUTOBOOST_FUNCTION_23 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 24 +# ifndef AUTOBOOST_FUNCTION_24 +# define AUTOBOOST_FUNCTION_24 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 25 +# ifndef AUTOBOOST_FUNCTION_25 +# define AUTOBOOST_FUNCTION_25 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 26 +# ifndef AUTOBOOST_FUNCTION_26 +# define AUTOBOOST_FUNCTION_26 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 27 +# ifndef AUTOBOOST_FUNCTION_27 +# define AUTOBOOST_FUNCTION_27 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 28 +# ifndef AUTOBOOST_FUNCTION_28 +# define AUTOBOOST_FUNCTION_28 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 29 +# ifndef AUTOBOOST_FUNCTION_29 +# define AUTOBOOST_FUNCTION_29 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 30 +# ifndef AUTOBOOST_FUNCTION_30 +# define AUTOBOOST_FUNCTION_30 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 31 +# ifndef AUTOBOOST_FUNCTION_31 +# define AUTOBOOST_FUNCTION_31 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 32 +# ifndef AUTOBOOST_FUNCTION_32 +# define AUTOBOOST_FUNCTION_32 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 33 +# ifndef AUTOBOOST_FUNCTION_33 +# define AUTOBOOST_FUNCTION_33 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 34 +# ifndef AUTOBOOST_FUNCTION_34 +# define AUTOBOOST_FUNCTION_34 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 35 +# ifndef AUTOBOOST_FUNCTION_35 +# define AUTOBOOST_FUNCTION_35 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 36 +# ifndef AUTOBOOST_FUNCTION_36 +# define AUTOBOOST_FUNCTION_36 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 37 +# ifndef AUTOBOOST_FUNCTION_37 +# define AUTOBOOST_FUNCTION_37 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 38 +# ifndef AUTOBOOST_FUNCTION_38 +# define AUTOBOOST_FUNCTION_38 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 39 +# ifndef AUTOBOOST_FUNCTION_39 +# define AUTOBOOST_FUNCTION_39 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 40 +# ifndef AUTOBOOST_FUNCTION_40 +# define AUTOBOOST_FUNCTION_40 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 41 +# ifndef AUTOBOOST_FUNCTION_41 +# define AUTOBOOST_FUNCTION_41 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 42 +# ifndef AUTOBOOST_FUNCTION_42 +# define AUTOBOOST_FUNCTION_42 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 43 +# ifndef AUTOBOOST_FUNCTION_43 +# define AUTOBOOST_FUNCTION_43 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 44 +# ifndef AUTOBOOST_FUNCTION_44 +# define AUTOBOOST_FUNCTION_44 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 45 +# ifndef AUTOBOOST_FUNCTION_45 +# define AUTOBOOST_FUNCTION_45 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 46 +# ifndef AUTOBOOST_FUNCTION_46 +# define AUTOBOOST_FUNCTION_46 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 47 +# ifndef AUTOBOOST_FUNCTION_47 +# define AUTOBOOST_FUNCTION_47 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 48 +# ifndef AUTOBOOST_FUNCTION_48 +# define AUTOBOOST_FUNCTION_48 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 49 +# ifndef AUTOBOOST_FUNCTION_49 +# define AUTOBOOST_FUNCTION_49 +# include +# endif +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 50 +# ifndef AUTOBOOST_FUNCTION_50 +# define AUTOBOOST_FUNCTION_50 +# include +# endif +#else +# error Cannot handle Boost.Function objects that accept more than 50 arguments! +#endif diff --git a/contrib/autoboost/autoboost/function/detail/prologue.hpp b/contrib/autoboost/autoboost/function/detail/prologue.hpp new file mode 100644 index 000000000..e59c3d1ce --- /dev/null +++ b/contrib/autoboost/autoboost/function/detail/prologue.hpp @@ -0,0 +1,26 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#ifndef AUTOBOOST_FUNCTION_PROLOGUE_HPP +#define AUTOBOOST_FUNCTION_PROLOGUE_HPP +# include +# include +# include // unary_function, binary_function +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif // AUTOBOOST_FUNCTION_PROLOGUE_HPP diff --git a/contrib/autoboost/autoboost/function/function0.hpp b/contrib/autoboost/autoboost/function/function0.hpp new file mode 100644 index 000000000..2a22f6e09 --- /dev/null +++ b/contrib/autoboost/autoboost/function/function0.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 0 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function1.hpp b/contrib/autoboost/autoboost/function/function1.hpp new file mode 100644 index 000000000..82c21bd22 --- /dev/null +++ b/contrib/autoboost/autoboost/function/function1.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 1 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function10.hpp b/contrib/autoboost/autoboost/function/function10.hpp new file mode 100644 index 000000000..288f23a4c --- /dev/null +++ b/contrib/autoboost/autoboost/function/function10.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 10 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function2.hpp b/contrib/autoboost/autoboost/function/function2.hpp new file mode 100644 index 000000000..afe205c22 --- /dev/null +++ b/contrib/autoboost/autoboost/function/function2.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 2 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function3.hpp b/contrib/autoboost/autoboost/function/function3.hpp new file mode 100644 index 000000000..c2b21c650 --- /dev/null +++ b/contrib/autoboost/autoboost/function/function3.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 3 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function4.hpp b/contrib/autoboost/autoboost/function/function4.hpp new file mode 100644 index 000000000..d39bd95cf --- /dev/null +++ b/contrib/autoboost/autoboost/function/function4.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 4 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function5.hpp b/contrib/autoboost/autoboost/function/function5.hpp new file mode 100644 index 000000000..0511e7f8b --- /dev/null +++ b/contrib/autoboost/autoboost/function/function5.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 5 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function6.hpp b/contrib/autoboost/autoboost/function/function6.hpp new file mode 100644 index 000000000..d68772888 --- /dev/null +++ b/contrib/autoboost/autoboost/function/function6.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 6 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function7.hpp b/contrib/autoboost/autoboost/function/function7.hpp new file mode 100644 index 000000000..05ca3b2d2 --- /dev/null +++ b/contrib/autoboost/autoboost/function/function7.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 7 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function8.hpp b/contrib/autoboost/autoboost/function/function8.hpp new file mode 100644 index 000000000..c4545b012 --- /dev/null +++ b/contrib/autoboost/autoboost/function/function8.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 8 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/autoboost/function/function9.hpp b/contrib/autoboost/autoboost/function/function9.hpp new file mode 100644 index 000000000..daad348bc --- /dev/null +++ b/contrib/autoboost/autoboost/function/function9.hpp @@ -0,0 +1,12 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2002-2003. Use, modification and +// distribution is subject to 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) + +// For more information, see http://www.boost.org + +#define AUTOBOOST_FUNCTION_NUM_ARGS 9 +#include +#undef AUTOBOOST_FUNCTION_NUM_ARGS diff --git a/contrib/autoboost/boost/function/function_base.hpp b/contrib/autoboost/autoboost/function/function_base.hpp similarity index 88% rename from contrib/autoboost/boost/function/function_base.hpp rename to contrib/autoboost/autoboost/function/function_base.hpp index 5885bcb54..bd04f521d 100644 --- a/contrib/autoboost/boost/function/function_base.hpp +++ b/contrib/autoboost/autoboost/function/function_base.hpp @@ -8,79 +8,79 @@ // For more information, see http://www.boost.org -#ifndef BOOST_FUNCTION_BASE_HEADER -#define BOOST_FUNCTION_BASE_HEADER +#ifndef AUTOBOOST_FUNCTION_BASE_HEADER +#define AUTOBOOST_FUNCTION_BASE_HEADER #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef BOOST_NO_SFINAE -# include "boost/utility/enable_if.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef AUTOBOOST_NO_SFINAE +# include "autoboost/utility/enable_if.hpp" #else -# include "boost/mpl/bool.hpp" +# include "autoboost/mpl/bool.hpp" #endif -#include -#include +#include +#include -#if defined(BOOST_MSVC) +#if defined(AUTOBOOST_MSVC) # pragma warning( push ) # pragma warning( disable : 4793 ) // complaint about native code generation # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info. -#ifdef BOOST_NO_STD_TYPEINFO +// Define AUTOBOOST_FUNCTION_STD_NS to the namespace that contains type_info. +#ifdef AUTOBOOST_NO_STD_TYPEINFO // Embedded VC++ does not have type_info in namespace std -# define BOOST_FUNCTION_STD_NS +# define AUTOBOOST_FUNCTION_STD_NS #else -# define BOOST_FUNCTION_STD_NS std +# define AUTOBOOST_FUNCTION_STD_NS std #endif // Borrowed from Boost.Python library: determines the cases where we // need to use std::type_info::name to compare instead of operator==. -#if defined( BOOST_NO_TYPEID ) -# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) +#if defined( AUTOBOOST_NO_TYPEID ) +# define AUTOBOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) #elif defined(__GNUC__) \ || defined(_AIX) \ || ( defined(__sgi) && defined(__host_mips)) # include -# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) \ +# define AUTOBOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) \ (std::strcmp((X).name(),(Y).name()) == 0) # else -# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) +# define AUTOBOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) #endif -#if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG) -# define BOOST_FUNCTION_TARGET_FIX(x) x +#if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(AUTOBOOST_STRICT_CONFIG) +# define AUTOBOOST_FUNCTION_TARGET_FIX(x) x #else -# define BOOST_FUNCTION_TARGET_FIX(x) +# define AUTOBOOST_FUNCTION_TARGET_FIX(x) #endif // __ICL etc -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) -# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ +#if !AUTOBOOST_WORKAROUND(__BORLANDC__, < 0x5A0) +# define AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ typename ::autoboost::enable_if_c<(::autoboost::type_traits::ice_not< \ (::autoboost::is_integral::value)>::value), \ Type>::type #else // BCC doesn't recognize this depends on a template argument and complains // about the use of 'typename' -# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ +# define AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ ::autoboost::enable_if_c<(::autoboost::type_traits::ice_not< \ (::autoboost::is_integral::value)>::value), \ Type>::type @@ -222,7 +222,7 @@ namespace autoboost { // Check whether we have the same type. We can add // cv-qualifiers, but we can't take them away. - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(F)) + if (AUTOBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, AUTOBOOST_SP_TYPEID(F)) && (!in_buffer.obj_ref.is_const_qualified || out_buffer.type.const_qualified) && (!in_buffer.obj_ref.is_volatile_qualified @@ -234,7 +234,7 @@ namespace autoboost { return; case get_functor_type_tag: - out_buffer.type.type = &BOOST_SP_TYPEID(F); + out_buffer.type.type = &AUTOBOOST_SP_TYPEID(F); out_buffer.type.const_qualified = in_buffer.obj_ref.is_const_qualified; out_buffer.type.volatile_qualified = in_buffer.obj_ref.is_volatile_qualified; return; @@ -249,7 +249,7 @@ namespace autoboost { template struct function_allows_small_object_optimization { - BOOST_STATIC_CONSTANT + AUTOBOOST_STATIC_CONSTANT (bool, value = ((sizeof(F) <= sizeof(function_buffer) && (alignment_of::value @@ -296,12 +296,12 @@ namespace autoboost { else if (op == check_functor_type_tag) { const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) + if (AUTOBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, AUTOBOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = &in_buffer.func_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &BOOST_SP_TYPEID(Functor); + out_buffer.type.type = &AUTOBOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -330,12 +330,12 @@ namespace autoboost { } else if (op == check_functor_type_tag) { const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) + if (AUTOBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, AUTOBOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = &in_buffer.data; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &BOOST_SP_TYPEID(Functor); + out_buffer.type.type = &AUTOBOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -391,12 +391,12 @@ namespace autoboost { } else if (op == check_functor_type_tag) { const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) + if (AUTOBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, AUTOBOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = in_buffer.obj_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &BOOST_SP_TYPEID(Functor); + out_buffer.type.type = &AUTOBOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -431,7 +431,7 @@ namespace autoboost { typedef typename get_function_tag::type tag_type; switch (op) { case get_functor_type_tag: - out_buffer.type.type = &BOOST_SP_TYPEID(functor_type); + out_buffer.type.type = &AUTOBOOST_SP_TYPEID(functor_type); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; return; @@ -502,12 +502,12 @@ namespace autoboost { } else if (op == check_functor_type_tag) { const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) + if (AUTOBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, AUTOBOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = in_buffer.obj_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &BOOST_SP_TYPEID(Functor); + out_buffer.type.type = &AUTOBOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -534,7 +534,7 @@ namespace autoboost { typedef typename get_function_tag::type tag_type; switch (op) { case get_functor_type_tag: - out_buffer.type.type = &BOOST_SP_TYPEID(functor_type); + out_buffer.type.type = &AUTOBOOST_SP_TYPEID(functor_type); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; return; @@ -549,7 +549,7 @@ namespace autoboost { // A type that is only used for comparisons against zero struct useless_clear_type {}; -#ifdef BOOST_NO_SFINAE +#ifdef AUTOBOOST_NO_SFINAE // These routines perform comparisons between a Boost.Function // object and an arbitrary function object (when the last // parameter is mpl::bool_) or against zero (when the @@ -606,7 +606,7 @@ namespace autoboost { return fp != g.get_pointer(); else return true; } -#endif // BOOST_NO_SFINAE +#endif // AUTOBOOST_NO_SFINAE /** * Stores the "manager" portion of the vtable for a @@ -635,11 +635,11 @@ class function_base /** Determine if the function is empty (i.e., has no target). */ bool empty() const { return !vtable; } - /** Retrieve the type of the stored function object, or BOOST_SP_TYPEID(void) + /** Retrieve the type of the stored function object, or AUTOBOOST_SP_TYPEID(void) if this is empty. */ const detail::sp_typeinfo& target_type() const { - if (!vtable) return BOOST_SP_TYPEID(void); + if (!vtable) return AUTOBOOST_SP_TYPEID(void); detail::function::function_buffer type; get_vtable()->manager(functor, type, detail::function::get_functor_type_tag); @@ -652,7 +652,7 @@ class function_base if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.type.type = &BOOST_SP_TYPEID(Functor); + type_result.type.type = &AUTOBOOST_SP_TYPEID(Functor); type_result.type.const_qualified = is_const::value; type_result.type.volatile_qualified = is_volatile::value; get_vtable()->manager(functor, type_result, @@ -666,7 +666,7 @@ class function_base if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.type.type = &BOOST_SP_TYPEID(Functor); + type_result.type.type = &AUTOBOOST_SP_TYPEID(Functor); type_result.type.const_qualified = true; type_result.type.volatile_qualified = is_volatile::value; get_vtable()->manager(functor, type_result, @@ -692,7 +692,7 @@ class function_base // problems with instantiation of function return types before it // has been verified that the argument types match up. template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator==(Functor g) const { if (const Functor* fp = target()) @@ -701,7 +701,7 @@ class function_base } template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator!=(Functor g) const { if (const Functor* fp = target()) @@ -734,7 +734,7 @@ class bad_function_call : public std::runtime_error bad_function_call() : std::runtime_error("call to empty autoboost::function") {} }; -#ifndef BOOST_NO_SFINAE +#ifndef AUTOBOOST_NO_SFINAE inline bool operator==(const function_base& f, detail::function::useless_clear_type*) { @@ -760,7 +760,7 @@ inline bool operator!=(detail::function::useless_clear_type*, } #endif -#ifdef BOOST_NO_SFINAE +#ifdef AUTOBOOST_NO_SFINAE // Comparisons between autoboost::function objects and arbitrary function objects template inline bool operator==(const function_base& f, Functor g) @@ -796,7 +796,7 @@ template // objects. GCC 3.3 and before has an obnoxious bug that prevents this // from working. template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator==(const function_base& f, Functor g) { if (const Functor* fp = f.template target()) @@ -805,7 +805,7 @@ template } template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator==(Functor g, const function_base& f) { if (const Functor* fp = f.template target()) @@ -814,7 +814,7 @@ template } template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator!=(const function_base& f, Functor g) { if (const Functor* fp = f.template target()) @@ -823,7 +823,7 @@ template } template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator!=(Functor g, const function_base& f) { if (const Functor* fp = f.template target()) @@ -833,7 +833,7 @@ template # endif template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator==(const function_base& f, reference_wrapper g) { if (const Functor* fp = f.template target()) @@ -842,7 +842,7 @@ template } template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator==(reference_wrapper g, const function_base& f) { if (const Functor* fp = f.template target()) @@ -851,7 +851,7 @@ template } template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator!=(const function_base& f, reference_wrapper g) { if (const Functor* fp = f.template target()) @@ -860,7 +860,7 @@ template } template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator!=(reference_wrapper g, const function_base& f) { if (const Functor* fp = f.template target()) @@ -877,7 +877,7 @@ namespace detail { return f->empty(); } -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310) +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, <= 1310) inline bool has_empty_target(const void*) { return false; @@ -892,11 +892,11 @@ namespace detail { } // end namespace detail } // end namespace autoboost -#undef BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL -#undef BOOST_FUNCTION_COMPARE_TYPE_ID +#undef AUTOBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL +#undef AUTOBOOST_FUNCTION_COMPARE_TYPE_ID -#if defined(BOOST_MSVC) +#if defined(AUTOBOOST_MSVC) # pragma warning( pop ) #endif -#endif // BOOST_FUNCTION_BASE_HEADER +#endif // AUTOBOOST_FUNCTION_BASE_HEADER diff --git a/contrib/autoboost/boost/function/function_fwd.hpp b/contrib/autoboost/autoboost/function/function_fwd.hpp similarity index 83% rename from contrib/autoboost/boost/function/function_fwd.hpp rename to contrib/autoboost/autoboost/function/function_fwd.hpp index be26eaebb..b40bc9342 100644 --- a/contrib/autoboost/boost/function/function_fwd.hpp +++ b/contrib/autoboost/autoboost/function/function_fwd.hpp @@ -6,11 +6,11 @@ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // For more information, see http://www.boost.org -#ifndef BOOST_FUNCTION_FWD_HPP -#define BOOST_FUNCTION_FWD_HPP -#include +#ifndef AUTOBOOST_FUNCTION_FWD_HPP +#define AUTOBOOST_FUNCTION_FWD_HPP +#include -#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 && !defined(BOOST_STRICT_CONFIG) +#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 && !defined(AUTOBOOST_STRICT_CONFIG) // Work around a compiler bug. // autoboost::python::objects::function has to be seen by the compiler before the // autoboost::function class template. @@ -19,15 +19,15 @@ namespace autoboost { namespace python { namespace objects { }}} #endif -#if defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \ - || !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540) -# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX +#if defined(AUTOBOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \ + || !(defined(AUTOBOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540) +# define AUTOBOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX #endif namespace autoboost { class bad_function_call; -#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) +#if !defined(AUTOBOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) // Preferred syntax template class function; diff --git a/contrib/autoboost/autoboost/function/function_template.hpp b/contrib/autoboost/autoboost/function/function_template.hpp new file mode 100644 index 000000000..3dec1ab07 --- /dev/null +++ b/contrib/autoboost/autoboost/function/function_template.hpp @@ -0,0 +1,1187 @@ +// Boost.Function library + +// Copyright Douglas Gregor 2001-2006 +// Copyright Emil Dotchevski 2007 +// Use, modification and distribution is subject to 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) + +// For more information, see http://www.boost.org + +// Note: this header is a header template and must NOT have multiple-inclusion +// protection. +#include +#include + +#if defined(AUTOBOOST_MSVC) +# pragma warning( push ) +# pragma warning( disable : 4127 ) // "conditional expression is constant" +#endif + +#define AUTOBOOST_FUNCTION_TEMPLATE_PARMS AUTOBOOST_PP_ENUM_PARAMS(AUTOBOOST_FUNCTION_NUM_ARGS, typename T) + +#define AUTOBOOST_FUNCTION_TEMPLATE_ARGS AUTOBOOST_PP_ENUM_PARAMS(AUTOBOOST_FUNCTION_NUM_ARGS, T) + +#define AUTOBOOST_FUNCTION_PARM(J,I,D) AUTOBOOST_PP_CAT(T,I) AUTOBOOST_PP_CAT(a,I) + +#define AUTOBOOST_FUNCTION_PARMS AUTOBOOST_PP_ENUM(AUTOBOOST_FUNCTION_NUM_ARGS,AUTOBOOST_FUNCTION_PARM,AUTOBOOST_PP_EMPTY) + +#define AUTOBOOST_FUNCTION_ARGS AUTOBOOST_PP_ENUM_PARAMS(AUTOBOOST_FUNCTION_NUM_ARGS, a) + +#define AUTOBOOST_FUNCTION_ARG_TYPE(J,I,D) \ + typedef AUTOBOOST_PP_CAT(T,I) AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(arg, AUTOBOOST_PP_INC(I)),_type); + +#define AUTOBOOST_FUNCTION_ARG_TYPES AUTOBOOST_PP_REPEAT(AUTOBOOST_FUNCTION_NUM_ARGS,AUTOBOOST_FUNCTION_ARG_TYPE,AUTOBOOST_PP_EMPTY) + +// Comma if nonzero number of arguments +#if AUTOBOOST_FUNCTION_NUM_ARGS == 0 +# define AUTOBOOST_FUNCTION_COMMA +#else +# define AUTOBOOST_FUNCTION_COMMA , +#endif // AUTOBOOST_FUNCTION_NUM_ARGS > 0 + +// Class names used in this version of the code +#define AUTOBOOST_FUNCTION_FUNCTION AUTOBOOST_JOIN(function,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_FUNCTION_INVOKER \ + AUTOBOOST_JOIN(function_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_VOID_FUNCTION_INVOKER \ + AUTOBOOST_JOIN(void_function_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_FUNCTION_OBJ_INVOKER \ + AUTOBOOST_JOIN(function_obj_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER \ + AUTOBOOST_JOIN(void_function_obj_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_FUNCTION_REF_INVOKER \ + AUTOBOOST_JOIN(function_ref_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER \ + AUTOBOOST_JOIN(void_function_ref_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_MEMBER_INVOKER \ + AUTOBOOST_JOIN(function_mem_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_VOID_MEMBER_INVOKER \ + AUTOBOOST_JOIN(function_void_mem_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_GET_FUNCTION_INVOKER \ + AUTOBOOST_JOIN(get_function_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER \ + AUTOBOOST_JOIN(get_function_obj_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_GET_FUNCTION_REF_INVOKER \ + AUTOBOOST_JOIN(get_function_ref_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_GET_MEMBER_INVOKER \ + AUTOBOOST_JOIN(get_member_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_GET_INVOKER \ + AUTOBOOST_JOIN(get_invoker,AUTOBOOST_FUNCTION_NUM_ARGS) +#define AUTOBOOST_FUNCTION_VTABLE AUTOBOOST_JOIN(basic_vtable,AUTOBOOST_FUNCTION_NUM_ARGS) + +#ifndef AUTOBOOST_NO_VOID_RETURNS +# define AUTOBOOST_FUNCTION_VOID_RETURN_TYPE void +# define AUTOBOOST_FUNCTION_RETURN(X) X +#else +# define AUTOBOOST_FUNCTION_VOID_RETURN_TYPE autoboost::detail::function::unusable +# define AUTOBOOST_FUNCTION_RETURN(X) X; return AUTOBOOST_FUNCTION_VOID_RETURN_TYPE () +#endif + +namespace autoboost { + namespace detail { + namespace function { + template< + typename FunctionPtr, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_FUNCTION_INVOKER + { + static R invoke(function_buffer& function_ptr AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_PARMS) + { + FunctionPtr f = reinterpret_cast(function_ptr.func_ptr); + return f(AUTOBOOST_FUNCTION_ARGS); + } + }; + + template< + typename FunctionPtr, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_VOID_FUNCTION_INVOKER + { + static AUTOBOOST_FUNCTION_VOID_RETURN_TYPE + invoke(function_buffer& function_ptr AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_PARMS) + + { + FunctionPtr f = reinterpret_cast(function_ptr.func_ptr); + AUTOBOOST_FUNCTION_RETURN(f(AUTOBOOST_FUNCTION_ARGS)); + } + }; + + template< + typename FunctionObj, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_FUNCTION_OBJ_INVOKER + { + static R invoke(function_buffer& function_obj_ptr AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_PARMS) + + { + FunctionObj* f; + if (function_allows_small_object_optimization::value) + f = reinterpret_cast(&function_obj_ptr.data); + else + f = reinterpret_cast(function_obj_ptr.obj_ptr); + return (*f)(AUTOBOOST_FUNCTION_ARGS); + } + }; + + template< + typename FunctionObj, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER + { + static AUTOBOOST_FUNCTION_VOID_RETURN_TYPE + invoke(function_buffer& function_obj_ptr AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_PARMS) + + { + FunctionObj* f; + if (function_allows_small_object_optimization::value) + f = reinterpret_cast(&function_obj_ptr.data); + else + f = reinterpret_cast(function_obj_ptr.obj_ptr); + AUTOBOOST_FUNCTION_RETURN((*f)(AUTOBOOST_FUNCTION_ARGS)); + } + }; + + template< + typename FunctionObj, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_FUNCTION_REF_INVOKER + { + static R invoke(function_buffer& function_obj_ptr AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_PARMS) + + { + FunctionObj* f = + reinterpret_cast(function_obj_ptr.obj_ptr); + return (*f)(AUTOBOOST_FUNCTION_ARGS); + } + }; + + template< + typename FunctionObj, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER + { + static AUTOBOOST_FUNCTION_VOID_RETURN_TYPE + invoke(function_buffer& function_obj_ptr AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_PARMS) + + { + FunctionObj* f = + reinterpret_cast(function_obj_ptr.obj_ptr); + AUTOBOOST_FUNCTION_RETURN((*f)(AUTOBOOST_FUNCTION_ARGS)); + } + }; + +#if AUTOBOOST_FUNCTION_NUM_ARGS > 0 + /* Handle invocation of member pointers. */ + template< + typename MemberPtr, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_MEMBER_INVOKER + { + static R invoke(function_buffer& function_obj_ptr AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_PARMS) + + { + MemberPtr* f = + reinterpret_cast(&function_obj_ptr.data); + return autoboost::mem_fn(*f)(AUTOBOOST_FUNCTION_ARGS); + } + }; + + template< + typename MemberPtr, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_VOID_MEMBER_INVOKER + { + static AUTOBOOST_FUNCTION_VOID_RETURN_TYPE + invoke(function_buffer& function_obj_ptr AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_PARMS) + + { + MemberPtr* f = + reinterpret_cast(&function_obj_ptr.data); + AUTOBOOST_FUNCTION_RETURN(autoboost::mem_fn(*f)(AUTOBOOST_FUNCTION_ARGS)); + } + }; +#endif + + template< + typename FunctionPtr, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_GET_FUNCTION_INVOKER + { + typedef typename mpl::if_c<(is_void::value), + AUTOBOOST_FUNCTION_VOID_FUNCTION_INVOKER< + FunctionPtr, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >, + AUTOBOOST_FUNCTION_FUNCTION_INVOKER< + FunctionPtr, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + > + >::type type; + }; + + template< + typename FunctionObj, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER + { + typedef typename mpl::if_c<(is_void::value), + AUTOBOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER< + FunctionObj, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >, + AUTOBOOST_FUNCTION_FUNCTION_OBJ_INVOKER< + FunctionObj, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + > + >::type type; + }; + + template< + typename FunctionObj, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_GET_FUNCTION_REF_INVOKER + { + typedef typename mpl::if_c<(is_void::value), + AUTOBOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER< + FunctionObj, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >, + AUTOBOOST_FUNCTION_FUNCTION_REF_INVOKER< + FunctionObj, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + > + >::type type; + }; + +#if AUTOBOOST_FUNCTION_NUM_ARGS > 0 + /* Retrieve the appropriate invoker for a member pointer. */ + template< + typename MemberPtr, + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + struct AUTOBOOST_FUNCTION_GET_MEMBER_INVOKER + { + typedef typename mpl::if_c<(is_void::value), + AUTOBOOST_FUNCTION_VOID_MEMBER_INVOKER< + MemberPtr, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >, + AUTOBOOST_FUNCTION_MEMBER_INVOKER< + MemberPtr, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + > + >::type type; + }; +#endif + + /* Given the tag returned by get_function_tag, retrieve the + actual invoker that will be used for the given function + object. + + Each specialization contains an "apply" nested class template + that accepts the function object, return type, function + argument types, and allocator. The resulting "apply" class + contains two typedefs, "invoker_type" and "manager_type", + which correspond to the invoker and manager types. */ + template + struct AUTOBOOST_FUNCTION_GET_INVOKER { }; + + /* Retrieve the invoker for a function pointer. */ + template<> + struct AUTOBOOST_FUNCTION_GET_INVOKER + { + template + struct apply + { + typedef typename AUTOBOOST_FUNCTION_GET_FUNCTION_INVOKER< + FunctionPtr, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >::type + invoker_type; + + typedef functor_manager manager_type; + }; + + template + struct apply_a + { + typedef typename AUTOBOOST_FUNCTION_GET_FUNCTION_INVOKER< + FunctionPtr, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >::type + invoker_type; + + typedef functor_manager manager_type; + }; + }; + +#if AUTOBOOST_FUNCTION_NUM_ARGS > 0 + /* Retrieve the invoker for a member pointer. */ + template<> + struct AUTOBOOST_FUNCTION_GET_INVOKER + { + template + struct apply + { + typedef typename AUTOBOOST_FUNCTION_GET_MEMBER_INVOKER< + MemberPtr, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >::type + invoker_type; + + typedef functor_manager manager_type; + }; + + template + struct apply_a + { + typedef typename AUTOBOOST_FUNCTION_GET_MEMBER_INVOKER< + MemberPtr, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >::type + invoker_type; + + typedef functor_manager manager_type; + }; + }; +#endif + + /* Retrieve the invoker for a function object. */ + template<> + struct AUTOBOOST_FUNCTION_GET_INVOKER + { + template + struct apply + { + typedef typename AUTOBOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER< + FunctionObj, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >::type + invoker_type; + + typedef functor_manager manager_type; + }; + + template + struct apply_a + { + typedef typename AUTOBOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER< + FunctionObj, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >::type + invoker_type; + + typedef functor_manager_a manager_type; + }; + }; + + /* Retrieve the invoker for a reference to a function object. */ + template<> + struct AUTOBOOST_FUNCTION_GET_INVOKER + { + template + struct apply + { + typedef typename AUTOBOOST_FUNCTION_GET_FUNCTION_REF_INVOKER< + typename RefWrapper::type, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >::type + invoker_type; + + typedef reference_manager manager_type; + }; + + template + struct apply_a + { + typedef typename AUTOBOOST_FUNCTION_GET_FUNCTION_REF_INVOKER< + typename RefWrapper::type, + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >::type + invoker_type; + + typedef reference_manager manager_type; + }; + }; + + + /** + * vtable for a specific autoboost::function instance. This + * structure must be an aggregate so that we can use static + * initialization in autoboost::function's assign_to and assign_to_a + * members. It therefore cannot have any constructors, + * destructors, base classes, etc. + */ + template + struct AUTOBOOST_FUNCTION_VTABLE + { +#ifndef AUTOBOOST_NO_VOID_RETURNS + typedef R result_type; +#else + typedef typename function_return_type::type result_type; +#endif // AUTOBOOST_NO_VOID_RETURNS + + typedef result_type (*invoker_type)(function_buffer& + AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS); + + template + bool assign_to(F f, function_buffer& functor) const + { + typedef typename get_function_tag::type tag; + return assign_to(f, functor, tag()); + } + template + bool assign_to_a(F f, function_buffer& functor, Allocator a) const + { + typedef typename get_function_tag::type tag; + return assign_to_a(f, functor, a, tag()); + } + + void clear(function_buffer& functor) const + { + if (base.manager) + base.manager(functor, functor, destroy_functor_tag); + } + + private: + // Function pointers + template + bool + assign_to(FunctionPtr f, function_buffer& functor, function_ptr_tag) const + { + this->clear(functor); + if (f) { + // should be a reinterpret cast, but some compilers insist + // on giving cv-qualifiers to free functions + functor.func_ptr = reinterpret_cast(f); + return true; + } else { + return false; + } + } + template + bool + assign_to_a(FunctionPtr f, function_buffer& functor, Allocator, function_ptr_tag) const + { + return assign_to(f,functor,function_ptr_tag()); + } + + // Member pointers +#if AUTOBOOST_FUNCTION_NUM_ARGS > 0 + template + bool assign_to(MemberPtr f, function_buffer& functor, member_ptr_tag) const + { + // DPG TBD: Add explicit support for member function + // objects, so we invoke through mem_fn() but we retain the + // right target_type() values. + if (f) { + this->assign_to(autoboost::mem_fn(f), functor); + return true; + } else { + return false; + } + } + template + bool assign_to_a(MemberPtr f, function_buffer& functor, Allocator a, member_ptr_tag) const + { + // DPG TBD: Add explicit support for member function + // objects, so we invoke through mem_fn() but we retain the + // right target_type() values. + if (f) { + this->assign_to_a(autoboost::mem_fn(f), functor, a); + return true; + } else { + return false; + } + } +#endif // AUTOBOOST_FUNCTION_NUM_ARGS > 0 + + // Function objects + // Assign to a function object using the small object optimization + template + void + assign_functor(FunctionObj f, function_buffer& functor, mpl::true_) const + { + new (reinterpret_cast(&functor.data)) FunctionObj(f); + } + template + void + assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, mpl::true_) const + { + assign_functor(f,functor,mpl::true_()); + } + + // Assign to a function object allocated on the heap. + template + void + assign_functor(FunctionObj f, function_buffer& functor, mpl::false_) const + { + functor.obj_ptr = new FunctionObj(f); + } + template + void + assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, mpl::false_) const + { + typedef functor_wrapper functor_wrapper_type; + typedef typename Allocator::template rebind::other + wrapper_allocator_type; + typedef typename wrapper_allocator_type::pointer wrapper_allocator_pointer_type; + wrapper_allocator_type wrapper_allocator(a); + wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1); + wrapper_allocator.construct(copy, functor_wrapper_type(f,a)); + functor_wrapper_type* new_f = static_cast(copy); + functor.obj_ptr = new_f; + } + + template + bool + assign_to(FunctionObj f, function_buffer& functor, function_obj_tag) const + { + if (!autoboost::detail::function::has_empty_target(autoboost::addressof(f))) { + assign_functor(f, functor, + mpl::bool_<(function_allows_small_object_optimization::value)>()); + return true; + } else { + return false; + } + } + template + bool + assign_to_a(FunctionObj f, function_buffer& functor, Allocator a, function_obj_tag) const + { + if (!autoboost::detail::function::has_empty_target(autoboost::addressof(f))) { + assign_functor_a(f, functor, a, + mpl::bool_<(function_allows_small_object_optimization::value)>()); + return true; + } else { + return false; + } + } + + // Reference to a function object + template + bool + assign_to(const reference_wrapper& f, + function_buffer& functor, function_obj_ref_tag) const + { + functor.obj_ref.obj_ptr = (void *)(f.get_pointer()); + functor.obj_ref.is_const_qualified = is_const::value; + functor.obj_ref.is_volatile_qualified = is_volatile::value; + return true; + } + template + bool + assign_to_a(const reference_wrapper& f, + function_buffer& functor, Allocator, function_obj_ref_tag) const + { + return assign_to(f,functor,function_obj_ref_tag()); + } + + public: + vtable_base base; + invoker_type invoker; + }; + } // end namespace function + } // end namespace detail + + template< + typename R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_PARMS + > + class AUTOBOOST_FUNCTION_FUNCTION : public function_base + +#if AUTOBOOST_FUNCTION_NUM_ARGS == 1 + + , public std::unary_function + +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 2 + + , public std::binary_function + +#endif + + { + public: +#ifndef AUTOBOOST_NO_VOID_RETURNS + typedef R result_type; +#else + typedef typename autoboost::detail::function::function_return_type::type + result_type; +#endif // AUTOBOOST_NO_VOID_RETURNS + + private: + typedef autoboost::detail::function::AUTOBOOST_FUNCTION_VTABLE< + R AUTOBOOST_FUNCTION_COMMA AUTOBOOST_FUNCTION_TEMPLATE_ARGS> + vtable_type; + + vtable_type* get_vtable() const { + return reinterpret_cast( + reinterpret_cast(vtable) & ~static_cast(0x01)); + } + + struct clear_type {}; + + public: + AUTOBOOST_STATIC_CONSTANT(int, args = AUTOBOOST_FUNCTION_NUM_ARGS); + + // add signature for autoboost::lambda + template + struct sig + { + typedef result_type type; + }; + +#if AUTOBOOST_FUNCTION_NUM_ARGS == 1 + typedef T0 argument_type; +#elif AUTOBOOST_FUNCTION_NUM_ARGS == 2 + typedef T0 first_argument_type; + typedef T1 second_argument_type; +#endif + + AUTOBOOST_STATIC_CONSTANT(int, arity = AUTOBOOST_FUNCTION_NUM_ARGS); + AUTOBOOST_FUNCTION_ARG_TYPES + + typedef AUTOBOOST_FUNCTION_FUNCTION self_type; + + AUTOBOOST_FUNCTION_FUNCTION() : function_base() { } + + // MSVC chokes if the following two constructors are collapsed into + // one with a default parameter. + template + AUTOBOOST_FUNCTION_FUNCTION(Functor AUTOBOOST_FUNCTION_TARGET_FIX(const &) f +#ifndef AUTOBOOST_NO_SFINAE + ,typename enable_if_c< + (autoboost::type_traits::ice_not< + (is_integral::value)>::value), + int>::type = 0 +#endif // AUTOBOOST_NO_SFINAE + ) : + function_base() + { + this->assign_to(f); + } + template + AUTOBOOST_FUNCTION_FUNCTION(Functor AUTOBOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a +#ifndef AUTOBOOST_NO_SFINAE + ,typename enable_if_c< + (autoboost::type_traits::ice_not< + (is_integral::value)>::value), + int>::type = 0 +#endif // AUTOBOOST_NO_SFINAE + ) : + function_base() + { + this->assign_to_a(f,a); + } + +#ifndef AUTOBOOST_NO_SFINAE + AUTOBOOST_FUNCTION_FUNCTION(clear_type*) : function_base() { } +#else + AUTOBOOST_FUNCTION_FUNCTION(int zero) : function_base() + { + AUTOBOOST_ASSERT(zero == 0); + } +#endif + + AUTOBOOST_FUNCTION_FUNCTION(const AUTOBOOST_FUNCTION_FUNCTION& f) : function_base() + { + this->assign_to_own(f); + } + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + AUTOBOOST_FUNCTION_FUNCTION(AUTOBOOST_FUNCTION_FUNCTION&& f) : function_base() + { + this->move_assign(f); + } +#endif + + ~AUTOBOOST_FUNCTION_FUNCTION() { clear(); } + + result_type operator()(AUTOBOOST_FUNCTION_PARMS) const + { + if (this->empty()) + autoboost::throw_exception(bad_function_call()); + + return get_vtable()->invoker + (this->functor AUTOBOOST_FUNCTION_COMMA AUTOBOOST_FUNCTION_ARGS); + } + + // The distinction between when to use AUTOBOOST_FUNCTION_FUNCTION and + // when to use self_type is obnoxious. MSVC cannot handle self_type as + // the return type of these assignment operators, but Borland C++ cannot + // handle AUTOBOOST_FUNCTION_FUNCTION as the type of the temporary to + // construct. + template +#ifndef AUTOBOOST_NO_SFINAE + typename enable_if_c< + (autoboost::type_traits::ice_not< + (is_integral::value)>::value), + AUTOBOOST_FUNCTION_FUNCTION&>::type +#else + AUTOBOOST_FUNCTION_FUNCTION& +#endif + operator=(Functor AUTOBOOST_FUNCTION_TARGET_FIX(const &) f) + { + this->clear(); + AUTOBOOST_TRY { + this->assign_to(f); + } AUTOBOOST_CATCH (...) { + vtable = 0; + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return *this; + } + template + void assign(Functor AUTOBOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a) + { + this->clear(); + AUTOBOOST_TRY{ + this->assign_to_a(f,a); + } AUTOBOOST_CATCH (...) { + vtable = 0; + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + } + +#ifndef AUTOBOOST_NO_SFINAE + AUTOBOOST_FUNCTION_FUNCTION& operator=(clear_type*) + { + this->clear(); + return *this; + } +#else + AUTOBOOST_FUNCTION_FUNCTION& operator=(int zero) + { + AUTOBOOST_ASSERT(zero == 0); + this->clear(); + return *this; + } +#endif + + // Assignment from another AUTOBOOST_FUNCTION_FUNCTION + AUTOBOOST_FUNCTION_FUNCTION& operator=(const AUTOBOOST_FUNCTION_FUNCTION& f) + { + if (&f == this) + return *this; + + this->clear(); + AUTOBOOST_TRY { + this->assign_to_own(f); + } AUTOBOOST_CATCH (...) { + vtable = 0; + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return *this; + } + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + // Move assignment from another AUTOBOOST_FUNCTION_FUNCTION + AUTOBOOST_FUNCTION_FUNCTION& operator=(AUTOBOOST_FUNCTION_FUNCTION&& f) + { + + if (&f == this) + return *this; + + this->clear(); + AUTOBOOST_TRY { + this->move_assign(f); + } AUTOBOOST_CATCH (...) { + vtable = 0; + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + return *this; + } +#endif + + void swap(AUTOBOOST_FUNCTION_FUNCTION& other) + { + if (&other == this) + return; + + AUTOBOOST_FUNCTION_FUNCTION tmp; + tmp.move_assign(*this); + this->move_assign(other); + other.move_assign(tmp); + } + + // Clear out a target, if there is one + void clear() + { + if (vtable) { + if (!this->has_trivial_copy_and_destroy()) + get_vtable()->clear(this->functor); + vtable = 0; + } + } + +#if (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined AUTOBOOST_NO_COMPILER_CONFIG) + // Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it + operator bool () const { return !this->empty(); } +#else + private: + struct dummy { + void nonnull() {} + }; + + typedef void (dummy::*safe_bool)(); + + public: + operator safe_bool () const + { return (this->empty())? 0 : &dummy::nonnull; } + + bool operator!() const + { return this->empty(); } +#endif + + private: + void assign_to_own(const AUTOBOOST_FUNCTION_FUNCTION& f) + { + if (!f.empty()) { + this->vtable = f.vtable; + if (this->has_trivial_copy_and_destroy()) + this->functor = f.functor; + else + get_vtable()->base.manager(f.functor, this->functor, + autoboost::detail::function::clone_functor_tag); + } + } + + template + void assign_to(Functor f) + { + using detail::function::vtable_base; + + typedef typename detail::function::get_function_tag::type tag; + typedef detail::function::AUTOBOOST_FUNCTION_GET_INVOKER get_invoker; + typedef typename get_invoker:: + template apply + handler_type; + + typedef typename handler_type::invoker_type invoker_type; + typedef typename handler_type::manager_type manager_type; + + // Note: it is extremely important that this initialization use + // static initialization. Otherwise, we will have a race + // condition here in multi-threaded code. See + // http://thread.gmane.org/gmane.comp.lib.boost.devel/164902/. + static const vtable_type stored_vtable = + { { &manager_type::manage }, &invoker_type::invoke }; + + if (stored_vtable.assign_to(f, functor)) { + std::size_t value = reinterpret_cast(&stored_vtable.base); + // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). + if (autoboost::has_trivial_copy_constructor::value && + autoboost::has_trivial_destructor::value && + detail::function::function_allows_small_object_optimization::value) + value |= static_cast(0x01); + vtable = reinterpret_cast(value); + } else + vtable = 0; + } + + template + void assign_to_a(Functor f,Allocator a) + { + using detail::function::vtable_base; + + typedef typename detail::function::get_function_tag::type tag; + typedef detail::function::AUTOBOOST_FUNCTION_GET_INVOKER get_invoker; + typedef typename get_invoker:: + template apply_a + handler_type; + + typedef typename handler_type::invoker_type invoker_type; + typedef typename handler_type::manager_type manager_type; + + // Note: it is extremely important that this initialization use + // static initialization. Otherwise, we will have a race + // condition here in multi-threaded code. See + // http://thread.gmane.org/gmane.comp.lib.boost.devel/164902/. + static const vtable_type stored_vtable = + { { &manager_type::manage }, &invoker_type::invoke }; + + if (stored_vtable.assign_to_a(f, functor, a)) { + std::size_t value = reinterpret_cast(&stored_vtable.base); + // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). + if (autoboost::has_trivial_copy_constructor::value && + autoboost::has_trivial_destructor::value && + detail::function::function_allows_small_object_optimization::value) + value |= static_cast(0x01); + vtable = reinterpret_cast(value); + } else + vtable = 0; + } + + // Moves the value from the specified argument to *this. If the argument + // has its function object allocated on the heap, move_assign will pass + // its buffer to *this, and set the argument's buffer pointer to NULL. + void move_assign(AUTOBOOST_FUNCTION_FUNCTION& f) + { + if (&f == this) + return; + + AUTOBOOST_TRY { + if (!f.empty()) { + this->vtable = f.vtable; + if (this->has_trivial_copy_and_destroy()) + this->functor = f.functor; + else + get_vtable()->base.manager(f.functor, this->functor, + autoboost::detail::function::move_functor_tag); + f.vtable = 0; + } else { + clear(); + } + } AUTOBOOST_CATCH (...) { + vtable = 0; + AUTOBOOST_RETHROW; + } + AUTOBOOST_CATCH_END + } + }; + + template + inline void swap(AUTOBOOST_FUNCTION_FUNCTION< + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >& f1, + AUTOBOOST_FUNCTION_FUNCTION< + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS + >& f2) + { + f1.swap(f2); + } + +// Poison comparisons between autoboost::function objects of the same type. +template + void operator==(const AUTOBOOST_FUNCTION_FUNCTION< + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS>&, + const AUTOBOOST_FUNCTION_FUNCTION< + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS>&); +template + void operator!=(const AUTOBOOST_FUNCTION_FUNCTION< + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS>&, + const AUTOBOOST_FUNCTION_FUNCTION< + R AUTOBOOST_FUNCTION_COMMA + AUTOBOOST_FUNCTION_TEMPLATE_ARGS>& ); + +#if !defined(AUTOBOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) + +#if AUTOBOOST_FUNCTION_NUM_ARGS == 0 +#define AUTOBOOST_FUNCTION_PARTIAL_SPEC R (void) +#else +#define AUTOBOOST_FUNCTION_PARTIAL_SPEC R (AUTOBOOST_PP_ENUM_PARAMS(AUTOBOOST_FUNCTION_NUM_ARGS,T)) +#endif + +template +class function + : public AUTOBOOST_FUNCTION_FUNCTION +{ + typedef AUTOBOOST_FUNCTION_FUNCTION base_type; + typedef function self_type; + + struct clear_type {}; + +public: + + function() : base_type() {} + + template + function(Functor f +#ifndef AUTOBOOST_NO_SFINAE + ,typename enable_if_c< + (autoboost::type_traits::ice_not< + (is_integral::value)>::value), + int>::type = 0 +#endif + ) : + base_type(f) + { + } + template + function(Functor f, Allocator a +#ifndef AUTOBOOST_NO_SFINAE + ,typename enable_if_c< + (autoboost::type_traits::ice_not< + (is_integral::value)>::value), + int>::type = 0 +#endif + ) : + base_type(f,a) + { + } + +#ifndef AUTOBOOST_NO_SFINAE + function(clear_type*) : base_type() {} +#endif + + function(const self_type& f) : base_type(static_cast(f)){} + + function(const base_type& f) : base_type(static_cast(f)){} + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + // Move constructors + function(self_type&& f): base_type(static_cast(f)){} + function(base_type&& f): base_type(static_cast(f)){} +#endif + + self_type& operator=(const self_type& f) + { + self_type(f).swap(*this); + return *this; + } + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + self_type& operator=(self_type&& f) + { + self_type(static_cast(f)).swap(*this); + return *this; + } +#endif + + template +#ifndef AUTOBOOST_NO_SFINAE + typename enable_if_c< + (autoboost::type_traits::ice_not< + (is_integral::value)>::value), + self_type&>::type +#else + self_type& +#endif + operator=(Functor f) + { + self_type(f).swap(*this); + return *this; + } + +#ifndef AUTOBOOST_NO_SFINAE + self_type& operator=(clear_type*) + { + this->clear(); + return *this; + } +#endif + + self_type& operator=(const base_type& f) + { + self_type(f).swap(*this); + return *this; + } + +#ifndef AUTOBOOST_NO_CXX11_RVALUE_REFERENCES + self_type& operator=(base_type&& f) + { + self_type(static_cast(f)).swap(*this); + return *this; + } +#endif +}; + +#undef AUTOBOOST_FUNCTION_PARTIAL_SPEC +#endif // have partial specialization + +} // end namespace autoboost + +// Cleanup after ourselves... +#undef AUTOBOOST_FUNCTION_VTABLE +#undef AUTOBOOST_FUNCTION_COMMA +#undef AUTOBOOST_FUNCTION_FUNCTION +#undef AUTOBOOST_FUNCTION_FUNCTION_INVOKER +#undef AUTOBOOST_FUNCTION_VOID_FUNCTION_INVOKER +#undef AUTOBOOST_FUNCTION_FUNCTION_OBJ_INVOKER +#undef AUTOBOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER +#undef AUTOBOOST_FUNCTION_FUNCTION_REF_INVOKER +#undef AUTOBOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER +#undef AUTOBOOST_FUNCTION_MEMBER_INVOKER +#undef AUTOBOOST_FUNCTION_VOID_MEMBER_INVOKER +#undef AUTOBOOST_FUNCTION_GET_FUNCTION_INVOKER +#undef AUTOBOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER +#undef AUTOBOOST_FUNCTION_GET_FUNCTION_REF_INVOKER +#undef AUTOBOOST_FUNCTION_GET_MEM_FUNCTION_INVOKER +#undef AUTOBOOST_FUNCTION_GET_INVOKER +#undef AUTOBOOST_FUNCTION_TEMPLATE_PARMS +#undef AUTOBOOST_FUNCTION_TEMPLATE_ARGS +#undef AUTOBOOST_FUNCTION_PARMS +#undef AUTOBOOST_FUNCTION_PARM +#undef AUTOBOOST_FUNCTION_ARGS +#undef AUTOBOOST_FUNCTION_ARG_TYPE +#undef AUTOBOOST_FUNCTION_ARG_TYPES +#undef AUTOBOOST_FUNCTION_VOID_RETURN_TYPE +#undef AUTOBOOST_FUNCTION_RETURN + +#if defined(AUTOBOOST_MSVC) +# pragma warning( pop ) +#endif diff --git a/contrib/autoboost/boost/function_equal.hpp b/contrib/autoboost/autoboost/function_equal.hpp similarity index 86% rename from contrib/autoboost/boost/function_equal.hpp rename to contrib/autoboost/autoboost/function_equal.hpp index 450e948fa..d32c3171a 100644 --- a/contrib/autoboost/boost/function_equal.hpp +++ b/contrib/autoboost/autoboost/function_equal.hpp @@ -7,8 +7,8 @@ // http://www.boost.org/LICENSE_1_0.txt) // For more information, see http://www.boost.org -#ifndef BOOST_FUNCTION_EQUAL_HPP -#define BOOST_FUNCTION_EQUAL_HPP +#ifndef AUTOBOOST_FUNCTION_EQUAL_HPP +#define AUTOBOOST_FUNCTION_EQUAL_HPP namespace autoboost { @@ -25,4 +25,4 @@ template } // end namespace autoboost -#endif // BOOST_FUNCTION_EQUAL_HPP +#endif // AUTOBOOST_FUNCTION_EQUAL_HPP diff --git a/contrib/autoboost/autoboost/functional/hash.hpp b/contrib/autoboost/autoboost/functional/hash.hpp new file mode 100644 index 000000000..9995fe2d1 --- /dev/null +++ b/contrib/autoboost/autoboost/functional/hash.hpp @@ -0,0 +1,7 @@ + +// Copyright 2005-2009 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) + +#include + diff --git a/contrib/autoboost/boost/functional/hash/detail/float_functions.hpp b/contrib/autoboost/autoboost/functional/hash/detail/float_functions.hpp similarity index 84% rename from contrib/autoboost/boost/functional/hash/detail/float_functions.hpp rename to contrib/autoboost/autoboost/functional/hash/detail/float_functions.hpp index a4e706b9c..3e9f4d71e 100644 --- a/contrib/autoboost/boost/functional/hash/detail/float_functions.hpp +++ b/contrib/autoboost/autoboost/functional/hash/detail/float_functions.hpp @@ -3,17 +3,17 @@ // 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_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP) -#define BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP +#if !defined(AUTOBOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP) +#define AUTOBOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP -#include -#if defined(BOOST_HAS_PRAGMA_ONCE) +#include +#if defined(AUTOBOOST_HAS_PRAGMA_ONCE) #pragma once #endif -#include +#include -// Set BOOST_HASH_CONFORMANT_FLOATS to 1 for libraries known to have +// Set AUTOBOOST_HASH_CONFORMANT_FLOATS to 1 for libraries known to have // sufficiently good floating point support to not require any // workarounds. // @@ -25,50 +25,50 @@ // advantage of the platform's floating point support. #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 #elif defined(__LIBCOMO__) -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 #elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) // Rogue Wave library: -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 #elif defined(_LIBCPP_VERSION) // libc++ -# define BOOST_HASH_CONFORMANT_FLOATS 1 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 1 #elif defined(__GLIBCPP__) || defined(__GLIBCXX__) // GNU libstdc++ 3 # if defined(__GNUC__) && __GNUC__ >= 4 -# define BOOST_HASH_CONFORMANT_FLOATS 1 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 1 # else -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 # endif #elif defined(__STL_CONFIG_H) // generic SGI STL -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 #elif defined(__MSL_CPP__) // MSL standard lib: -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 #elif defined(__IBMCPP__) // VACPP std lib (probably conformant for much earlier version). # if __IBMCPP__ >= 1210 -# define BOOST_HASH_CONFORMANT_FLOATS 1 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 1 # else -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 # endif #elif defined(MSIPL_COMPILE_H) // Modena C++ standard library -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 #elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) // Dinkumware Library (this has to appear after any possible replacement libraries): # if _CPPLIB_VER >= 405 -# define BOOST_HASH_CONFORMANT_FLOATS 1 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 1 # else -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 # endif #else -# define BOOST_HASH_CONFORMANT_FLOATS 0 +# define AUTOBOOST_HASH_CONFORMANT_FLOATS 0 #endif -#if BOOST_HASH_CONFORMANT_FLOATS +#if AUTOBOOST_HASH_CONFORMANT_FLOATS // The standard library is known to be compliant, so don't use the // configuration mechanism. @@ -99,7 +99,7 @@ namespace autoboost { } } -#else // BOOST_HASH_CONFORMANT_FLOATS == 0 +#else // AUTOBOOST_HASH_CONFORMANT_FLOATS == 0 // The C++ standard requires that the C float functions are overloarded // for float, double and long double in the std namespace, but some of the older @@ -190,7 +190,7 @@ namespace autoboost_hash_detect_float_functions { // can cause the namespace to be imported at the global level. This seems to // happen mainly when there's a template in the same namesapce. -#define BOOST_HASH_CALL_FLOAT_FUNC(cpp_func, c99_func, type1, type2) \ +#define AUTOBOOST_HASH_CALL_FLOAT_FUNC(cpp_func, c99_func, type1, type2) \ namespace autoboost_hash_detect_float_functions { \ template \ autoboost::hash_detail::not_found c99_func(Float, type2); \ @@ -205,10 +205,10 @@ namespace autoboost { \ struct check { \ static type1 x; \ static type2 y; \ - BOOST_STATIC_CONSTANT(bool, cpp = \ + AUTOBOOST_STATIC_CONSTANT(bool, cpp = \ sizeof(float_type(cpp_func(x,y))) \ == sizeof(is)); \ - BOOST_STATIC_CONSTANT(bool, c99 = \ + AUTOBOOST_STATIC_CONSTANT(bool, c99 = \ sizeof(float_type(c99_func(x,y))) \ == sizeof(is)); \ }; \ @@ -256,7 +256,7 @@ namespace autoboost { \ } \ } -#define BOOST_HASH_CALL_FLOAT_MACRO(cpp_func, c99_func, type1, type2) \ +#define AUTOBOOST_HASH_CALL_FLOAT_MACRO(cpp_func, c99_func, type1, type2) \ namespace autoboost { \ namespace hash_detail { \ \ @@ -271,31 +271,31 @@ namespace autoboost { \ } #if defined(ldexpf) -BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpf, float, int) +AUTOBOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpf, float, int) #else -BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpf, float, int) +AUTOBOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpf, float, int) #endif #if defined(ldexpl) -BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpl, long double, int) +AUTOBOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpl, long double, int) #else -BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpl, long double, int) +AUTOBOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpl, long double, int) #endif #if defined(frexpf) -BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpf, float, int*) +AUTOBOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpf, float, int*) #else -BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpf, float, int*) +AUTOBOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpf, float, int*) #endif #if defined(frexpl) -BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpl, long double, int*) +AUTOBOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpl, long double, int*) #else -BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpl, long double, int*) +AUTOBOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpl, long double, int*) #endif -#undef BOOST_HASH_CALL_FLOAT_MACRO -#undef BOOST_HASH_CALL_FLOAT_FUNC +#undef AUTOBOOST_HASH_CALL_FLOAT_MACRO +#undef AUTOBOOST_HASH_CALL_FLOAT_FUNC namespace autoboost @@ -325,12 +325,12 @@ namespace autoboost template struct select_hash_type : select_hash_type_impl< - BOOST_DEDUCED_TYPENAME call_ldexp::float_type, - BOOST_DEDUCED_TYPENAME call_frexp::float_type + AUTOBOOST_DEDUCED_TYPENAME call_ldexp::float_type, + AUTOBOOST_DEDUCED_TYPENAME call_frexp::float_type > {}; } } -#endif // BOOST_HASH_CONFORMANT_FLOATS +#endif // AUTOBOOST_HASH_CONFORMANT_FLOATS #endif diff --git a/contrib/autoboost/boost/functional/hash/detail/hash_float.hpp b/contrib/autoboost/autoboost/functional/hash/detail/hash_float.hpp similarity index 82% rename from contrib/autoboost/boost/functional/hash/detail/hash_float.hpp rename to contrib/autoboost/autoboost/functional/hash/detail/hash_float.hpp index a1a879bcc..77adc67d1 100644 --- a/contrib/autoboost/boost/functional/hash/detail/hash_float.hpp +++ b/contrib/autoboost/autoboost/functional/hash/detail/hash_float.hpp @@ -3,26 +3,26 @@ // 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_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER) -#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER +#if !defined(AUTOBOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER) +#define AUTOBOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER -#include -#if defined(BOOST_HAS_PRAGMA_ONCE) +#include +#if defined(AUTOBOOST_HAS_PRAGMA_ONCE) #pragma once #endif -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include -#if defined(BOOST_MSVC) +#if defined(AUTOBOOST_MSVC) #pragma warning(push) -#if BOOST_MSVC >= 1400 +#if AUTOBOOST_MSVC >= 1400 #pragma warning(disable:6294) // Ill-defined for-loop: initial condition does // not satisfy test. Loop body not executed #endif @@ -32,20 +32,20 @@ // STLport #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) -#define BOOST_HASH_USE_FPCLASSIFY 0 +#define AUTOBOOST_HASH_USE_FPCLASSIFY 0 // GNU libstdc++ 3 #elif defined(__GLIBCPP__) || defined(__GLIBCXX__) # if (defined(__USE_ISOC99) || defined(_GLIBCXX_USE_C99_MATH)) && \ !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) -# define BOOST_HASH_USE_FPCLASSIFY 1 +# define AUTOBOOST_HASH_USE_FPCLASSIFY 1 # else -# define BOOST_HASH_USE_FPCLASSIFY 0 +# define AUTOBOOST_HASH_USE_FPCLASSIFY 0 # endif // Everything else #else -# define BOOST_HASH_USE_FPCLASSIFY 0 +# define AUTOBOOST_HASH_USE_FPCLASSIFY 0 #endif namespace autoboost @@ -93,7 +93,7 @@ namespace autoboost template struct enable_binary_hash { - BOOST_STATIC_CONSTANT(bool, value = + AUTOBOOST_STATIC_CONSTANT(bool, value = std::numeric_limits::is_iec559 && std::numeric_limits::digits == digits && std::numeric_limits::radix == 2 && @@ -102,7 +102,7 @@ namespace autoboost template inline std::size_t float_hash_impl(Float v, - BOOST_DEDUCED_TYPENAME autoboost::enable_if_c< + AUTOBOOST_DEDUCED_TYPENAME autoboost::enable_if_c< enable_binary_hash::value, std::size_t>::type) { @@ -112,7 +112,7 @@ namespace autoboost template inline std::size_t float_hash_impl(Float v, - BOOST_DEDUCED_TYPENAME autoboost::enable_if_c< + AUTOBOOST_DEDUCED_TYPENAME autoboost::enable_if_c< enable_binary_hash::value, std::size_t>::type) { @@ -121,7 +121,7 @@ namespace autoboost template inline std::size_t float_hash_impl(Float v, - BOOST_DEDUCED_TYPENAME autoboost::enable_if_c< + AUTOBOOST_DEDUCED_TYPENAME autoboost::enable_if_c< enable_binary_hash::value, std::size_t>::type) { @@ -130,7 +130,7 @@ namespace autoboost template inline std::size_t float_hash_impl(Float v, - BOOST_DEDUCED_TYPENAME autoboost::enable_if_c< + AUTOBOOST_DEDUCED_TYPENAME autoboost::enable_if_c< enable_binary_hash::value, std::size_t>::type) { @@ -184,20 +184,20 @@ namespace autoboost return seed; } -#if !defined(BOOST_HASH_DETAIL_TEST_WITHOUT_GENERIC) +#if !defined(AUTOBOOST_HASH_DETAIL_TEST_WITHOUT_GENERIC) template inline std::size_t float_hash_impl(T v, ...) { - typedef BOOST_DEDUCED_TYPENAME select_hash_type::type type; + typedef AUTOBOOST_DEDUCED_TYPENAME select_hash_type::type type; return float_hash_impl2(static_cast(v)); } #endif } } -#if BOOST_HASH_USE_FPCLASSIFY +#if AUTOBOOST_HASH_USE_FPCLASSIFY -#include +#include namespace autoboost { @@ -208,7 +208,7 @@ namespace autoboost { #if defined(fpclassify) switch (fpclassify(v)) -#elif BOOST_HASH_CONFORMANT_FLOATS +#elif AUTOBOOST_HASH_CONFORMANT_FLOATS switch (std::fpclassify(v)) #else using namespace std; @@ -225,14 +225,14 @@ namespace autoboost case FP_SUBNORMAL: return float_hash_impl(v, 0); default: - BOOST_ASSERT(0); + AUTOBOOST_ASSERT(0); return 0; } } } } -#else // !BOOST_HASH_USE_FPCLASSIFY +#else // !AUTOBOOST_HASH_USE_FPCLASSIFY namespace autoboost { @@ -260,11 +260,11 @@ namespace autoboost } } -#endif // BOOST_HASH_USE_FPCLASSIFY +#endif // AUTOBOOST_HASH_USE_FPCLASSIFY -#undef BOOST_HASH_USE_FPCLASSIFY +#undef AUTOBOOST_HASH_USE_FPCLASSIFY -#if defined(BOOST_MSVC) +#if defined(AUTOBOOST_MSVC) #pragma warning(pop) #endif diff --git a/contrib/autoboost/autoboost/functional/hash/detail/limits.hpp b/contrib/autoboost/autoboost/functional/hash/detail/limits.hpp new file mode 100644 index 000000000..023fc3dbb --- /dev/null +++ b/contrib/autoboost/autoboost/functional/hash/detail/limits.hpp @@ -0,0 +1,62 @@ + +// Copyright 2005-2009 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) +// +// On some platforms std::limits gives incorrect values for long double. +// This tries to work around them. + +#if !defined(AUTOBOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER) +#define AUTOBOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER + +#include +#if defined(AUTOBOOST_HAS_PRAGMA_ONCE) +#pragma once +#endif + +#include + +// On OpenBSD, numeric_limits is not reliable for long doubles, but +// the macros defined in are and support long double when STLport +// doesn't. + +#if defined(__OpenBSD__) || defined(_STLP_NO_LONG_DOUBLE) +#include +#endif + +namespace autoboost +{ + namespace hash_detail + { + template + struct limits : std::numeric_limits {}; + +#if defined(__OpenBSD__) || defined(_STLP_NO_LONG_DOUBLE) + template <> + struct limits + : std::numeric_limits + { + static long double epsilon() { + return LDBL_EPSILON; + } + + static long double (max)() { + return LDBL_MAX; + } + + static long double (min)() { + return LDBL_MIN; + } + + AUTOBOOST_STATIC_CONSTANT(int, digits = LDBL_MANT_DIG); + AUTOBOOST_STATIC_CONSTANT(int, max_exponent = LDBL_MAX_EXP); + AUTOBOOST_STATIC_CONSTANT(int, min_exponent = LDBL_MIN_EXP); +#if defined(_STLP_NO_LONG_DOUBLE) + AUTOBOOST_STATIC_CONSTANT(int, radix = FLT_RADIX); +#endif + }; +#endif // __OpenBSD__ + } +} + +#endif diff --git a/contrib/autoboost/boost/functional/hash/extensions.hpp b/contrib/autoboost/autoboost/functional/hash/extensions.hpp similarity index 81% rename from contrib/autoboost/boost/functional/hash/extensions.hpp rename to contrib/autoboost/autoboost/functional/hash/extensions.hpp index 415c6b2d1..48ae5f0cf 100644 --- a/contrib/autoboost/boost/functional/hash/extensions.hpp +++ b/contrib/autoboost/autoboost/functional/hash/extensions.hpp @@ -10,35 +10,35 @@ // This implements the extensions to the standard. // It's undocumented, so you shouldn't use it.... -#if !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP) -#define BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP +#if !defined(AUTOBOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP) +#define AUTOBOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP -#include -#if defined(BOOST_HAS_PRAGMA_ONCE) +#include +#if defined(AUTOBOOST_HAS_PRAGMA_ONCE) #pragma once #endif -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#if !defined(BOOST_NO_CXX11_HDR_ARRAY) +#if !defined(AUTOBOOST_NO_CXX11_HDR_ARRAY) # include #endif -#if !defined(BOOST_NO_CXX11_HDR_TUPLE) +#if !defined(AUTOBOOST_NO_CXX11_HDR_TUPLE) # include #endif -#if !defined(BOOST_NO_CXX11_HDR_MEMORY) +#if !defined(AUTOBOOST_NO_CXX11_HDR_MEMORY) # include #endif -#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) -#include +#if defined(AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING) +#include #endif namespace autoboost @@ -123,7 +123,7 @@ namespace autoboost return seed; } -#if !defined(BOOST_NO_CXX11_HDR_ARRAY) +#if !defined(AUTOBOOST_NO_CXX11_HDR_ARRAY) template std::size_t hash_value(std::array const& v) { @@ -131,7 +131,7 @@ namespace autoboost } #endif -#if !defined(BOOST_NO_CXX11_HDR_TUPLE) +#if !defined(AUTOBOOST_NO_CXX11_HDR_TUPLE) namespace hash_detail { template inline typename autoboost::enable_if_c<(I == std::tuple_size::value), @@ -158,7 +158,7 @@ namespace autoboost } } -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) +#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) template inline std::size_t hash_value(std::tuple const& v) { @@ -171,24 +171,24 @@ namespace autoboost return autoboost::hash_detail::hash_tuple(v); } -# define BOOST_HASH_TUPLE_F(z, n, _) \ +# define AUTOBOOST_HASH_TUPLE_F(z, n, _) \ template< \ - BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \ + AUTOBOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \ > \ inline std::size_t hash_value(std::tuple< \ - BOOST_PP_ENUM_PARAMS_Z(z, n, A) \ + AUTOBOOST_PP_ENUM_PARAMS_Z(z, n, A) \ > const& v) \ { \ return autoboost::hash_detail::hash_tuple(v); \ } - BOOST_PP_REPEAT_FROM_TO(1, 11, BOOST_HASH_TUPLE_F, _) -# undef BOOST_HASH_TUPLE_F + AUTOBOOST_PP_REPEAT_FROM_TO(1, 11, AUTOBOOST_HASH_TUPLE_F, _) +# undef AUTOBOOST_HASH_TUPLE_F #endif #endif -#if !defined(BOOST_NO_CXX11_SMART_PTR) +#if !defined(AUTOBOOST_NO_CXX11_SMART_PTR) template inline std::size_t hash_value(std::shared_ptr const& x) { return autoboost::hash_value(x.get()); @@ -206,7 +206,7 @@ namespace autoboost // On compilers without function template ordering, this deals with arrays. -#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) +#if defined(AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING) namespace hash_detail { template @@ -240,23 +240,23 @@ namespace autoboost template struct call_hash : public call_hash_impl::value> - ::BOOST_NESTED_TEMPLATE inner + ::AUTOBOOST_NESTED_TEMPLATE inner { }; } -#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING +#endif // AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING // // autoboost::hash // -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +#if !defined(AUTOBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template struct hash : std::unary_function { -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) +#if !defined(AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING) std::size_t operator()(T const& val) const { return hash_value(val); @@ -269,7 +269,7 @@ namespace autoboost #endif }; -#if BOOST_WORKAROUND(__DMC__, <= 0x848) +#if AUTOBOOST_WORKAROUND(__DMC__, <= 0x848) template struct hash : std::unary_function { @@ -280,7 +280,7 @@ namespace autoboost }; #endif -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#else // AUTOBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // On compilers without partial specialization, autoboost::hash // has already been declared to deal with pointers, so just @@ -298,7 +298,7 @@ namespace autoboost struct inner : std::unary_function { -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) +#if !defined(AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING) std::size_t operator()(T const& val) const { return hash_value(val); @@ -312,7 +312,7 @@ namespace autoboost }; }; } -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#endif // AUTOBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION } #endif diff --git a/contrib/autoboost/autoboost/functional/hash/hash.hpp b/contrib/autoboost/autoboost/functional/hash/hash.hpp new file mode 100644 index 000000000..2e585a217 --- /dev/null +++ b/contrib/autoboost/autoboost/functional/hash/hash.hpp @@ -0,0 +1,559 @@ + +// Copyright 2005-2014 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) + +// Based on Peter Dimov's proposal +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf +// issue 6.18. +// +// This also contains public domain code from MurmurHash. From the +// MurmurHash header: + +// MurmurHash3 was written by Austin Appleby, and is placed in the public +// domain. The author hereby disclaims copyright to this source code. + +#if !defined(AUTOBOOST_FUNCTIONAL_HASH_HASH_HPP) +#define AUTOBOOST_FUNCTIONAL_HASH_HASH_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(AUTOBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +#include +#endif + +#if !defined(AUTOBOOST_NO_CXX11_HDR_TYPEINDEX) +#include +#endif + +#if defined(AUTOBOOST_MSVC) +#pragma warning(push) + +#if AUTOBOOST_MSVC >= 1400 +#pragma warning(disable:6295) // Ill-defined for-loop : 'unsigned int' values + // are always of range '0' to '4294967295'. + // Loop executes infinitely. +#endif + +#endif + +#if AUTOBOOST_WORKAROUND(__GNUC__, < 3) \ + && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) +#define AUTOBOOST_HASH_CHAR_TRAITS string_char_traits +#else +#define AUTOBOOST_HASH_CHAR_TRAITS char_traits +#endif + +#if defined(_MSC_VER) +# define AUTOBOOST_FUNCTIONAL_HASH_ROTL32(x, r) _rotl(x,r) +#else +# define AUTOBOOST_FUNCTIONAL_HASH_ROTL32(x, r) (x << r) | (x >> (32 - r)) +#endif + +namespace autoboost +{ + namespace hash_detail + { + struct enable_hash_value { typedef std::size_t type; }; + + template struct basic_numbers {}; + template struct long_numbers; + template struct ulong_numbers; + template struct float_numbers {}; + + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; + +#if !defined(AUTOBOOST_NO_INTRINSIC_WCHAR_T) + template <> struct basic_numbers : + autoboost::hash_detail::enable_hash_value {}; +#endif + + // long_numbers is defined like this to allow for separate + // specialization for long_long and int128_type, in case + // they conflict. + template struct long_numbers2 {}; + template struct ulong_numbers2 {}; + template struct long_numbers : long_numbers2 {}; + template struct ulong_numbers : ulong_numbers2 {}; + +#if !defined(AUTOBOOST_NO_LONG_LONG) + template <> struct long_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct ulong_numbers : + autoboost::hash_detail::enable_hash_value {}; +#endif + +#if defined(AUTOBOOST_HAS_INT128) + template <> struct long_numbers2 : + autoboost::hash_detail::enable_hash_value {}; + template <> struct ulong_numbers2 : + autoboost::hash_detail::enable_hash_value {}; +#endif + + template <> struct float_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct float_numbers : + autoboost::hash_detail::enable_hash_value {}; + template <> struct float_numbers : + autoboost::hash_detail::enable_hash_value {}; + } + + template + typename autoboost::hash_detail::basic_numbers::type hash_value(T); + template + typename autoboost::hash_detail::long_numbers::type hash_value(T); + template + typename autoboost::hash_detail::ulong_numbers::type hash_value(T); + + template + typename autoboost::enable_if, std::size_t>::type + hash_value(T); + +#if !AUTOBOOST_WORKAROUND(__DMC__, <= 0x848) + template std::size_t hash_value(T* const&); +#else + template std::size_t hash_value(T*); +#endif + +#if !defined(AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING) + template< class T, unsigned N > + std::size_t hash_value(const T (&x)[N]); + + template< class T, unsigned N > + std::size_t hash_value(T (&x)[N]); +#endif + + template + std::size_t hash_value( + std::basic_string, A> const&); + + template + typename autoboost::hash_detail::float_numbers::type hash_value(T); + +#if !defined(AUTOBOOST_NO_CXX11_HDR_TYPEINDEX) + std::size_t hash_value(std::type_index); +#endif + + // Implementation + + namespace hash_detail + { + template + inline std::size_t hash_value_signed(T val) + { + const int size_t_bits = std::numeric_limits::digits; + // ceiling(std::numeric_limits::digits / size_t_bits) - 1 + const int length = (std::numeric_limits::digits - 1) + / size_t_bits; + + std::size_t seed = 0; + T positive = val < 0 ? -1 - val : val; + + // Hopefully, this loop can be unrolled. + for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits) + { + seed ^= (std::size_t) (positive >> i) + (seed<<6) + (seed>>2); + } + seed ^= (std::size_t) val + (seed<<6) + (seed>>2); + + return seed; + } + + template + inline std::size_t hash_value_unsigned(T val) + { + const int size_t_bits = std::numeric_limits::digits; + // ceiling(std::numeric_limits::digits / size_t_bits) - 1 + const int length = (std::numeric_limits::digits - 1) + / size_t_bits; + + std::size_t seed = 0; + + // Hopefully, this loop can be unrolled. + for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits) + { + seed ^= (std::size_t) (val >> i) + (seed<<6) + (seed>>2); + } + seed ^= (std::size_t) val + (seed<<6) + (seed>>2); + + return seed; + } + + template + inline void hash_combine_impl(SizeT& seed, SizeT value) + { + seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2); + } + + template + inline void hash_combine_impl(autoboost::uint32_t& h1, + autoboost::uint32_t k1) + { + const uint32_t c1 = 0xcc9e2d51; + const uint32_t c2 = 0x1b873593; + + k1 *= c1; + k1 = AUTOBOOST_FUNCTIONAL_HASH_ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = AUTOBOOST_FUNCTIONAL_HASH_ROTL32(h1,13); + h1 = h1*5+0xe6546b64; + } + + +// Don't define 64-bit hash combine on platforms with 64 bit integers, +// and also not for 32-bit gcc as it warns about the 64-bit constant. +#if !defined(AUTOBOOST_NO_INT64_T) && \ + !(defined(__GNUC__) && ULONG_MAX == 0xffffffff) + + template + inline void hash_combine_impl(autoboost::uint64_t& h, + autoboost::uint64_t k) + { + const uint64_t m = UINT64_C(0xc6a4a7935bd1e995); + const int r = 47; + + k *= m; + k ^= k >> r; + k *= m; + + h ^= k; + h *= m; + } + +#endif // AUTOBOOST_NO_INT64_T + } + + template + typename autoboost::hash_detail::basic_numbers::type hash_value(T v) + { + return static_cast(v); + } + + template + typename autoboost::hash_detail::long_numbers::type hash_value(T v) + { + return hash_detail::hash_value_signed(v); + } + + template + typename autoboost::hash_detail::ulong_numbers::type hash_value(T v) + { + return hash_detail::hash_value_unsigned(v); + } + + template + typename autoboost::enable_if, std::size_t>::type + hash_value(T v) + { + return static_cast(v); + } + + // Implementation by Alberto Barbati and Dave Harris. +#if !AUTOBOOST_WORKAROUND(__DMC__, <= 0x848) + template std::size_t hash_value(T* const& v) +#else + template std::size_t hash_value(T* v) +#endif + { +#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 + // for some reason ptrdiff_t on OpenVMS compiler with + // 64 bit is not 64 bit !!! + std::size_t x = static_cast( + reinterpret_cast(v)); +#else + std::size_t x = static_cast( + reinterpret_cast(v)); +#endif + return x + (x >> 3); + } + +#if defined(AUTOBOOST_MSVC) +#pragma warning(push) +#if AUTOBOOST_MSVC <= 1400 +#pragma warning(disable:4267) // 'argument' : conversion from 'size_t' to + // 'unsigned int', possible loss of data + // A misguided attempt to detect 64-bit + // incompatability. +#endif +#endif + + template + inline void hash_combine(std::size_t& seed, T const& v) + { + autoboost::hash hasher; + return autoboost::hash_detail::hash_combine_impl(seed, hasher(v)); + } + +#if defined(AUTOBOOST_MSVC) +#pragma warning(pop) +#endif + + template + inline std::size_t hash_range(It first, It last) + { + std::size_t seed = 0; + + for(; first != last; ++first) + { + hash_combine(seed, *first); + } + + return seed; + } + + template + inline void hash_range(std::size_t& seed, It first, It last) + { + for(; first != last; ++first) + { + hash_combine(seed, *first); + } + } + +#if AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT(0x551)) + template + inline std::size_t hash_range(T* first, T* last) + { + std::size_t seed = 0; + + for(; first != last; ++first) + { + autoboost::hash hasher; + seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2); + } + + return seed; + } + + template + inline void hash_range(std::size_t& seed, T* first, T* last) + { + for(; first != last; ++first) + { + autoboost::hash hasher; + seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2); + } + } +#endif + +#if !defined(AUTOBOOST_NO_FUNCTION_TEMPLATE_ORDERING) + template< class T, unsigned N > + inline std::size_t hash_value(const T (&x)[N]) + { + return hash_range(x, x + N); + } + + template< class T, unsigned N > + inline std::size_t hash_value(T (&x)[N]) + { + return hash_range(x, x + N); + } +#endif + + template + inline std::size_t hash_value( + std::basic_string, A> const& v) + { + return hash_range(v.begin(), v.end()); + } + + template + typename autoboost::hash_detail::float_numbers::type hash_value(T v) + { + return autoboost::hash_detail::float_hash_value(v); + } + +#if !defined(AUTOBOOST_NO_CXX11_HDR_TYPEINDEX) + inline std::size_t hash_value(std::type_index v) + { + return v.hash_code(); + } +#endif + + // + // autoboost::hash + // + + // Define the specializations required by the standard. The general purpose + // autoboost::hash is defined later in extensions.hpp if + // AUTOBOOST_HASH_NO_EXTENSIONS is not defined. + + // AUTOBOOST_HASH_SPECIALIZE - define a specialization for a type which is + // passed by copy. + // + // AUTOBOOST_HASH_SPECIALIZE_REF - define a specialization for a type which is + // passed by copy. + // + // These are undefined later. + +#define AUTOBOOST_HASH_SPECIALIZE(type) \ + template <> struct hash \ + : public std::unary_function \ + { \ + std::size_t operator()(type v) const \ + { \ + return autoboost::hash_value(v); \ + } \ + }; + +#define AUTOBOOST_HASH_SPECIALIZE_REF(type) \ + template <> struct hash \ + : public std::unary_function \ + { \ + std::size_t operator()(type const& v) const \ + { \ + return autoboost::hash_value(v); \ + } \ + }; + + AUTOBOOST_HASH_SPECIALIZE(bool) + AUTOBOOST_HASH_SPECIALIZE(char) + AUTOBOOST_HASH_SPECIALIZE(signed char) + AUTOBOOST_HASH_SPECIALIZE(unsigned char) +#if !defined(AUTOBOOST_NO_INTRINSIC_WCHAR_T) + AUTOBOOST_HASH_SPECIALIZE(wchar_t) +#endif + AUTOBOOST_HASH_SPECIALIZE(short) + AUTOBOOST_HASH_SPECIALIZE(unsigned short) + AUTOBOOST_HASH_SPECIALIZE(int) + AUTOBOOST_HASH_SPECIALIZE(unsigned int) + AUTOBOOST_HASH_SPECIALIZE(long) + AUTOBOOST_HASH_SPECIALIZE(unsigned long) + + AUTOBOOST_HASH_SPECIALIZE(float) + AUTOBOOST_HASH_SPECIALIZE(double) + AUTOBOOST_HASH_SPECIALIZE(long double) + + AUTOBOOST_HASH_SPECIALIZE_REF(std::string) +#if !defined(AUTOBOOST_NO_STD_WSTRING) + AUTOBOOST_HASH_SPECIALIZE_REF(std::wstring) +#endif + +#if !defined(AUTOBOOST_NO_LONG_LONG) + AUTOBOOST_HASH_SPECIALIZE(autoboost::long_long_type) + AUTOBOOST_HASH_SPECIALIZE(autoboost::ulong_long_type) +#endif + +#if defined(AUTOBOOST_HAS_INT128) + AUTOBOOST_HASH_SPECIALIZE(autoboost::int128_type) + AUTOBOOST_HASH_SPECIALIZE(autoboost::uint128_type) +#endif + +#if !defined(AUTOBOOST_NO_CXX11_HDR_TYPEINDEX) + AUTOBOOST_HASH_SPECIALIZE(std::type_index) +#endif + +#undef AUTOBOOST_HASH_SPECIALIZE +#undef AUTOBOOST_HASH_SPECIALIZE_REF + +// Specializing autoboost::hash for pointers. + +#if !defined(AUTOBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + + template + struct hash + : public std::unary_function + { + std::size_t operator()(T* v) const + { +#if !AUTOBOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) + return autoboost::hash_value(v); +#else + std::size_t x = static_cast( + reinterpret_cast(v)); + + return x + (x >> 3); +#endif + } + }; + +#else + + // For compilers without partial specialization, we define a + // autoboost::hash for all remaining types. But hash_impl is only defined + // for pointers in 'extensions.hpp' - so when AUTOBOOST_HASH_NO_EXTENSIONS + // is defined there will still be a compile error for types not supported + // in the standard. + + namespace hash_detail + { + template + struct hash_impl; + + template <> + struct hash_impl + { + template + struct inner + : public std::unary_function + { + std::size_t operator()(T val) const + { +#if !AUTOBOOST_WORKAROUND(__SUNPRO_CC, <= 590) + return autoboost::hash_value(val); +#else + std::size_t x = static_cast( + reinterpret_cast(val)); + + return x + (x >> 3); +#endif + } + }; + }; + } + + template struct hash + : public autoboost::hash_detail::hash_impl::value> + ::AUTOBOOST_NESTED_TEMPLATE inner + { + }; + +#endif +} + +#undef AUTOBOOST_HASH_CHAR_TRAITS +#undef AUTOBOOST_FUNCTIONAL_HASH_ROTL32 + +#if defined(AUTOBOOST_MSVC) +#pragma warning(pop) +#endif + +#endif // AUTOBOOST_FUNCTIONAL_HASH_HASH_HPP + +// Include this outside of the include guards in case the file is included +// twice - once with AUTOBOOST_HASH_NO_EXTENSIONS defined, and then with it +// undefined. + +#if !defined(AUTOBOOST_HASH_NO_EXTENSIONS) \ + && !defined(AUTOBOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP) +#include +#endif diff --git a/contrib/autoboost/autoboost/functional/hash/hash_fwd.hpp b/contrib/autoboost/autoboost/functional/hash/hash_fwd.hpp new file mode 100644 index 000000000..cac00a0de --- /dev/null +++ b/contrib/autoboost/autoboost/functional/hash/hash_fwd.hpp @@ -0,0 +1,36 @@ + +// Copyright 2005-2009 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) + +// Based on Peter Dimov's proposal +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf +// issue 6.18. + +#if !defined(AUTOBOOST_FUNCTIONAL_HASH_FWD_HPP) +#define AUTOBOOST_FUNCTIONAL_HASH_FWD_HPP + +#include +#if defined(AUTOBOOST_HAS_PRAGMA_ONCE) +#pragma once +#endif + +#include +#include + +namespace autoboost +{ + template struct hash; + + template void hash_combine(std::size_t& seed, T const& v); + + template std::size_t hash_range(It, It); + template void hash_range(std::size_t&, It, It); + +#if AUTOBOOST_WORKAROUND(__BORLANDC__, AUTOBOOST_TESTED_AT(0x551)) + template inline std::size_t hash_range(T*, T*); + template inline void hash_range(std::size_t&, T*, T*); +#endif +} + +#endif diff --git a/contrib/autoboost/autoboost/functional/hash_fwd.hpp b/contrib/autoboost/autoboost/functional/hash_fwd.hpp new file mode 100644 index 000000000..b8480b9b3 --- /dev/null +++ b/contrib/autoboost/autoboost/functional/hash_fwd.hpp @@ -0,0 +1,11 @@ + +// Copyright 2005-2009 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) + +#include +#if defined(AUTOBOOST_HAS_PRAGMA_ONCE) +#pragma once +#endif + +#include diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl.hpp new file mode 100644 index 000000000..cb779f11d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl.hpp @@ -0,0 +1,23 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_MPL_31122005_1152) +#define AUTOBOOST_FUSION_MPL_31122005_1152 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/at_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/at_impl.hpp new file mode 100644 index 000000000..e3f50cb72 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/at_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_AT_IMPL_31122005_1642) +#define AUTOBOOST_FUSION_AT_IMPL_31122005_1642 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef typename mpl::at::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence) + { + return type(); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/begin_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/begin_impl.hpp new file mode 100644 index 000000000..3b2730712 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/begin_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_BEGIN_IMPL_31122005_1209) +#define AUTOBOOST_FUSION_BEGIN_IMPL_31122005_1209 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion { + + struct mpl_sequence_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename mpl::begin< + typename remove_const::type + >::type iterator; + typedef mpl_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence) + { + return type(); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/category_of_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/category_of_impl.hpp new file mode 100644 index 000000000..0da2d8ec2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/category_of_impl.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_CATEGORY_OF_IMPL_20060217_2141) +#define AUTOBOOST_FUSION_CATEGORY_OF_IMPL_20060217_2141 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { + + namespace detail + { + template + struct mpl_sequence_category_of + { + // assumes T is an mpl sequence + // there should be no way this will ever be + // called where T is an mpl iterator + + AUTOBOOST_STATIC_ASSERT(mpl::is_sequence::value); + typedef typename + mpl_iterator_category< + typename mpl::begin::type::category + >::type + type; + }; + } + + struct mpl_sequence_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + : detail::mpl_sequence_category_of + {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/empty_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/empty_impl.hpp new file mode 100644 index 000000000..fea3ee18b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/empty_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_EMPTY_IMPL_31122005_1554) +#define AUTOBOOST_FUSION_EMPTY_IMPL_31122005_1554 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct empty_impl; + + template <> + struct empty_impl + { + template + struct apply : mpl::empty {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/end_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/end_impl.hpp new file mode 100644 index 000000000..69cc7b3aa --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/end_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_END_IMPL_31122005_1237) +#define AUTOBOOST_FUSION_END_IMPL_31122005_1237 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename mpl::end< + typename remove_const::type + >::type iterator; + typedef mpl_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence) + { + return type(); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/has_key_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/has_key_impl.hpp new file mode 100644 index 000000000..f326d4545 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/has_key_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_HAS_KEY_IMPL_31122005_1647) +#define AUTOBOOST_FUSION_HAS_KEY_IMPL_31122005_1647 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct has_key_impl; + + template <> + struct has_key_impl + { + template + struct apply : mpl::has_key {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/is_sequence_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/is_sequence_impl.hpp new file mode 100644 index 000000000..a577dd5b7 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/is_sequence_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_IS_SEQUENCE_IMPL_31122005_1505) +#define AUTOBOOST_FUSION_IS_SEQUENCE_IMPL_31122005_1505 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/is_view_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/is_view_impl.hpp new file mode 100644 index 000000000..7e69d2e51 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/is_view_impl.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_IS_VIEW_IMPL_03202006_0048) +#define AUTOBOOST_FUSION_IS_VIEW_IMPL_03202006_0048 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::true_ + {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/size_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/size_impl.hpp new file mode 100644 index 000000000..c344783eb --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/size_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_SIZE_IMPL_31122005_1508) +#define AUTOBOOST_FUSION_SIZE_IMPL_31122005_1508 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply : mpl::size {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/value_at_impl.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/value_at_impl.hpp new file mode 100644 index 000000000..a85065970 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/detail/value_at_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_VALUE_AT_IMPL_31122005_1621) +#define AUTOBOOST_FUSION_VALUE_AT_IMPL_31122005_1621 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply : mpl::at {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/adapted/mpl/mpl_iterator.hpp b/contrib/autoboost/autoboost/fusion/adapted/mpl/mpl_iterator.hpp new file mode 100644 index 000000000..a18248bd2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/adapted/mpl/mpl_iterator.hpp @@ -0,0 +1,119 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_MPL_ITERATOR_05052005_0731) +#define FUSION_MPL_ITERATOR_05052005_0731 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + template + struct mpl_iterator + : iterator_facade< + mpl_iterator + , typename detail::mpl_iterator_category::type + > + { + typedef typename remove_const::type iterator_type; + + template + struct value_of : mpl::deref {}; + + template + struct deref + { + typedef typename mpl::deref< + typename Iterator::iterator_type>::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator) + { + return type(); + } + }; + + template + struct next + { + typedef mpl_iterator< + typename mpl::next::type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator) + { + return type(); + } + }; + + template + struct prior + { + typedef mpl_iterator< + typename mpl::prior::type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator) + { + return type(); + } + }; + + template + struct advance + { + typedef mpl_iterator< + typename mpl::advance::type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& /*i*/) + { + return type(); + } + }; + + template + struct distance : + mpl::distance< + typename I1::iterator_type + , typename I2::iterator_type> + { + typedef typename + mpl::distance< + typename I1::iterator_type + , typename I2::iterator_type + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(I1 const&, I2 const&) + { + return type(); + } + }; + }; +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/iteration/detail/for_each.hpp b/contrib/autoboost/autoboost/fusion/algorithm/iteration/detail/for_each.hpp new file mode 100644 index 000000000..29e972b61 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/iteration/detail/for_each.hpp @@ -0,0 +1,149 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_FOR_EACH_05052005_1028) +#define FUSION_FOR_EACH_05052005_1028 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { +namespace detail +{ + template + AUTOBOOST_FUSION_GPU_ENABLED + inline void + for_each_linear(First const&, Last const&, F const&, mpl::true_) + { + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline void + for_each_linear(First const& first, Last const& last, F const& f, mpl::false_) + { + f(*first); + detail::for_each_linear(fusion::next(first), last, f, + result_of::equal_to::type, Last>()); + } + + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline void + for_each_dispatch(Sequence& seq, F const& f, Tag) + { + detail::for_each_linear( + fusion::begin(seq) + , fusion::end(seq) + , f + , result_of::equal_to< + typename result_of::begin::type + , typename result_of::end::type>()); + } + + template + struct for_each_unrolled + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + typedef typename result_of::next::type I2; + I2 i2(fusion::next(i1)); + f(*i2); + typedef typename result_of::next::type I3; + I3 i3(fusion::next(i2)); + f(*i3); + for_each_unrolled::call(fusion::next(i3), f); + } + }; + + template<> + struct for_each_unrolled<3> + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + typedef typename result_of::next::type I2; + I2 i2(fusion::next(i1)); + f(*i2); + } + }; + + template<> + struct for_each_unrolled<2> + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + } + }; + + template<> + struct for_each_unrolled<1> + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static void call(I0 const& i0, F const& f) + { + f(*i0); + } + }; + + template<> + struct for_each_unrolled<0> + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static void call(It const&, F const&) + { + } + }; + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline void + for_each_dispatch(Sequence& seq, F const& f, random_access_traversal_tag) + { + typedef typename result_of::begin::type begin; + typedef typename result_of::end::type end; + for_each_unrolled::type::value>::call(fusion::begin(seq), f); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline void + for_each(Sequence& seq, F const& f, mpl::false_) // unsegmented implementation + { + detail::for_each_dispatch(seq, f, typename traits::category_of::type()); + } +}}} + + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/iteration/detail/segmented_for_each.hpp b/contrib/autoboost/autoboost/fusion/algorithm/iteration/detail/segmented_for_each.hpp new file mode 100644 index 000000000..73a1a7a12 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/iteration/detail/segmented_for_each.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_FOR_EACH_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_FOR_EACH_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct segmented_for_each_fun + { + AUTOBOOST_FUSION_GPU_ENABLED + explicit segmented_for_each_fun(Fun const& f) + : fun(f) + {} + + Fun const& fun; + + template + struct apply + { + typedef void_ type; + typedef mpl::true_ continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq, State const&, Context const&, segmented_for_each_fun const& fun) + { + fusion::for_each(seq, fun.fun); + return void_(); + } + }; + }; + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline void + for_each(Sequence& seq, F const& f, mpl::true_) // segmented implementation + { + fusion::segmented_fold_until(seq, void_(), segmented_for_each_fun(f)); + } +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/iteration/for_each.hpp b/contrib/autoboost/autoboost/fusion/algorithm/iteration/for_each.hpp new file mode 100644 index 000000000..8a54a02c1 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/iteration/for_each.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2007 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_FOR_EACH_20070527_0943) +#define AUTOBOOST_FUSION_FOR_EACH_20070527_0943 + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct for_each + { + typedef void type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline + typename + enable_if< + traits::is_sequence + , void + >::type + for_each(Sequence& seq, F const& f) + { + detail::for_each(seq, f, typename traits::is_segmented::type()); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline + typename + enable_if< + traits::is_sequence + , void + >::type + for_each(Sequence const& seq, F const& f) + { + detail::for_each(seq, f, typename traits::is_segmented::type()); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/iteration/for_each_fwd.hpp b/contrib/autoboost/autoboost/fusion/algorithm/iteration/for_each_fwd.hpp new file mode 100644 index 000000000..6a3aac753 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/iteration/for_each_fwd.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_FOR_EACH_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_FOR_EACH_FWD_HPP_INCLUDED + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct for_each; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline + typename + enable_if< + traits::is_sequence + , void + >::type + for_each(Sequence& seq, F const& f); + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline + typename + enable_if< + traits::is_sequence + , void + >::type + for_each(Sequence const& seq, F const& f); +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/any.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/any.hpp new file mode 100644 index 000000000..f2034d3c2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/any.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + Copyright (c) 2007 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) +==============================================================================*/ +#if !defined(FUSION_ANY_05052005_1230) +#define FUSION_ANY_05052005_1230 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct any + { + typedef bool type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline bool + any(Sequence const& seq, F f) + { + return detail::any(seq, f, typename traits::category_of::type()); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/detail/any.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/detail/any.hpp new file mode 100644 index 000000000..200b240ee --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/detail/any.hpp @@ -0,0 +1,140 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + Copyright (c) 2007 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) +==============================================================================*/ +#if !defined(FUSION_ANY_05052005_1229) +#define FUSION_ANY_05052005_1229 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { + struct random_access_traversal_tag; +namespace detail +{ + template + AUTOBOOST_FUSION_GPU_ENABLED + inline bool + linear_any(First const&, Last const&, F const&, mpl::true_) + { + return false; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline bool + linear_any(First const& first, Last const& last, F& f, mpl::false_) + { + typename result_of::deref::type x = *first; + return f(x) || + detail::linear_any( + fusion::next(first) + , last + , f + , result_of::equal_to::type, Last>()); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline bool + any(Sequence const& seq, F f, Tag) + { + return detail::linear_any( + fusion::begin(seq) + , fusion::end(seq) + , f + , result_of::equal_to< + typename result_of::begin::type + , typename result_of::end::type>()); + } + + template + struct unrolled_any + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it))|| + f(*fusion::advance_c<2>(it)) || + f(*fusion::advance_c<3>(it)) || + detail::unrolled_any::call(fusion::advance_c<4>(it), f); + } + }; + + template<> + struct unrolled_any<3> + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it)) || + f(*fusion::advance_c<2>(it)); + } + }; + + template<> + struct unrolled_any<2> + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it)); + } + }; + + template<> + struct unrolled_any<1> + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool call(It const& it, F f) + { + return f(*it); + } + }; + + template<> + struct unrolled_any<0> + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool call(It const&, F) + { + return false; + } + }; + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline bool + any(Sequence const& seq, F f, random_access_traversal_tag) + { + typedef typename result_of::begin::type begin; + typedef typename result_of::end::type end; + return detail::unrolled_any::type::value>::call( + fusion::begin(seq), f); + } +}}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/detail/find_if.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/detail/find_if.hpp new file mode 100644 index 000000000..379f33cdb --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/detail/find_if.hpp @@ -0,0 +1,260 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2007 Dan Marsden + Copyright (c) 2009 Christopher Schmidt + + 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(FUSION_FIND_IF_05052005_1107) +#define FUSION_FIND_IF_05052005_1107 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { + struct random_access_traversal_tag; +namespace detail +{ + template + struct apply_filter + { + typedef typename mpl::apply1< + Pred, Iterator>::type type; + AUTOBOOST_STATIC_CONSTANT(int, value = type::value); + }; + + template + struct main_find_if; + + template + struct recursive_find_if + { + typedef typename + main_find_if< + typename result_of::next::type, Last, Pred + >::type + type; + }; + + template + struct main_find_if + { + typedef mpl::or_< + result_of::equal_to + , apply_filter > + filter; + + typedef typename + mpl::eval_if< + filter + , mpl::identity + , recursive_find_if + >::type + type; + }; + + template< + typename First, typename Last, + typename Pred, bool> + struct choose_find_if; + + template + struct choose_find_if + : main_find_if + {}; + + template + struct unroll_again; + + template + struct apply_offset_filter + { + typedef typename result_of::advance_c::type Shifted; + typedef typename + mpl::apply1< + Pred + , Shifted + >::type + type; + AUTOBOOST_STATIC_CONSTANT(int, value = type::value); + }; + + template + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter, + mpl::identity, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + unroll_again< + Iter, + Pred, + n, + 4> > > > >::type type; + }; + + template + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter, + mpl::identity, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + result_of::advance_c > > >::type type; + }; + + template + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter, + mpl::identity, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + result_of::advance_c > >::type type; + }; + + template + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter, + mpl::identity, + result_of::advance_c >::type type; + }; + + template + struct unroll_again + { + typedef typename unrolled_find_if< + typename result_of::advance_c::type, + Pred, + n-unrolling>::type type; + }; + + template + struct unrolled_find_if + { + typedef Iter type; + }; + + template + struct choose_find_if + { + typedef typename result_of::distance::type N; + typedef typename unrolled_find_if::type type; + }; + + template + struct static_find_if + { + typedef typename + choose_find_if< + First + , Last + , typename mpl::lambda::type + , is_base_of::type>::value + >::type + type; + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + recursive_call(Iterator const& iter, mpl::true_) + { + return iter; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + recursive_call(Iterator const& iter, mpl::false_) + { + return recursive_call(fusion::next(iter)); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + recursive_call(Iterator const& iter) + { + typedef result_of::equal_to found; + return recursive_call(iter, found()); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + choose_call(Iterator const& iter, Tag) + { + return recursive_call(iter); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + choose_call(Iterator const& iter, random_access_traversal_tag) + { + typedef typename result_of::distance::type N; + return fusion::advance(iter); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + iter_call(Iterator const& iter) + { + return choose_call(iter, typename traits::category_of::type()); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& seq) + { + return iter_call(fusion::begin(seq)); + } + }; + + template + struct result_of_find_if + { + typedef + static_find_if< + typename result_of::begin::type + , typename result_of::end::type + , Pred + > + filter; + + typedef typename filter::type type; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/detail/segmented_find.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/detail/segmented_find.hpp new file mode 100644 index 000000000..4c4ae2d0f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/detail/segmented_find.hpp @@ -0,0 +1,95 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_FIND_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_FIND_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct segmented_find_fun + { + template + struct apply + { + typedef + typename result_of::find::type + iterator_type; + + typedef + typename result_of::equal_to< + iterator_type + , typename result_of::end::type + >::type + continue_type; + + typedef + typename mpl::eval_if< + continue_type + , mpl::identity + , result_of::make_segmented_iterator< + iterator_type + , Context + > + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq, State const&state, Context const& context, segmented_find_fun) + { + return call_impl(seq, state, context, continue_type()); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type call_impl(Sequence&, State const&state, Context const&, mpl::true_) + { + return state; + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type call_impl(Sequence& seq, State const&, Context const& context, mpl::false_) + { + return fusion::make_segmented_iterator(fusion::find(seq), context); + } + }; + }; + + template + struct result_of_segmented_find + { + struct filter + { + typedef + typename result_of::segmented_fold_until< + Sequence + , typename result_of::end::type + , segmented_find_fun + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq) + { + return fusion::segmented_fold_until( + seq + , fusion::end(seq) + , detail::segmented_find_fun()); + } + }; + + typedef typename filter::type type; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/detail/segmented_find_if.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/detail/segmented_find_if.hpp new file mode 100644 index 000000000..070ef728b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/detail/segmented_find_if.hpp @@ -0,0 +1,95 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_FIND_IF_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_FIND_IF_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct segmented_find_if_fun + { + template + struct apply + { + typedef + typename result_of::find_if::type + iterator_type; + + typedef + typename result_of::equal_to< + iterator_type + , typename result_of::end::type + >::type + continue_type; + + typedef + typename mpl::eval_if< + continue_type + , mpl::identity + , result_of::make_segmented_iterator< + iterator_type + , Context + > + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq, State const&state, Context const& context, segmented_find_if_fun) + { + return call_impl(seq, state, context, continue_type()); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type call_impl(Sequence&, State const&state, Context const&, mpl::true_) + { + return state; + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type call_impl(Sequence& seq, State const&, Context const& context, mpl::false_) + { + return fusion::make_segmented_iterator(fusion::find_if(seq), context); + } + }; + }; + + template + struct result_of_segmented_find_if + { + struct filter + { + typedef + typename result_of::segmented_fold_until< + Sequence + , typename result_of::end::type + , segmented_find_if_fun + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq) + { + return fusion::segmented_fold_until( + seq + , fusion::end(seq) + , segmented_find_if_fun()); + } + }; + + typedef typename filter::type type; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/find.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/find.hpp new file mode 100644 index 000000000..200f70e6e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/find.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(FUSION_FIND_05052005_1107) +#define FUSION_FIND_05052005_1107 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct find + : mpl::if_< + traits::is_segmented + , detail::result_of_segmented_find + , detail::result_of_find_if< + Sequence, + is_same< + typename mpl::if_< + traits::is_associative + , key_of + , value_of + >::type + , T + > + > + >::type + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + lazy_disable_if< + is_const + , result_of::find + >::type const + find(Sequence& seq) + { + typedef typename result_of::find::filter filter; + return filter::call(seq); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::find::type const + find(Sequence const& seq) + { + typedef typename result_of::find::filter filter; + return filter::call(seq); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/find_fwd.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/find_fwd.hpp new file mode 100644 index 000000000..100e844ba --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/find_fwd.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_FIND_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_FIND_FWD_HPP_INCLUDED + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct find; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + lazy_disable_if< + is_const + , result_of::find + >::type const + find(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::find::type const + find(Sequence const& seq); +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/find_if.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/find_if.hpp new file mode 100644 index 000000000..543d26ed9 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/find_if.hpp @@ -0,0 +1,67 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(FUSION_FIND_IF_05052005_1108) +#define FUSION_FIND_IF_05052005_1108 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct find_if + : mpl::if_< + traits::is_segmented + , detail::result_of_segmented_find_if + , detail::result_of_find_if< + Sequence, + mpl::bind1< + typename mpl::lambda::type + , mpl::bind1, mpl::_1> + > + > + >::type + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + lazy_disable_if< + is_const + , result_of::find_if + >::type + find_if(Sequence& seq) + { + typedef typename result_of::find_if::filter filter; + return filter::call(seq); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::find_if::type const + find_if(Sequence const& seq) + { + typedef typename result_of::find_if::filter filter; + return filter::call(seq); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/query/find_if_fwd.hpp b/contrib/autoboost/autoboost/fusion/algorithm/query/find_if_fwd.hpp new file mode 100644 index 000000000..3b823853e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/query/find_if_fwd.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_FIND_IF_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_FIND_IF_FWD_HPP_INCLUDED + +#include +#include +#include + +// Forward declaration of find_if algorithm +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct find_if; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_disable_if< + is_const + , result_of::find_if + >::type + find_if(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::find_if::type const + find_if(Sequence const& seq); +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/algorithm/transformation/erase.hpp b/contrib/autoboost/autoboost/fusion/algorithm/transformation/erase.hpp new file mode 100644 index 000000000..7eca23818 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/transformation/erase.hpp @@ -0,0 +1,141 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ERASE_07232005_0534) +#define FUSION_ERASE_07232005_0534 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct compute_erase_last // put this in detail!!! + { + typedef typename result_of::end::type seq_last_type; + typedef typename convert_iterator::type first_type; + typedef typename + mpl::if_< + result_of::equal_to + , first_type + , typename result_of::next::type + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(First const& first, mpl::false_) + { + return fusion::next(convert_iterator::call(first)); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(First const& first, mpl::true_) + { + return convert_iterator::call(first); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(First const& first) + { + return call(first, result_of::equal_to()); + } + }; + + struct use_default; + + template + struct fusion_default_help + : mpl::if_< + is_same + , Default + , T + > + { + }; + + template < + typename Sequence + , typename First + , typename Last = use_default> + struct erase + { + typedef typename result_of::begin::type seq_first_type; + typedef typename result_of::end::type seq_last_type; + AUTOBOOST_STATIC_ASSERT((!result_of::equal_to::value)); + + typedef First FirstType; + typedef typename + fusion_default_help< + Last + , typename compute_erase_last::type + >::type + LastType; + + typedef typename convert_iterator::type first_type; + typedef typename convert_iterator::type last_type; + typedef iterator_range left_type; + typedef iterator_range right_type; + typedef joint_view type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_enable_if< + traits::is_sequence + , typename result_of::erase + >::type + erase(Sequence const& seq, First const& first) + { + typedef result_of::erase result_of; + typedef typename result_of::left_type left_type; + typedef typename result_of::right_type right_type; + typedef typename result_of::type result_type; + + left_type left( + fusion::begin(seq) + , convert_iterator::call(first)); + right_type right( + fusion::result_of::compute_erase_last::call(first) + , fusion::end(seq)); + return result_type(left, right); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::erase::type + erase(Sequence const& seq, First const& first, Last const& last) + { + typedef result_of::erase result_of; + typedef typename result_of::left_type left_type; + typedef typename result_of::right_type right_type; + typedef typename result_of::type result_type; + + left_type left(fusion::begin(seq), first); + right_type right(last, fusion::end(seq)); + return result_type(left, right); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/transformation/erase_key.hpp b/contrib/autoboost/autoboost/fusion/algorithm/transformation/erase_key.hpp new file mode 100644 index 000000000..90f85673d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/transformation/erase_key.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ERASE_KEY_10022005_1851) +#define FUSION_ERASE_KEY_10022005_1851 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct erase_key + : erase::type> + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::erase_key::type + erase_key(Sequence const& seq) + { + return erase(seq, find(seq)); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/transformation/insert.hpp b/contrib/autoboost/autoboost/fusion/algorithm/transformation/insert.hpp new file mode 100644 index 000000000..b3d356e8e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/transformation/insert.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_INSERT_07222005_0730) +#define FUSION_INSERT_07222005_0730 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct insert + { + typedef typename detail::as_fusion_element::type element_type; + typedef typename convert_iterator::type pos_type; + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + + typedef iterator_range left_type; + typedef iterator_range right_type; + typedef fusion::single_view single_view; + typedef joint_view left_insert_type; + typedef joint_view type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline + typename + lazy_enable_if< + traits::is_sequence + , result_of::insert + >::type + insert(Sequence const& seq, Position const& pos, T const& x) + { + typedef result_of::insert< + Sequence const, Position, T> + result_of; + typedef typename result_of::left_type left_type; + typedef typename result_of::right_type right_type; + typedef typename result_of::single_view single_view; + typedef typename result_of::left_insert_type left_insert_type; + typedef typename result_of::type result; + + left_type left(fusion::begin(seq), convert_iterator::call(pos)); + right_type right(convert_iterator::call(pos), fusion::end(seq)); + single_view insert(x); + left_insert_type left_insert(left, insert); + return result(left_insert, right); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/transformation/insert_range.hpp b/contrib/autoboost/autoboost/fusion/algorithm/transformation/insert_range.hpp new file mode 100644 index 000000000..f418888f7 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/transformation/insert_range.hpp @@ -0,0 +1,57 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_INSERT_RANGE_009172005_1147) +#define FUSION_INSERT_RANGE_009172005_1147 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct insert_range + { + typedef typename convert_iterator::type pos_type; + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + + typedef iterator_range left_type; + typedef iterator_range right_type; + typedef joint_view left_insert_type; + typedef joint_view type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::insert_range::type + insert_range(Sequence const& seq, Position const& pos, Range const& range) + { + typedef result_of::insert_range result_of; + typedef typename result_of::left_type left_type; + typedef typename result_of::right_type right_type; + typedef typename result_of::left_insert_type left_insert_type; + typedef typename result_of::type result; + + left_type left(fusion::begin(seq), convert_iterator::call(pos)); + right_type right(convert_iterator::call(pos), fusion::end(seq)); + left_insert_type left_insert(left, range); + return result(left_insert, right); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/transformation/pop_back.hpp b/contrib/autoboost/autoboost/fusion/algorithm/transformation/pop_back.hpp new file mode 100644 index 000000000..aa10cc903 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/transformation/pop_back.hpp @@ -0,0 +1,172 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_POP_BACK_09172005_1038) +#define FUSION_POP_BACK_09172005_1038 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + template + struct pop_back_iterator + : iterator_adapter< + pop_back_iterator + , Iterator_> + { + typedef iterator_adapter< + pop_back_iterator + , Iterator_> + base_type; + + static bool const is_last = IsLast; + + AUTOBOOST_FUSION_GPU_ENABLED + pop_back_iterator(Iterator_ const& iterator_base) + : base_type(iterator_base) {} + + template + struct make + { + typedef pop_back_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(BaseIterator const& i) + { + return type(i); + } + }; + + template + struct equal_to_helper + : mpl::identity + {}; + + template + struct equal_to_helper + : result_of::next< + typename I::iterator_base_type> + {}; + + template + struct equal_to + : result_of::equal_to< + typename equal_to_helper::type + , typename equal_to_helper::type + > + {}; + + template + struct distance + : mpl::minus< + typename result_of::distance< + typename First::iterator_base_type + , typename Last::iterator_base_type + >::type + , mpl::int_<(Last::is_last?1:0)> + >::type + {}; + + + template + struct prior_impl + { + typedef typename Iterator::iterator_base_type base_type; + + typedef typename + result_of::prior::type + base_prior; + + typedef pop_back_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(fusion::prior(i.iterator_base)); + } + }; + + template + struct prior_impl + { + // If this is the last iterator, we'll have to double back + typedef typename Iterator::iterator_base_type base_type; + + typedef typename + result_of::prior< + typename result_of::prior::type + >::type + base_prior; + + typedef pop_back_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(fusion::prior( + fusion::prior(i.iterator_base))); + } + }; + + template + struct prior : prior_impl + {}; + }; + + namespace result_of + { + template + struct pop_back + { + AUTOBOOST_MPL_ASSERT_NOT((result_of::empty)); + + typedef pop_back_iterator< + typename begin::type, false> + begin_type; + + typedef pop_back_iterator< + typename end::type, true> + end_type; + + typedef + iterator_range + type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::pop_back::type + pop_back(Sequence const& seq) + { + typedef result_of::pop_back comp; + typedef typename comp::begin_type begin_type; + typedef typename comp::end_type end_type; + typedef typename comp::type result; + + return result( + begin_type(fusion::begin(seq)) + , end_type(fusion::end(seq)) + ); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/transformation/pop_front.hpp b/contrib/autoboost/autoboost/fusion/algorithm/transformation/pop_front.hpp new file mode 100644 index 000000000..8aaad31a0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/transformation/pop_front.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_POP_FRONT_09172005_1115) +#define FUSION_POP_FRONT_09172005_1115 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct pop_front + { + typedef + iterator_range< + typename next< + typename begin::type + >::type + , typename end::type + > + type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::pop_front::type + pop_front(Sequence const& seq) + { + typedef typename result_of::pop_front::type result; + return result(fusion::next(fusion::begin(seq)), fusion::end(seq)); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/transformation/push_back.hpp b/contrib/autoboost/autoboost/fusion/algorithm/transformation/push_back.hpp new file mode 100644 index 000000000..a2a73c77f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/transformation/push_back.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_PUSH_BACK_07162005_0235) +#define FUSION_PUSH_BACK_07162005_0235 + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct push_back + { + typedef fusion::single_view::type> single_view; + typedef joint_view type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline + typename + lazy_enable_if< + traits::is_sequence + , result_of::push_back + >::type + push_back(Sequence const& seq, T const& x) + { + typedef typename result_of::push_back push_back; + typedef typename push_back::single_view single_view; + typedef typename push_back::type result; + single_view x_(x); + return result(seq, x_); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/algorithm/transformation/push_front.hpp b/contrib/autoboost/autoboost/fusion/algorithm/transformation/push_front.hpp new file mode 100644 index 000000000..8f8933911 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/algorithm/transformation/push_front.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_PUSH_FRONT_07162005_0749) +#define FUSION_PUSH_FRONT_07162005_0749 + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace result_of + { + template + struct push_front + { + typedef fusion::single_view::type> single_view; + typedef joint_view type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline + typename + lazy_enable_if< + traits::is_sequence + , result_of::push_front + >::type + push_front(Sequence const& seq, T const& x) + { + typedef typename result_of::push_front push_front; + typedef typename push_front::single_view single_view; + typedef typename push_front::type result; + single_view x_(x); + return result(x_, seq); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/deque/deque_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/deque/deque_fwd.hpp new file mode 100644 index 000000000..aff0e8ba9 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/deque_fwd.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 2005-2012 Joel de Guzman + Copyright (c) 2005-2007 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) +==============================================================================*/ +#if !defined(FUSION_DEQUE_FORWARD_02092007_0749) +#define FUSION_DEQUE_FORWARD_02092007_0749 + +#include +#include + +#if (defined(AUTOBOOST_NO_CXX11_DECLTYPE) \ + || defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) \ + || defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES)) \ + || (defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES)) +# if defined(AUTOBOOST_FUSION_HAS_VARIADIC_DEQUE) +# undef AUTOBOOST_FUSION_HAS_VARIADIC_DEQUE +# endif +#else +# if !defined(AUTOBOOST_FUSION_HAS_VARIADIC_DEQUE) +# define AUTOBOOST_FUSION_HAS_VARIADIC_DEQUE +# endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +// With no decltype and variadics, we will use the C++03 version +/////////////////////////////////////////////////////////////////////////////// +#if !defined(AUTOBOOST_FUSION_HAS_VARIADIC_DEQUE) +# include +#else + +/////////////////////////////////////////////////////////////////////////////// +// C++11 interface +/////////////////////////////////////////////////////////////////////////////// +namespace autoboost { namespace fusion +{ + template + struct deque; +}} + +#endif +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/deque_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/deque_fwd.hpp new file mode 100644 index 000000000..a7d19c8d9 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/deque_fwd.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2005-2012 Joel de Guzman + Copyright (c) 2005-2007 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) +==============================================================================*/ +#if !defined(FUSION_PP_DEQUE_FORWARD_02092007_0749) +#define FUSION_PP_DEQUE_FORWARD_02092007_0749 + +#if defined(AUTOBOOST_FUSION_HAS_VARIADIC_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct void_; + + template< + AUTOBOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_DEQUE_SIZE, typename T, void_)> + struct deque; +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/limits.hpp b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/limits.hpp new file mode 100644 index 000000000..21bf6af0e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/limits.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2005-2012 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_DEQUE_LIMITS_26112006_1737) +#define AUTOBOOST_FUSION_DEQUE_LIMITS_26112006_1737 + +#if defined(AUTOBOOST_FUSION_HAS_VARIADIC_DEQUE) +#error "C++03 only! This file should not have been included" +#endif + +#include + +#if !defined(FUSION_MAX_DEQUE_SIZE) +# define FUSION_MAX_DEQUE_SIZE FUSION_MAX_VECTOR_SIZE +#else +# if FUSION_MAX_DEQUE_SIZE < 3 +# undef FUSION_MAX_DEQUE_SIZE +# if (FUSION_MAX_VECTOR_SIZE > 10) +# define FUSION_MAX_DEQUE_SIZE 10 +# else +# define FUSION_MAX_DEQUE_SIZE FUSION_MAX_VECTOR_SIZE +# endif +# endif +#endif + +#define FUSION_MAX_DEQUE_SIZE_STR AUTOBOOST_PP_STRINGIZE(AUTOBOOST_FUSION_PP_ROUND_UP(FUSION_MAX_DEQUE_SIZE)) + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque10_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque10_fwd.hpp new file mode 100644 index 000000000..e536fd485 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque10_fwd.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template< + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_> + struct deque; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque20_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque20_fwd.hpp new file mode 100644 index 000000000..62e502f0f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque20_fwd.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template< + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_> + struct deque; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque30_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque30_fwd.hpp new file mode 100644 index 000000000..a0bc4f9bf --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque30_fwd.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template< + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_> + struct deque; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque40_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque40_fwd.hpp new file mode 100644 index 000000000..74bf7883b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque40_fwd.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template< + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_> + struct deque; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque50_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque50_fwd.hpp new file mode 100644 index 000000000..45dee1f24 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque50_fwd.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template< + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ , typename T40 = void_ , typename T41 = void_ , typename T42 = void_ , typename T43 = void_ , typename T44 = void_ , typename T45 = void_ , typename T46 = void_ , typename T47 = void_ , typename T48 = void_ , typename T49 = void_> + struct deque; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque_fwd.hpp new file mode 100644 index 000000000..970ec368f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/deque/detail/cpp03/preprocessed/deque_fwd.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if FUSION_MAX_DEQUE_SIZE <= 10 +#include +#elif FUSION_MAX_DEQUE_SIZE <= 20 +#include +#elif FUSION_MAX_DEQUE_SIZE <= 30 +#include +#elif FUSION_MAX_DEQUE_SIZE <= 40 +#include +#elif FUSION_MAX_DEQUE_SIZE <= 50 +#include +#else +#error "FUSION_MAX_DEQUE_SIZE out of bounds for preprocessed headers" +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/cons.hpp b/contrib/autoboost/autoboost/fusion/container/list/cons.hpp new file mode 100644 index 000000000..da804dc1d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/cons.hpp @@ -0,0 +1,135 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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(FUSION_CONS_07172005_0843) +#define FUSION_CONS_07172005_0843 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct void_; + struct cons_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template + struct cons : sequence_base > + { + typedef mpl::int_ size; + typedef cons_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + typedef forward_traversal_tag category; + typedef Car car_type; + typedef Cdr cdr_type; + + AUTOBOOST_FUSION_GPU_ENABLED + cons() + : car(), cdr() {} + + AUTOBOOST_FUSION_GPU_ENABLED + explicit cons(typename detail::call_param::type in_car) + : car(in_car), cdr() {} + + AUTOBOOST_FUSION_GPU_ENABLED + cons( + typename detail::call_param::type in_car + , typename detail::call_param::type in_cdr) + : car(in_car), cdr(in_cdr) {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + cons(cons const& rhs) + : car(rhs.car), cdr(rhs.cdr) {} + + AUTOBOOST_FUSION_GPU_ENABLED + cons(cons const& rhs) + : car(rhs.car), cdr(rhs.cdr) {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + cons( + Sequence const& seq + , typename autoboost::disable_if< + mpl::or_< + is_convertible // use copy ctor instead + , is_convertible // use copy to car instead + > + >::type* /*dummy*/ = 0 + ) + : car(*fusion::begin(seq)) + , cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + cons(Iterator const& iter, mpl::true_ /*this_is_an_iterator*/) + : car(*iter) + , cdr(fusion::next(iter), mpl::true_()) {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + cons& operator=(cons const& rhs) + { + car = rhs.car; + cdr = rhs.cdr; + return *this; + } + + AUTOBOOST_FUSION_GPU_ENABLED + cons& operator=(cons const& rhs) + { + car = rhs.car; + cdr = rhs.cdr; + return *this; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, cons&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type Iterator; + Iterator iter = fusion::begin(seq); + this->assign_from_iter(iter); + return *this; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + void assign_from_iter(Iterator const& iter) + { + car = *iter; + cdr.assign_from_iter(fusion::next(iter)); + } + + car_type car; + cdr_type cdr; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/list/cons_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/list/cons_fwd.hpp new file mode 100644 index 000000000..3e8d423b1 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/cons_fwd.hpp @@ -0,0 +1,23 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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(AUTOBOOST_FUSION_CONS_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_CONS_FWD_HPP_INCLUDED + +namespace autoboost { namespace fusion +{ + struct nil_; + #ifndef nil + typedef nil_ nil; + #endif + + template + struct cons; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/list/cons_iterator.hpp b/contrib/autoboost/autoboost/fusion/container/list/cons_iterator.hpp new file mode 100644 index 000000000..6b2fb45f5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/cons_iterator.hpp @@ -0,0 +1,101 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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(FUSION_CONS_ITERATOR_07172005_0849) +#define FUSION_CONS_ITERATOR_07172005_0849 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct nil_; + struct cons_iterator_tag; + struct forward_traversal_tag; + + template + struct cons_iterator_identity; + + template + struct cons_iterator : iterator_base > + { + typedef cons_iterator_tag fusion_tag; + typedef forward_traversal_tag category; + typedef Cons cons_type; + typedef cons_iterator_identity< + typename add_const::type> + identity; + + AUTOBOOST_FUSION_GPU_ENABLED + explicit cons_iterator(cons_type& in_cons) + : cons(in_cons) {} + + cons_type& cons; + + private: + // silence MSVC warning C4512: assignment operator could not be generated + cons_iterator& operator= (cons_iterator const&); + }; + + struct nil_iterator : iterator_base + { + typedef forward_traversal_tag category; + typedef cons_iterator_tag fusion_tag; + typedef nil_ cons_type; + typedef cons_iterator_identity< + add_const::type> + identity; + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + nil_iterator() {} + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + explicit nil_iterator(nil_ const&) {} + }; + + template <> + struct cons_iterator : nil_iterator + { + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + cons_iterator() {} + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + explicit cons_iterator(nil_ const&) {} + }; + + template <> + struct cons_iterator : nil_iterator + { + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + cons_iterator() {} + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + explicit cons_iterator(nil_ const&) {} + }; + + template <> + struct cons_iterator > : nil_iterator + { + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + cons_iterator() {} + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + explicit cons_iterator(nil_ const&) {} + }; + + template <> + struct cons_iterator const> : nil_iterator + { + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + cons_iterator() {} + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + explicit cons_iterator(nil_ const&) {} + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/at_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/at_impl.hpp new file mode 100644 index 000000000..6205380e9 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/at_impl.hpp @@ -0,0 +1,136 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_AT_IMPL_07172005_0726) +#define FUSION_AT_IMPL_07172005_0726 + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace detail + { + template + struct cons_deref + { + typedef typename Cons::car_type type; + }; + + template + struct cons_advance + { + typedef typename + cons_advance::type::cdr_type + type; + }; + + template + struct cons_advance + { + typedef Cons type; + }; + + template + struct cons_advance + { + typedef typename Cons::cdr_type type; + }; + + template + struct cons_advance + { +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, > 1400) // VC8 and above + typedef typename Cons::cdr_type::cdr_type type; +#else + typedef typename Cons::cdr_type _a; + typedef typename _a::cdr_type type; +#endif + }; + + template + struct cons_advance + { +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, > 1400) // VC8 and above + typedef typename Cons::cdr_type::cdr_type::cdr_type type; +#else + typedef typename Cons::cdr_type _a; + typedef typename _a::cdr_type _b; + typedef typename _b::cdr_type type; +#endif + }; + + template + struct cons_advance + { +#if AUTOBOOST_WORKAROUND(AUTOBOOST_MSVC, > 1400) // VC8 and above + typedef typename Cons::cdr_type::cdr_type::cdr_type::cdr_type type; +#else + typedef typename Cons::cdr_type _a; + typedef typename _a::cdr_type _b; + typedef typename _b::cdr_type _c; + typedef typename _c::cdr_type type; +#endif + }; + } + + struct cons_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef typename detail::cons_deref< + typename detail::cons_advance::type>::type + element; + + typedef typename + mpl::if_< + is_const + , typename detail::cref_result::type + , typename detail::ref_result::type + >::type + type; + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Cons& s, mpl::int_) + { + return call(s.cdr, mpl::int_()); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Cons& s, mpl::int_<0>) + { + return s.car; + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s) + { + return call(s, mpl::int_()); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/begin_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/begin_impl.hpp new file mode 100644 index 000000000..4761c4ff2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/begin_impl.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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(FUSION_BEGIN_IMPL_07172005_0824) +#define FUSION_BEGIN_IMPL_07172005_0824 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct nil_; + + struct cons_tag; + + template + struct cons; + + template + struct cons_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef cons_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& t) + { + return type(t); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/deref_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/deref_impl.hpp new file mode 100644 index 000000000..67e836eda --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/deref_impl.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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(FUSION_DEREF_IMPL_07172005_0831) +#define FUSION_DEREF_IMPL_07172005_0831 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct cons_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename Iterator::cons_type cons_type; + typedef typename cons_type::car_type value_type; + + typedef typename mpl::eval_if< + is_const + , add_reference::type> + , add_reference >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return i.cons.car; + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/empty_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/empty_impl.hpp new file mode 100644 index 000000000..32930f103 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/empty_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + 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(AUTOBOOST_FUSION_SEQUENCE_EMPTY_IMPL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEQUENCE_EMPTY_IMPL_HPP_INCLUDED + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct cons_tag; + + struct nil_; + + template + struct cons; + + namespace extension + { + template + struct empty_impl; + + template <> + struct empty_impl + { + template + struct apply + : autoboost::is_convertible + {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/end_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/end_impl.hpp new file mode 100644 index 000000000..7d23c519a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/end_impl.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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(FUSION_END_IMPL_07172005_0828) +#define FUSION_END_IMPL_07172005_0828 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct nil_; + + struct cons_tag; + + template + struct cons; + + template + struct cons_iterator; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef cons_iterator< + typename mpl::if_, nil_ const, nil_>::type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence&) + { + return type(); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/equal_to_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/equal_to_impl.hpp new file mode 100644 index 000000000..e4938f02f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/equal_to_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_EQUAL_TO_IMPL_09172005_1120) +#define FUSION_EQUAL_TO_IMPL_09172005_1120 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct cons_iterator_tag; + + namespace extension + { + template + struct equal_to_impl; + + template <> + struct equal_to_impl + { + template + struct apply + : is_same< + typename I1::identity + , typename I2::identity + > + { + }; + }; + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/next_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/next_impl.hpp new file mode 100644 index 000000000..8ce89aa7a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/next_impl.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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(FUSION_NEXT_IMPL_07172005_0836) +#define FUSION_NEXT_IMPL_07172005_0836 + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct cons_iterator_tag; + + template + struct cons_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::cons_type cons_type; + typedef typename cons_type::cdr_type cdr_type; + + typedef cons_iterator< + typename mpl::eval_if< + is_const + , add_const + , mpl::identity + >::type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(i.cons.cdr); + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list10_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list10_fwd.hpp new file mode 100644 index 000000000..227163fa6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list10_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ + > + struct list; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list20_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list20_fwd.hpp new file mode 100644 index 000000000..d667819ea --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list20_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ + > + struct list; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list30_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list30_fwd.hpp new file mode 100644 index 000000000..958c5dab1 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list30_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ + > + struct list; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list40_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list40_fwd.hpp new file mode 100644 index 000000000..d6c57fd9a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list40_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ + > + struct list; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list50_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list50_fwd.hpp new file mode 100644 index 000000000..4aee8fa1d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list50_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ , typename T40 = void_ , typename T41 = void_ , typename T42 = void_ , typename T43 = void_ , typename T44 = void_ , typename T45 = void_ , typename T46 = void_ , typename T47 = void_ , typename T48 = void_ , typename T49 = void_ + > + struct list; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list_fwd.hpp new file mode 100644 index 000000000..3e1eb752a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/preprocessed/list_fwd.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if FUSION_MAX_LIST_SIZE <= 10 +#include +#elif FUSION_MAX_LIST_SIZE <= 20 +#include +#elif FUSION_MAX_LIST_SIZE <= 30 +#include +#elif FUSION_MAX_LIST_SIZE <= 40 +#include +#elif FUSION_MAX_LIST_SIZE <= 50 +#include +#else +#error "FUSION_MAX_LIST_SIZE out of bounds for preprocessed headers" +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/reverse_cons.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/reverse_cons.hpp new file mode 100644 index 000000000..4aaa3ee97 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/reverse_cons.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_REVERSE_CONS_HPP_INCLUDED) +#define AUTOBOOST_FUSION_REVERSE_CONS_HPP_INCLUDED + +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + //////////////////////////////////////////////////////////////////////////// + template + struct reverse_cons; + + template + struct reverse_cons, State> + { + typedef reverse_cons > impl; + typedef typename impl::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(cons const &cons, State const &state = State()) + { + typedef fusion::cons cdr_type; + return impl::call(cons.cdr, cdr_type(cons.car, state)); + } + }; + + template + struct reverse_cons + { + typedef State type; + + AUTOBOOST_FUSION_GPU_ENABLED + static State const &call(nil_ const &, State const &state = State()) + { + return state; + } + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/value_at_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/value_at_impl.hpp new file mode 100644 index 000000000..708945a36 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/value_at_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VALUE_AT_IMPL_07172005_0952) +#define FUSION_VALUE_AT_IMPL_07172005_0952 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct cons_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename + mpl::eval_if< + mpl::bool_ + , mpl::identity + , apply > + >::type + type; + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/detail/value_of_impl.hpp b/contrib/autoboost/autoboost/fusion/container/list/detail/value_of_impl.hpp new file mode 100644 index 000000000..6beacee1e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/detail/value_of_impl.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + 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(FUSION_VALUE_OF_IMPL_07172005_0838) +#define FUSION_VALUE_OF_IMPL_07172005_0838 + +namespace autoboost { namespace fusion +{ + struct cons_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename Iterator::cons_type cons_type; + typedef typename cons_type::car_type type; + }; + }; + } + +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/container/list/limits.hpp b/contrib/autoboost/autoboost/fusion/container/list/limits.hpp new file mode 100644 index 000000000..ead3d5575 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/limits.hpp @@ -0,0 +1,23 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_LIST_LIMITS_07172005_0112) +#define FUSION_LIST_LIMITS_07172005_0112 + +#include + +#if !defined(FUSION_MAX_LIST_SIZE) +# define FUSION_MAX_LIST_SIZE 10 +#else +# if FUSION_MAX_LIST_SIZE < 3 +# undef FUSION_MAX_LIST_SIZE +# define FUSION_MAX_LIST_SIZE 10 +# endif +#endif + +#define FUSION_MAX_LIST_SIZE_STR AUTOBOOST_PP_STRINGIZE(AUTOBOOST_FUSION_PP_ROUND_UP(FUSION_MAX_LIST_SIZE)) + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/list_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/list/list_fwd.hpp new file mode 100644 index 000000000..5ce4db7fd --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/list_fwd.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_LIST_FORWARD_07172005_0224) +#define FUSION_LIST_FORWARD_07172005_0224 + +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/list" FUSION_MAX_LIST_SIZE_STR "_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct void_; + + template < + AUTOBOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_LIST_SIZE, typename T, void_) + > + struct list; +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/list/nil.hpp b/contrib/autoboost/autoboost/fusion/container/list/nil.hpp new file mode 100644 index 000000000..d778ff8f3 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/list/nil.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005, 2014 Eric Niebler + + 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(FUSION_NIL_04232014_0843) +#define FUSION_NIL_04232014_0843 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct void_; + struct cons_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + struct nil_ : sequence_base + { + typedef mpl::int_<0> size; + typedef cons_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + typedef forward_traversal_tag category; + typedef void_ car_type; + typedef void_ cdr_type; + + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + nil_() {} + + template + AUTOBOOST_CONSTEXPR AUTOBOOST_FUSION_GPU_ENABLED + nil_(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/) + {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + void assign_from_iter(Iterator const& /*iter*/) + { + } + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/limits.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/limits.hpp new file mode 100644 index 000000000..65e3ccf36 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/limits.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_MAP_LIMITS_07212005_1104) +#define FUSION_MAP_LIMITS_07212005_1104 + +#include +#include + +#if !defined(FUSION_MAX_MAP_SIZE) +# define FUSION_MAX_MAP_SIZE FUSION_MAX_VECTOR_SIZE +#else +# if FUSION_MAX_MAP_SIZE < 3 +# undef FUSION_MAX_MAP_SIZE +# if (FUSION_MAX_VECTOR_SIZE > 10) +# define FUSION_MAX_MAP_SIZE 10 +# else +# define FUSION_MAX_MAP_SIZE FUSION_MAX_VECTOR_SIZE +# endif +# endif +#endif + +#define FUSION_MAX_MAP_SIZE_STR AUTOBOOST_PP_STRINGIZE(AUTOBOOST_FUSION_PP_ROUND_UP(FUSION_MAX_MAP_SIZE)) + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/map_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/map_fwd.hpp new file mode 100644 index 000000000..0724eb9d0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/map_fwd.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_MAP_FORWARD_07212005_1105) +#define FUSION_MAP_FORWARD_07212005_1105 + +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "preprocessed/map" FUSION_MAX_MAP_SIZE_STR "_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct void_; + struct map_tag; + struct map_iterator_tag; + + template < + AUTOBOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_MAP_SIZE, typename T, void_) + > + struct map; +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map10_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map10_fwd.hpp new file mode 100644 index 000000000..d9eb40faf --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map10_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct map_tag; + struct map_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ + > + struct map; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map20_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map20_fwd.hpp new file mode 100644 index 000000000..f05243ccf --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map20_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct map_tag; + struct map_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ + > + struct map; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map30_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map30_fwd.hpp new file mode 100644 index 000000000..906db63a4 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map30_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct map_tag; + struct map_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ + > + struct map; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map40_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map40_fwd.hpp new file mode 100644 index 000000000..260820949 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map40_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct map_tag; + struct map_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ + > + struct map; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map50_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map50_fwd.hpp new file mode 100644 index 000000000..9f3ab57eb --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map50_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct map_tag; + struct map_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ , typename T40 = void_ , typename T41 = void_ , typename T42 = void_ , typename T43 = void_ , typename T44 = void_ , typename T45 = void_ , typename T46 = void_ , typename T47 = void_ , typename T48 = void_ , typename T49 = void_ + > + struct map; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map_fwd.hpp new file mode 100644 index 000000000..a6abfe440 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/cpp03/preprocessed/map_fwd.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if FUSION_MAX_MAP_SIZE <= 10 +#include +#elif FUSION_MAX_MAP_SIZE <= 20 +#include +#elif FUSION_MAX_MAP_SIZE <= 30 +#include +#elif FUSION_MAX_MAP_SIZE <= 40 +#include +#elif FUSION_MAX_MAP_SIZE <= 50 +#include +#else +#error "FUSION_MAX_MAP_SIZE out of bounds for preprocessed headers" +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/map/detail/map_impl.hpp b/contrib/autoboost/autoboost/fusion/container/map/detail/map_impl.hpp new file mode 100644 index 000000000..da240712b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/detail/map_impl.hpp @@ -0,0 +1,206 @@ +/*============================================================================= + Copyright (c) 2005-2013 Joel de Guzman + + 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(AUTOBOOST_FUSION_MAP_IMPL_02032013_2233) +#define AUTOBOOST_FUSION_MAP_IMPL_02032013_2233 + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct fusion_sequence_tag; +}} + +namespace autoboost { namespace fusion { namespace detail +{ + struct map_impl_from_iterator {}; + + template + struct map_impl; + + template + struct map_impl + { + typedef fusion_sequence_tag tag; + static int const index = index_; + static int const size = 0; + + AUTOBOOST_FUSION_GPU_ENABLED + map_impl() {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + map_impl(Iterator const&, map_impl_from_iterator) + {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + void assign(Iterator const&, map_impl_from_iterator) + {} + + AUTOBOOST_FUSION_GPU_ENABLED + void get(); + AUTOBOOST_FUSION_GPU_ENABLED + void get_val(); + AUTOBOOST_FUSION_GPU_ENABLED + void get_key(); + }; + + template + struct map_impl : map_impl + { + typedef fusion_sequence_tag tag; + typedef map_impl rest_type; + + using rest_type::get; + using rest_type::get_val; + using rest_type::get_key; + + static int const index = index_; + static int const size = rest_type::size + 1; + + typedef Pair pair_type; + typedef typename Pair::first_type key_type; + typedef typename Pair::second_type value_type; + + AUTOBOOST_FUSION_GPU_ENABLED + map_impl() + : rest_type(), element() + {} + + AUTOBOOST_FUSION_GPU_ENABLED + map_impl(map_impl const& rhs) + : rest_type(rhs.get_base()), element(rhs.element) + {} + + AUTOBOOST_FUSION_GPU_ENABLED + map_impl(map_impl&& rhs) + : rest_type(std::forward(*static_cast(&rhs))) + , element(std::forward(rhs.element)) + {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + map_impl(map_impl const& rhs) + : rest_type(rhs.get_base()), element(rhs.element) + {} + + AUTOBOOST_FUSION_GPU_ENABLED + map_impl(typename detail::call_param::type element_ + , typename detail::call_param::type... rest) + : rest_type(rest...), element(element_) + {} + + AUTOBOOST_FUSION_GPU_ENABLED + map_impl(Pair&& element_, T&&... rest) + : rest_type(std::forward(rest)...) + , element(std::forward(element_)) + {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + map_impl(Iterator const& iter, map_impl_from_iterator fi) + : rest_type(fusion::next(iter), fi) + , element(*iter) + {} + + AUTOBOOST_FUSION_GPU_ENABLED + rest_type& get_base() + { + return *this; + } + + AUTOBOOST_FUSION_GPU_ENABLED + rest_type const& get_base() const + { + return *this; + } + + AUTOBOOST_FUSION_GPU_ENABLED + value_type get_val(mpl::identity); + AUTOBOOST_FUSION_GPU_ENABLED + pair_type get_val(mpl::int_); + AUTOBOOST_FUSION_GPU_ENABLED + value_type get_val(mpl::identity) const; + AUTOBOOST_FUSION_GPU_ENABLED + pair_type get_val(mpl::int_) const; + + AUTOBOOST_FUSION_GPU_ENABLED + mpl::identity get_key(mpl::int_); + AUTOBOOST_FUSION_GPU_ENABLED + mpl::identity get_key(mpl::int_) const; + + AUTOBOOST_FUSION_GPU_ENABLED + typename cref_result::type + get(mpl::identity) const + { + return element.second; + } + + AUTOBOOST_FUSION_GPU_ENABLED + typename ref_result::type + get(mpl::identity) + { + return element.second; + } + + AUTOBOOST_FUSION_GPU_ENABLED + typename cref_result::type + get(mpl::int_) const + { + return element; + } + + AUTOBOOST_FUSION_GPU_ENABLED + typename ref_result::type + get(mpl::int_) + { + return element; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + map_impl& operator=(map_impl const& rhs) + { + rest_type::operator=(rhs); + element = rhs.element; + return *this; + } + + AUTOBOOST_FUSION_GPU_ENABLED + map_impl& operator=(map_impl const& rhs) + { + rest_type::operator=(rhs); + element = rhs.element; + return *this; + } + + AUTOBOOST_FUSION_GPU_ENABLED + map_impl& operator=(map_impl&& rhs) + { + rest_type::operator=(std::forward(rhs)); + element = std::forward(rhs.element); + return *this; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + void assign(Iterator const& iter, map_impl_from_iterator fi) + { + rest_type::assign(fusion::next(iter), fi); + element = *iter; + } + + Pair element; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/map/map_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/map/map_fwd.hpp new file mode 100644 index 000000000..51461a1da --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/map/map_fwd.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_MAP_FORWARD_MAIN_07212005_1105) +#define FUSION_MAP_FORWARD_MAIN_07212005_1105 + +#include +#include + +#if (defined(AUTOBOOST_NO_CXX11_DECLTYPE) \ + || defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) \ + || defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES)) \ + || (defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES)) +# if defined(AUTOBOOST_FUSION_HAS_VARIADIC_MAP) +# undef AUTOBOOST_FUSION_HAS_VARIADIC_MAP +# endif +#else +# if !defined(AUTOBOOST_FUSION_HAS_VARIADIC_MAP) +# define AUTOBOOST_FUSION_HAS_VARIADIC_MAP +# endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +// With no decltype and variadics, we will use the C++03 version +/////////////////////////////////////////////////////////////////////////////// +#if !defined(AUTOBOOST_FUSION_HAS_VARIADIC_MAP) +# include +#else + +#include + +/////////////////////////////////////////////////////////////////////////////// +// C++11 interface +/////////////////////////////////////////////////////////////////////////////// +namespace autoboost { namespace fusion +{ + template + struct map; +}} + +#endif +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set10_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set10_fwd.hpp new file mode 100644 index 000000000..15edaf08a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set10_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct set_tag; + struct set_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ + > + struct set; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set20_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set20_fwd.hpp new file mode 100644 index 000000000..1ffe38216 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set20_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct set_tag; + struct set_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ + > + struct set; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set30_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set30_fwd.hpp new file mode 100644 index 000000000..2ee47c39f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set30_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct set_tag; + struct set_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ + > + struct set; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set40_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set40_fwd.hpp new file mode 100644 index 000000000..2d81ce19c --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set40_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct set_tag; + struct set_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ + > + struct set; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set50_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set50_fwd.hpp new file mode 100644 index 000000000..5591c5457 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set50_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + struct set_tag; + struct set_iterator_tag; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ , typename T40 = void_ , typename T41 = void_ , typename T42 = void_ , typename T43 = void_ , typename T44 = void_ , typename T45 = void_ , typename T46 = void_ , typename T47 = void_ , typename T48 = void_ , typename T49 = void_ + > + struct set; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set_fwd.hpp new file mode 100644 index 000000000..8a34ebfd0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/set/detail/preprocessed/set_fwd.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if FUSION_MAX_SET_SIZE <= 10 +#include +#elif FUSION_MAX_SET_SIZE <= 20 +#include +#elif FUSION_MAX_SET_SIZE <= 30 +#include +#elif FUSION_MAX_SET_SIZE <= 40 +#include +#elif FUSION_MAX_SET_SIZE <= 50 +#include +#else +#error "FUSION_MAX_SET_SIZE out of bounds for preprocessed headers" +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/set/limits.hpp b/contrib/autoboost/autoboost/fusion/container/set/limits.hpp new file mode 100644 index 000000000..b31aa7aa3 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/set/limits.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_SET_LIMITS_09162005_1103) +#define FUSION_SET_LIMITS_09162005_1103 + +#include +#include + +#if !defined(FUSION_MAX_SET_SIZE) +# define FUSION_MAX_SET_SIZE FUSION_MAX_VECTOR_SIZE +#else +# if FUSION_MAX_SET_SIZE < 3 +# undef FUSION_MAX_SET_SIZE +# if (FUSION_MAX_VECTOR_SIZE > 10) +# define FUSION_MAX_SET_SIZE 10 +# else +# define FUSION_MAX_SET_SIZE FUSION_MAX_VECTOR_SIZE +# endif +# endif +#endif + +#define FUSION_MAX_SET_SIZE_STR AUTOBOOST_PP_STRINGIZE(AUTOBOOST_FUSION_PP_ROUND_UP(FUSION_MAX_SET_SIZE)) + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/set/set_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/set/set_fwd.hpp new file mode 100644 index 000000000..928d69112 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/set/set_fwd.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_SET_FORWARD_09162005_1102) +#define FUSION_SET_FORWARD_09162005_1102 + +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/set" FUSION_MAX_SET_SIZE_STR "_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct void_; + struct set_tag; + struct set_iterator_tag; + + template < + AUTOBOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_SET_SIZE, typename T, void_) + > + struct set; +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/advance_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/advance_impl.hpp new file mode 100644 index 000000000..de91b53d7 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/advance_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ADVANCE_IMPL_09172005_1156) +#define FUSION_ADVANCE_IMPL_09172005_1156 + +namespace autoboost { namespace fusion +{ + struct vector_iterator_tag; + + template + struct vector_iterator; + + namespace extension + { + template + struct advance_impl; + + template <> + struct advance_impl + { + template + struct apply + { + typedef typename Iterator::index index; + typedef typename Iterator::vector vector; + typedef vector_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(i.vec); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/at_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/at_impl.hpp new file mode 100644 index 000000000..57685bf3e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/at_impl.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_AT_IMPL_05042005_0741) +#define FUSION_AT_IMPL_05042005_0741 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef typename mpl::at::type element; + typedef typename detail::ref_result::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& v) + { + AUTOBOOST_STATIC_ASSERT((N::value < Sequence::size::value)); + return v.at_impl(N()); + } + }; + + template + struct apply + { + typedef typename mpl::at::type element; + typedef typename detail::cref_result::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence const& v) + { + AUTOBOOST_STATIC_ASSERT((N::value < Sequence::size::value)); + return v.at_impl(N()); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/begin_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/begin_impl.hpp new file mode 100644 index 000000000..50b0c279c --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/begin_impl.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_BEGIN_IMPL_05042005_1136) +#define FUSION_BEGIN_IMPL_05042005_1136 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef vector_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/deref_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/deref_impl.hpp new file mode 100644 index 000000000..109a4e29e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/deref_impl.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_DEREF_IMPL_05042005_1037) +#define FUSION_DEREF_IMPL_05042005_1037 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename Iterator::vector vector; + typedef typename Iterator::index index; + typedef typename mpl::at< + typename vector::types, index>::type + element; + + typedef typename + mpl::if_< + is_const + , typename fusion::detail::cref_result::type + , typename fusion::detail::ref_result::type + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return i.vec.at_impl(index()); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/distance_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/distance_impl.hpp new file mode 100644 index 000000000..4bc6ed81a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/distance_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_DISTANCE_IMPL_09172005_0751) +#define FUSION_DISTANCE_IMPL_09172005_0751 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_iterator_tag; + + namespace extension + { + template + struct distance_impl; + + template <> + struct distance_impl + { + template + struct apply : mpl::minus + { + AUTOBOOST_FUSION_GPU_ENABLED + static typename mpl::minus< + typename Last::index, typename First::index>::type + call(First const&, Last const&) + { + typedef typename mpl::minus< + typename Last::index, typename First::index>::type + result; + return result(); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/end_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/end_impl.hpp new file mode 100644 index 000000000..36adc0db5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/end_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_END_IMPL_05042005_1142) +#define FUSION_END_IMPL_05042005_1142 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::size size; + typedef vector_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/equal_to_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/equal_to_impl.hpp new file mode 100644 index 000000000..a00e966fc --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/equal_to_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_EQUAL_TO_IMPL_05052005_1215) +#define FUSION_EQUAL_TO_IMPL_05052005_1215 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_iterator_tag; + + namespace extension + { + template + struct equal_to_impl; + + template <> + struct equal_to_impl + { + template + struct apply + : is_same< + typename I1::identity + , typename I2::identity + > + { + }; + }; + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/next_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/next_impl.hpp new file mode 100644 index 000000000..17509f368 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/next_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_NEXT_IMPL_05042005_1058) +#define FUSION_NEXT_IMPL_05042005_1058 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_iterator_tag; + template + struct vector_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::vector vector; + typedef typename Iterator::index index; + typedef vector_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(i.vec); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector10.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector10.hpp new file mode 100644 index 000000000..ff54191c5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector10.hpp @@ -0,0 +1,1530 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + template + struct vector_data1 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data1() + : m0() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data1(U0 && _0 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) {} + vector_data1( + vector_data1&& other) + : m0(std::forward(other.m0)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data1( + typename detail::call_param::type _0) + : m0(_0) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data1( + vector_data1 const& other) + : m0(other.m0) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data1& + operator=(vector_data1 const& vec) + { + this->m0 = vec.m0; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data1 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + + return vector_data1(*i0); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data1 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + + return vector_data1(*i0); + } + T0 m0; + }; + template + struct vector1 + : vector_data1 + , sequence_base > + { + typedef vector1 this_type; + typedef vector_data1 base_type; + typedef mpl::vector1 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<1> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector1() {} + AUTOBOOST_FUSION_GPU_ENABLED + explicit + vector1( + typename detail::call_param::type _0) + : base_type(_0) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + explicit + vector1(U0&& _0 + , typename autoboost::enable_if >::type* = 0 + ) + : base_type(std::forward(_0)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector1(vector1&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector1(vector1 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector1& + operator=(vector1 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector1& + operator=(vector1&& vec) + { + this->m0 = std::forward< T0>(vec.m0); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector1( + vector1 const& vec) + : base_type(vec.m0) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector1( + Sequence const& seq + , typename autoboost::disable_if >::type* = 0 + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector1( + Sequence& seq + , typename autoboost::disable_if >::type* = 0 + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector1& + operator=(vector1 const& vec) + { + this->m0 = vec.m0; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + + this->m0 = *i0; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data2 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data2() + : m0() , m1() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data2(U0 && _0 , U1 && _1 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) {} + vector_data2( + vector_data2&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data2( + typename detail::call_param::type _0 , typename detail::call_param::type _1) + : m0(_0) , m1(_1) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data2( + vector_data2 const& other) + : m0(other.m0) , m1(other.m1) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data2& + operator=(vector_data2 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data2 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); + return vector_data2(*i0 , *i1); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data2 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); + return vector_data2(*i0 , *i1); + } + T0 m0; T1 m1; + }; + template + struct vector2 + : vector_data2 + , sequence_base > + { + typedef vector2 this_type; + typedef vector_data2 base_type; + typedef mpl::vector2 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<2> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector2() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector2( + typename detail::call_param::type _0 , typename detail::call_param::type _1) + : base_type(_0 , _1) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector2(U0 && _0 , U1 && _1) + : base_type(std::forward(_0) , std::forward(_1)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector2(vector2&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector2(vector2 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector2& + operator=(vector2 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector2& + operator=(vector2&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector2( + vector2 const& vec) + : base_type(vec.m0 , vec.m1) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector2( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector2( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector2& + operator=(vector2 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); + this->m0 = *i0; this->m1 = *i1; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data3 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data3() + : m0() , m1() , m2() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data3(U0 && _0 , U1 && _1 , U2 && _2 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) {} + vector_data3( + vector_data3&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data3( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2) + : m0(_0) , m1(_1) , m2(_2) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data3( + vector_data3 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data3& + operator=(vector_data3 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data3 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); + return vector_data3(*i0 , *i1 , *i2); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data3 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); + return vector_data3(*i0 , *i1 , *i2); + } + T0 m0; T1 m1; T2 m2; + }; + template + struct vector3 + : vector_data3 + , sequence_base > + { + typedef vector3 this_type; + typedef vector_data3 base_type; + typedef mpl::vector3 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<3> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector3() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector3( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2) + : base_type(_0 , _1 , _2) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector3(U0 && _0 , U1 && _1 , U2 && _2) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector3(vector3&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector3(vector3 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector3& + operator=(vector3 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector3& + operator=(vector3&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector3( + vector3 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector3( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector3( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector3& + operator=(vector3 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data4 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data4() + : m0() , m1() , m2() , m3() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data4(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) {} + vector_data4( + vector_data4&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data4( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data4( + vector_data4 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data4& + operator=(vector_data4 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data4 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); + return vector_data4(*i0 , *i1 , *i2 , *i3); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data4 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); + return vector_data4(*i0 , *i1 , *i2 , *i3); + } + T0 m0; T1 m1; T2 m2; T3 m3; + }; + template + struct vector4 + : vector_data4 + , sequence_base > + { + typedef vector4 this_type; + typedef vector_data4 base_type; + typedef mpl::vector4 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<4> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector4() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector4( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3) + : base_type(_0 , _1 , _2 , _3) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector4(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector4(vector4&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector4(vector4 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector4& + operator=(vector4 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector4& + operator=(vector4&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector4( + vector4 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector4( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector4( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector4& + operator=(vector4 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data5 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data5() + : m0() , m1() , m2() , m3() , m4() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data5(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) {} + vector_data5( + vector_data5&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data5( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data5( + vector_data5 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data5& + operator=(vector_data5 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data5 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); + return vector_data5(*i0 , *i1 , *i2 , *i3 , *i4); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data5 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); + return vector_data5(*i0 , *i1 , *i2 , *i3 , *i4); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; + }; + template + struct vector5 + : vector_data5 + , sequence_base > + { + typedef vector5 this_type; + typedef vector_data5 base_type; + typedef mpl::vector5 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<5> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector5() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector5( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4) + : base_type(_0 , _1 , _2 , _3 , _4) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector5(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector5(vector5&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector5(vector5 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector5& + operator=(vector5 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector5& + operator=(vector5&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector5( + vector5 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector5( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector5( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector5& + operator=(vector5 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data6 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data6() + : m0() , m1() , m2() , m3() , m4() , m5() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data6(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) {} + vector_data6( + vector_data6&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data6( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data6( + vector_data6 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data6& + operator=(vector_data6 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data6 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); + return vector_data6(*i0 , *i1 , *i2 , *i3 , *i4 , *i5); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data6 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); + return vector_data6(*i0 , *i1 , *i2 , *i3 , *i4 , *i5); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; + }; + template + struct vector6 + : vector_data6 + , sequence_base > + { + typedef vector6 this_type; + typedef vector_data6 base_type; + typedef mpl::vector6 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<6> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector6() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector6( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5) + : base_type(_0 , _1 , _2 , _3 , _4 , _5) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector6(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector6(vector6&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector6(vector6 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector6& + operator=(vector6 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector6& + operator=(vector6&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector6( + vector6 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector6( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector6( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector6& + operator=(vector6 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data7 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data7() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data7(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) {} + vector_data7( + vector_data7&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data7( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data7( + vector_data7 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data7& + operator=(vector_data7 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data7 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); + return vector_data7(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data7 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); + return vector_data7(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; + }; + template + struct vector7 + : vector_data7 + , sequence_base > + { + typedef vector7 this_type; + typedef vector_data7 base_type; + typedef mpl::vector7 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<7> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector7() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector7( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector7(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector7(vector7&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector7(vector7 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector7& + operator=(vector7 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector7& + operator=(vector7&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector7( + vector7 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector7( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector7( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector7& + operator=(vector7 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data8 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data8() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data8(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) {} + vector_data8( + vector_data8&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data8( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data8( + vector_data8 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data8& + operator=(vector_data8 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data8 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); + return vector_data8(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data8 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); + return vector_data8(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; + }; + template + struct vector8 + : vector_data8 + , sequence_base > + { + typedef vector8 this_type; + typedef vector_data8 base_type; + typedef mpl::vector8 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<8> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector8() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector8( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector8(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector8(vector8&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector8(vector8 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector8& + operator=(vector8 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector8& + operator=(vector8&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector8( + vector8 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector8( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector8( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector8& + operator=(vector8 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data9 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data9() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data9(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) {} + vector_data9( + vector_data9&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data9( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data9( + vector_data9 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data9& + operator=(vector_data9 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data9 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); + return vector_data9(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data9 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); + return vector_data9(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; + }; + template + struct vector9 + : vector_data9 + , sequence_base > + { + typedef vector9 this_type; + typedef vector_data9 base_type; + typedef mpl::vector9 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<9> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector9() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector9( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector9(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector9(vector9&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector9(vector9 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector9& + operator=(vector9 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector9& + operator=(vector9&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector9( + vector9 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector9( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector9( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector9& + operator=(vector9 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data10 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data10() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data10(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) {} + vector_data10( + vector_data10&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data10( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data10( + vector_data10 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data10& + operator=(vector_data10 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data10 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); + return vector_data10(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data10 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); + return vector_data10(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; + }; + template + struct vector10 + : vector_data10 + , sequence_base > + { + typedef vector10 this_type; + typedef vector_data10 base_type; + typedef mpl::vector10 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<10> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector10() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector10( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector10(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector10(vector10&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector10(vector10 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector10& + operator=(vector10 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector10& + operator=(vector10&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector10( + vector10 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector10( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector10( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector10& + operator=(vector10 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector10_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector10_fwd.hpp new file mode 100644 index 000000000..49a0f795a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector10_fwd.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + + template + struct vector1; + template + struct vector2; + template + struct vector3; + template + struct vector4; + template + struct vector5; + template + struct vector6; + template + struct vector7; + template + struct vector8; + template + struct vector9; + template + struct vector10; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector20.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector20.hpp new file mode 100644 index 000000000..264b3c0d6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector20.hpp @@ -0,0 +1,1524 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + template + struct vector_data11 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data11() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data11(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) {} + vector_data11( + vector_data11&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data11( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data11( + vector_data11 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data11& + operator=(vector_data11 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data11 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); + return vector_data11(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data11 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); + return vector_data11(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; + }; + template + struct vector11 + : vector_data11 + , sequence_base > + { + typedef vector11 this_type; + typedef vector_data11 base_type; + typedef mpl::vector11 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<11> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector11() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector11( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector11(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector11(vector11&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector11(vector11 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector11& + operator=(vector11 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector11& + operator=(vector11&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector11( + vector11 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector11( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector11( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector11& + operator=(vector11 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data12 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data12() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data12(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) {} + vector_data12( + vector_data12&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data12( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data12( + vector_data12 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data12& + operator=(vector_data12 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data12 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); + return vector_data12(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data12 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); + return vector_data12(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; + }; + template + struct vector12 + : vector_data12 + , sequence_base > + { + typedef vector12 this_type; + typedef vector_data12 base_type; + typedef mpl::vector12 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<12> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector12() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector12( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector12(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector12(vector12&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector12(vector12 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector12& + operator=(vector12 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector12& + operator=(vector12&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector12( + vector12 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector12( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector12( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector12& + operator=(vector12 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data13 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data13() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data13(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) {} + vector_data13( + vector_data13&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data13( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data13( + vector_data13 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data13& + operator=(vector_data13 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data13 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); + return vector_data13(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data13 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); + return vector_data13(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; + }; + template + struct vector13 + : vector_data13 + , sequence_base > + { + typedef vector13 this_type; + typedef vector_data13 base_type; + typedef mpl::vector13 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<13> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector13() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector13( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector13(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector13(vector13&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector13(vector13 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector13& + operator=(vector13 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector13& + operator=(vector13&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector13( + vector13 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector13( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector13( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector13& + operator=(vector13 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data14 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data14() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data14(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) {} + vector_data14( + vector_data14&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data14( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data14( + vector_data14 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data14& + operator=(vector_data14 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data14 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); + return vector_data14(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data14 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); + return vector_data14(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; + }; + template + struct vector14 + : vector_data14 + , sequence_base > + { + typedef vector14 this_type; + typedef vector_data14 base_type; + typedef mpl::vector14 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<14> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector14() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector14( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector14(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector14(vector14&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector14(vector14 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector14& + operator=(vector14 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector14& + operator=(vector14&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector14( + vector14 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector14( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector14( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector14& + operator=(vector14 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data15 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data15() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data15(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) {} + vector_data15( + vector_data15&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data15( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data15( + vector_data15 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data15& + operator=(vector_data15 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data15 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); + return vector_data15(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data15 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); + return vector_data15(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; + }; + template + struct vector15 + : vector_data15 + , sequence_base > + { + typedef vector15 this_type; + typedef vector_data15 base_type; + typedef mpl::vector15 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<15> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector15() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector15( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector15(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector15(vector15&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector15(vector15 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector15& + operator=(vector15 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector15& + operator=(vector15&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector15( + vector15 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector15( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector15( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector15& + operator=(vector15 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data16 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data16() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data16(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) {} + vector_data16( + vector_data16&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data16( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data16( + vector_data16 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data16& + operator=(vector_data16 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data16 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); + return vector_data16(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data16 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); + return vector_data16(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; + }; + template + struct vector16 + : vector_data16 + , sequence_base > + { + typedef vector16 this_type; + typedef vector_data16 base_type; + typedef mpl::vector16 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<16> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector16() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector16( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector16(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector16(vector16&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector16(vector16 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector16& + operator=(vector16 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector16& + operator=(vector16&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector16( + vector16 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector16( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector16( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector16& + operator=(vector16 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data17 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data17() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data17(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) {} + vector_data17( + vector_data17&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data17( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data17( + vector_data17 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data17& + operator=(vector_data17 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data17 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); + return vector_data17(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data17 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); + return vector_data17(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; + }; + template + struct vector17 + : vector_data17 + , sequence_base > + { + typedef vector17 this_type; + typedef vector_data17 base_type; + typedef mpl::vector17 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<17> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector17() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector17( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector17(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector17(vector17&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector17(vector17 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector17& + operator=(vector17 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector17& + operator=(vector17&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector17( + vector17 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector17( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector17( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector17& + operator=(vector17 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data18 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data18() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data18(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) {} + vector_data18( + vector_data18&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data18( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data18( + vector_data18 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data18& + operator=(vector_data18 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data18 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); + return vector_data18(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data18 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); + return vector_data18(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; + }; + template + struct vector18 + : vector_data18 + , sequence_base > + { + typedef vector18 this_type; + typedef vector_data18 base_type; + typedef mpl::vector18 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<18> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector18() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector18( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector18(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector18(vector18&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector18(vector18 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector18& + operator=(vector18 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector18& + operator=(vector18&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector18( + vector18 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector18( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector18( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector18& + operator=(vector18 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data19 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data19() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data19(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) {} + vector_data19( + vector_data19&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data19( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data19( + vector_data19 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data19& + operator=(vector_data19 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data19 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); + return vector_data19(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data19 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); + return vector_data19(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; + }; + template + struct vector19 + : vector_data19 + , sequence_base > + { + typedef vector19 this_type; + typedef vector_data19 base_type; + typedef mpl::vector19 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<19> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector19() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector19( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector19(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector19(vector19&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector19(vector19 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector19& + operator=(vector19 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector19& + operator=(vector19&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector19( + vector19 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector19( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector19( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector19& + operator=(vector19 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data20 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data20() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data20(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) {} + vector_data20( + vector_data20&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data20( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data20( + vector_data20 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data20& + operator=(vector_data20 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data20 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); + return vector_data20(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data20 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); + return vector_data20(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; + }; + template + struct vector20 + : vector_data20 + , sequence_base > + { + typedef vector20 this_type; + typedef vector_data20 base_type; + typedef mpl::vector20 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<20> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector20() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector20( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector20(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector20(vector20&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector20(vector20 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector20& + operator=(vector20 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector20& + operator=(vector20&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector20( + vector20 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector20( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector20( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector20& + operator=(vector20 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector20_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector20_fwd.hpp new file mode 100644 index 000000000..be0f1f9c4 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector20_fwd.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + + template + struct vector11; + template + struct vector12; + template + struct vector13; + template + struct vector14; + template + struct vector15; + template + struct vector16; + template + struct vector17; + template + struct vector18; + template + struct vector19; + template + struct vector20; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector30.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector30.hpp new file mode 100644 index 000000000..0398346f4 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector30.hpp @@ -0,0 +1,1524 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + template + struct vector_data21 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data21() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data21(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) {} + vector_data21( + vector_data21&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data21( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data21( + vector_data21 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data21& + operator=(vector_data21 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data21 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); + return vector_data21(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data21 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); + return vector_data21(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; + }; + template + struct vector21 + : vector_data21 + , sequence_base > + { + typedef vector21 this_type; + typedef vector_data21 base_type; + typedef mpl::vector21 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<21> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector21() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector21( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector21(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector21(vector21&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector21(vector21 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector21& + operator=(vector21 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector21& + operator=(vector21&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector21( + vector21 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector21( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector21( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector21& + operator=(vector21 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data22 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data22() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data22(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) {} + vector_data22( + vector_data22&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data22( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data22( + vector_data22 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data22& + operator=(vector_data22 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data22 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); + return vector_data22(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data22 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); + return vector_data22(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; + }; + template + struct vector22 + : vector_data22 + , sequence_base > + { + typedef vector22 this_type; + typedef vector_data22 base_type; + typedef mpl::vector22 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<22> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector22() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector22( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector22(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector22(vector22&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector22(vector22 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector22& + operator=(vector22 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector22& + operator=(vector22&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector22( + vector22 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector22( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector22( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector22& + operator=(vector22 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data23 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data23() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data23(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) {} + vector_data23( + vector_data23&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data23( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data23( + vector_data23 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data23& + operator=(vector_data23 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data23 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); + return vector_data23(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data23 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); + return vector_data23(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; + }; + template + struct vector23 + : vector_data23 + , sequence_base > + { + typedef vector23 this_type; + typedef vector_data23 base_type; + typedef mpl::vector23 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<23> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector23() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector23( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector23(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector23(vector23&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector23(vector23 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector23& + operator=(vector23 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector23& + operator=(vector23&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector23( + vector23 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector23( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector23( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector23& + operator=(vector23 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data24 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data24() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data24(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) {} + vector_data24( + vector_data24&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data24( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data24( + vector_data24 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data24& + operator=(vector_data24 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data24 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); + return vector_data24(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data24 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); + return vector_data24(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; + }; + template + struct vector24 + : vector_data24 + , sequence_base > + { + typedef vector24 this_type; + typedef vector_data24 base_type; + typedef mpl::vector24 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<24> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector24() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector24( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector24(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector24(vector24&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector24(vector24 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector24& + operator=(vector24 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector24& + operator=(vector24&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector24( + vector24 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector24( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector24( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector24& + operator=(vector24 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data25 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data25() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data25(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) {} + vector_data25( + vector_data25&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data25( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data25( + vector_data25 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data25& + operator=(vector_data25 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data25 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); + return vector_data25(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data25 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); + return vector_data25(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; + }; + template + struct vector25 + : vector_data25 + , sequence_base > + { + typedef vector25 this_type; + typedef vector_data25 base_type; + typedef mpl::vector25 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<25> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector25() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector25( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector25(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector25(vector25&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector25(vector25 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector25& + operator=(vector25 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector25& + operator=(vector25&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector25( + vector25 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector25( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector25( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector25& + operator=(vector25 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data26 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data26() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data26(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) {} + vector_data26( + vector_data26&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data26( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data26( + vector_data26 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data26& + operator=(vector_data26 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data26 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); + return vector_data26(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data26 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); + return vector_data26(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; + }; + template + struct vector26 + : vector_data26 + , sequence_base > + { + typedef vector26 this_type; + typedef vector_data26 base_type; + typedef mpl::vector26 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<26> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector26() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector26( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector26(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector26(vector26&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector26(vector26 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector26& + operator=(vector26 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector26& + operator=(vector26&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector26( + vector26 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector26( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector26( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector26& + operator=(vector26 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data27 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data27() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data27(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) {} + vector_data27( + vector_data27&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data27( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data27( + vector_data27 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data27& + operator=(vector_data27 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data27 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); + return vector_data27(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data27 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); + return vector_data27(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; + }; + template + struct vector27 + : vector_data27 + , sequence_base > + { + typedef vector27 this_type; + typedef vector_data27 base_type; + typedef mpl::vector27 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<27> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector27() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector27( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector27(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector27(vector27&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector27(vector27 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector27& + operator=(vector27 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector27& + operator=(vector27&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector27( + vector27 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector27( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector27( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector27& + operator=(vector27 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data28 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data28() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data28(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) {} + vector_data28( + vector_data28&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data28( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data28( + vector_data28 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data28& + operator=(vector_data28 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data28 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); + return vector_data28(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data28 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); + return vector_data28(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; + }; + template + struct vector28 + : vector_data28 + , sequence_base > + { + typedef vector28 this_type; + typedef vector_data28 base_type; + typedef mpl::vector28 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<28> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector28() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector28( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector28(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector28(vector28&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector28(vector28 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector28& + operator=(vector28 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector28& + operator=(vector28&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector28( + vector28 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector28( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector28( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector28& + operator=(vector28 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data29 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data29() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data29(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) {} + vector_data29( + vector_data29&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data29( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data29( + vector_data29 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data29& + operator=(vector_data29 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data29 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); + return vector_data29(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data29 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); + return vector_data29(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; + }; + template + struct vector29 + : vector_data29 + , sequence_base > + { + typedef vector29 this_type; + typedef vector_data29 base_type; + typedef mpl::vector29 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<29> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector29() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector29( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector29(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector29(vector29&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector29(vector29 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector29& + operator=(vector29 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector29& + operator=(vector29&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector29( + vector29 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector29( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector29( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector29& + operator=(vector29 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data30 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data30() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data30(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) {} + vector_data30( + vector_data30&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data30( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data30( + vector_data30 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data30& + operator=(vector_data30 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data30 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); + return vector_data30(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data30 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); + return vector_data30(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; + }; + template + struct vector30 + : vector_data30 + , sequence_base > + { + typedef vector30 this_type; + typedef vector_data30 base_type; + typedef mpl::vector30 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<30> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector30() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector30( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector30(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector30(vector30&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector30(vector30 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector30& + operator=(vector30 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector30& + operator=(vector30&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector30( + vector30 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector30( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector30( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector30& + operator=(vector30 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector30_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector30_fwd.hpp new file mode 100644 index 000000000..9914a4caf --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector30_fwd.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + + template + struct vector21; + template + struct vector22; + template + struct vector23; + template + struct vector24; + template + struct vector25; + template + struct vector26; + template + struct vector27; + template + struct vector28; + template + struct vector29; + template + struct vector30; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector40.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector40.hpp new file mode 100644 index 000000000..871b1d648 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector40.hpp @@ -0,0 +1,1524 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + template + struct vector_data31 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data31() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data31(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) {} + vector_data31( + vector_data31&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data31( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data31( + vector_data31 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data31& + operator=(vector_data31 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data31 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); + return vector_data31(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data31 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); + return vector_data31(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; + }; + template + struct vector31 + : vector_data31 + , sequence_base > + { + typedef vector31 this_type; + typedef vector_data31 base_type; + typedef mpl::vector31 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<31> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector31() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector31( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector31(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector31(vector31&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector31(vector31 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector31& + operator=(vector31 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector31& + operator=(vector31&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector31( + vector31 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector31( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector31( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector31& + operator=(vector31 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data32 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data32() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data32(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) {} + vector_data32( + vector_data32&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data32( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data32( + vector_data32 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data32& + operator=(vector_data32 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data32 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); + return vector_data32(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data32 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); + return vector_data32(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; + }; + template + struct vector32 + : vector_data32 + , sequence_base > + { + typedef vector32 this_type; + typedef vector_data32 base_type; + typedef mpl::vector32 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<32> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector32() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector32( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector32(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector32(vector32&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector32(vector32 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector32& + operator=(vector32 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector32& + operator=(vector32&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector32( + vector32 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector32( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector32( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector32& + operator=(vector32 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data33 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data33() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data33(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) {} + vector_data33( + vector_data33&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data33( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data33( + vector_data33 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data33& + operator=(vector_data33 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data33 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); + return vector_data33(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data33 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); + return vector_data33(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; + }; + template + struct vector33 + : vector_data33 + , sequence_base > + { + typedef vector33 this_type; + typedef vector_data33 base_type; + typedef mpl::vector33 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<33> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector33() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector33( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector33(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector33(vector33&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector33(vector33 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector33& + operator=(vector33 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector33& + operator=(vector33&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector33( + vector33 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector33( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector33( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector33& + operator=(vector33 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data34 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data34() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data34(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) {} + vector_data34( + vector_data34&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data34( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data34( + vector_data34 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data34& + operator=(vector_data34 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data34 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); + return vector_data34(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data34 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); + return vector_data34(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; + }; + template + struct vector34 + : vector_data34 + , sequence_base > + { + typedef vector34 this_type; + typedef vector_data34 base_type; + typedef mpl::vector34 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<34> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector34() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector34( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector34(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector34(vector34&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector34(vector34 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector34& + operator=(vector34 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector34& + operator=(vector34&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector34( + vector34 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector34( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector34( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector34& + operator=(vector34 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data35 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data35() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data35(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) {} + vector_data35( + vector_data35&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data35( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data35( + vector_data35 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data35& + operator=(vector_data35 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data35 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); + return vector_data35(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data35 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); + return vector_data35(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; + }; + template + struct vector35 + : vector_data35 + , sequence_base > + { + typedef vector35 this_type; + typedef vector_data35 base_type; + typedef mpl::vector35 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<35> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector35() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector35( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector35(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector35(vector35&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector35(vector35 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector35& + operator=(vector35 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector35& + operator=(vector35&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector35( + vector35 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector35( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector35( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector35& + operator=(vector35 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data36 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data36() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data36(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) {} + vector_data36( + vector_data36&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data36( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data36( + vector_data36 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data36& + operator=(vector_data36 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data36 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); + return vector_data36(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data36 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); + return vector_data36(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; + }; + template + struct vector36 + : vector_data36 + , sequence_base > + { + typedef vector36 this_type; + typedef vector_data36 base_type; + typedef mpl::vector36 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<36> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector36() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector36( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector36(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector36(vector36&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector36(vector36 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector36& + operator=(vector36 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector36& + operator=(vector36&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector36( + vector36 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector36( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector36( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector36& + operator=(vector36 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data37 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data37() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data37(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) {} + vector_data37( + vector_data37&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data37( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data37( + vector_data37 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data37& + operator=(vector_data37 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data37 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); + return vector_data37(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data37 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); + return vector_data37(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; + }; + template + struct vector37 + : vector_data37 + , sequence_base > + { + typedef vector37 this_type; + typedef vector_data37 base_type; + typedef mpl::vector37 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<37> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector37() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector37( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector37(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector37(vector37&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector37(vector37 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector37& + operator=(vector37 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector37& + operator=(vector37&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector37( + vector37 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector37( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector37( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector37& + operator=(vector37 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data38 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data38() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data38(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) {} + vector_data38( + vector_data38&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data38( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data38( + vector_data38 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data38& + operator=(vector_data38 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data38 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); + return vector_data38(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data38 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); + return vector_data38(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; + }; + template + struct vector38 + : vector_data38 + , sequence_base > + { + typedef vector38 this_type; + typedef vector_data38 base_type; + typedef mpl::vector38 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<38> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector38() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector38( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector38(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector38(vector38&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector38(vector38 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector38& + operator=(vector38 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector38& + operator=(vector38&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector38( + vector38 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector38( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector38( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector38& + operator=(vector38 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data39 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data39() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data39(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) {} + vector_data39( + vector_data39&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data39( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data39( + vector_data39 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data39& + operator=(vector_data39 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data39 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); + return vector_data39(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data39 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); + return vector_data39(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; + }; + template + struct vector39 + : vector_data39 + , sequence_base > + { + typedef vector39 this_type; + typedef vector_data39 base_type; + typedef mpl::vector39 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<39> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector39() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector39( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector39(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector39(vector39&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector39(vector39 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector39& + operator=(vector39 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector39& + operator=(vector39&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector39( + vector39 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector39( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector39( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector39& + operator=(vector39 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data40 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data40() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data40(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) {} + vector_data40( + vector_data40&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data40( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data40( + vector_data40 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data40& + operator=(vector_data40 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data40 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); + return vector_data40(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data40 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); + return vector_data40(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; + }; + template + struct vector40 + : vector_data40 + , sequence_base > + { + typedef vector40 this_type; + typedef vector_data40 base_type; + typedef mpl::vector40 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<40> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector40() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector40( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector40(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector40(vector40&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector40(vector40 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector40& + operator=(vector40 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector40& + operator=(vector40&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector40( + vector40 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector40( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector40( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector40& + operator=(vector40 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector40_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector40_fwd.hpp new file mode 100644 index 000000000..6777e1ad3 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector40_fwd.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + + template + struct vector31; + template + struct vector32; + template + struct vector33; + template + struct vector34; + template + struct vector35; + template + struct vector36; + template + struct vector37; + template + struct vector38; + template + struct vector39; + template + struct vector40; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector50.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector50.hpp new file mode 100644 index 000000000..a8ec69eb0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector50.hpp @@ -0,0 +1,1524 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + template + struct vector_data41 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data41() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data41(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) {} + vector_data41( + vector_data41&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data41( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data41( + vector_data41 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data41& + operator=(vector_data41 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data41 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); + return vector_data41(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data41 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); + return vector_data41(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; + }; + template + struct vector41 + : vector_data41 + , sequence_base > + { + typedef vector41 this_type; + typedef vector_data41 base_type; + typedef mpl::vector41 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<41> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector41() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector41( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector41(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector41(vector41&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector41(vector41 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector41& + operator=(vector41 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector41& + operator=(vector41&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector41( + vector41 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector41( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector41( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector41& + operator=(vector41 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data42 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data42() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data42(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) {} + vector_data42( + vector_data42&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data42( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data42( + vector_data42 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data42& + operator=(vector_data42 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data42 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); + return vector_data42(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data42 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); + return vector_data42(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; + }; + template + struct vector42 + : vector_data42 + , sequence_base > + { + typedef vector42 this_type; + typedef vector_data42 base_type; + typedef mpl::vector42 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<42> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector42() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector42( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector42(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector42(vector42&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector42(vector42 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector42& + operator=(vector42 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector42& + operator=(vector42&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector42( + vector42 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector42( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector42( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector42& + operator=(vector42 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data43 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data43() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() , m42() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data43(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) , m42(std::forward(_42)) {} + vector_data43( + vector_data43&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) , m42(std::forward(other.m42)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data43( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) , m42(_42) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data43( + vector_data43 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) , m42(other.m42) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data43& + operator=(vector_data43 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data43 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); + return vector_data43(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data43 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); + return vector_data43(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; + }; + template + struct vector43 + : vector_data43 + , sequence_base > + { + typedef vector43 this_type; + typedef vector_data43 base_type; + typedef mpl::vector43 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<43> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector43() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector43( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41 , _42) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector43(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41) , std::forward(_42)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector43(vector43&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector43(vector43 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector43& + operator=(vector43 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector43& + operator=(vector43&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); this->m42 = std::forward< T42>(vec.m42); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector43( + vector43 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41 , vec.m42) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector43( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector43( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector43& + operator=(vector43 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; this->m42 = *i42; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<42>) { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<42>) const { return this->m42; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data44 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data44() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() , m42() , m43() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data44(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) , m42(std::forward(_42)) , m43(std::forward(_43)) {} + vector_data44( + vector_data44&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) , m42(std::forward(other.m42)) , m43(std::forward(other.m43)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data44( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) , m42(_42) , m43(_43) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data44( + vector_data44 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) , m42(other.m42) , m43(other.m43) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data44& + operator=(vector_data44 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data44 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); + return vector_data44(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data44 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); + return vector_data44(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; + }; + template + struct vector44 + : vector_data44 + , sequence_base > + { + typedef vector44 this_type; + typedef vector_data44 base_type; + typedef mpl::vector44 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<44> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector44() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector44( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41 , _42 , _43) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector44(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41) , std::forward(_42) , std::forward(_43)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector44(vector44&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector44(vector44 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector44& + operator=(vector44 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector44& + operator=(vector44&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); this->m42 = std::forward< T42>(vec.m42); this->m43 = std::forward< T43>(vec.m43); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector44( + vector44 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41 , vec.m42 , vec.m43) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector44( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector44( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector44& + operator=(vector44 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; this->m42 = *i42; this->m43 = *i43; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<42>) { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<42>) const { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<43>) { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<43>) const { return this->m43; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data45 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data45() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() , m42() , m43() , m44() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data45(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) , m42(std::forward(_42)) , m43(std::forward(_43)) , m44(std::forward(_44)) {} + vector_data45( + vector_data45&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) , m42(std::forward(other.m42)) , m43(std::forward(other.m43)) , m44(std::forward(other.m44)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data45( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) , m42(_42) , m43(_43) , m44(_44) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data45( + vector_data45 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) , m42(other.m42) , m43(other.m43) , m44(other.m44) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data45& + operator=(vector_data45 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data45 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); + return vector_data45(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data45 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); + return vector_data45(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; + }; + template + struct vector45 + : vector_data45 + , sequence_base > + { + typedef vector45 this_type; + typedef vector_data45 base_type; + typedef mpl::vector45 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<45> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector45() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector45( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41 , _42 , _43 , _44) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector45(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41) , std::forward(_42) , std::forward(_43) , std::forward(_44)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector45(vector45&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector45(vector45 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector45& + operator=(vector45 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector45& + operator=(vector45&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); this->m42 = std::forward< T42>(vec.m42); this->m43 = std::forward< T43>(vec.m43); this->m44 = std::forward< T44>(vec.m44); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector45( + vector45 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41 , vec.m42 , vec.m43 , vec.m44) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector45( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector45( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector45& + operator=(vector45 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; this->m42 = *i42; this->m43 = *i43; this->m44 = *i44; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<42>) { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<42>) const { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<43>) { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<43>) const { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<44>) { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<44>) const { return this->m44; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data46 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data46() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() , m42() , m43() , m44() , m45() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data46(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) , m42(std::forward(_42)) , m43(std::forward(_43)) , m44(std::forward(_44)) , m45(std::forward(_45)) {} + vector_data46( + vector_data46&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) , m42(std::forward(other.m42)) , m43(std::forward(other.m43)) , m44(std::forward(other.m44)) , m45(std::forward(other.m45)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data46( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) , m42(_42) , m43(_43) , m44(_44) , m45(_45) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data46( + vector_data46 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) , m42(other.m42) , m43(other.m43) , m44(other.m44) , m45(other.m45) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data46& + operator=(vector_data46 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data46 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); + return vector_data46(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data46 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); + return vector_data46(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; + }; + template + struct vector46 + : vector_data46 + , sequence_base > + { + typedef vector46 this_type; + typedef vector_data46 base_type; + typedef mpl::vector46 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<46> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector46() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector46( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41 , _42 , _43 , _44 , _45) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector46(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41) , std::forward(_42) , std::forward(_43) , std::forward(_44) , std::forward(_45)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector46(vector46&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector46(vector46 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector46& + operator=(vector46 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector46& + operator=(vector46&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); this->m42 = std::forward< T42>(vec.m42); this->m43 = std::forward< T43>(vec.m43); this->m44 = std::forward< T44>(vec.m44); this->m45 = std::forward< T45>(vec.m45); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector46( + vector46 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41 , vec.m42 , vec.m43 , vec.m44 , vec.m45) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector46( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector46( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector46& + operator=(vector46 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; this->m42 = *i42; this->m43 = *i43; this->m44 = *i44; this->m45 = *i45; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<42>) { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<42>) const { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<43>) { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<43>) const { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<44>) { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<44>) const { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<45>) { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<45>) const { return this->m45; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data47 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data47() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() , m42() , m43() , m44() , m45() , m46() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data47(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 , U46 && _46 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) , m42(std::forward(_42)) , m43(std::forward(_43)) , m44(std::forward(_44)) , m45(std::forward(_45)) , m46(std::forward(_46)) {} + vector_data47( + vector_data47&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) , m42(std::forward(other.m42)) , m43(std::forward(other.m43)) , m44(std::forward(other.m44)) , m45(std::forward(other.m45)) , m46(std::forward(other.m46)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data47( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45 , typename detail::call_param::type _46) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) , m42(_42) , m43(_43) , m44(_44) , m45(_45) , m46(_46) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data47( + vector_data47 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) , m42(other.m42) , m43(other.m43) , m44(other.m44) , m45(other.m45) , m46(other.m46) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data47& + operator=(vector_data47 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; this->m46 = vec.m46; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data47 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); + return vector_data47(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data47 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); + return vector_data47(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; T46 m46; + }; + template + struct vector47 + : vector_data47 + , sequence_base > + { + typedef vector47 this_type; + typedef vector_data47 base_type; + typedef mpl::vector47 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<47> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector47() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector47( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45 , typename detail::call_param::type _46) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41 , _42 , _43 , _44 , _45 , _46) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector47(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 , U46 && _46) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41) , std::forward(_42) , std::forward(_43) , std::forward(_44) , std::forward(_45) , std::forward(_46)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector47(vector47&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector47(vector47 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector47& + operator=(vector47 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector47& + operator=(vector47&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); this->m42 = std::forward< T42>(vec.m42); this->m43 = std::forward< T43>(vec.m43); this->m44 = std::forward< T44>(vec.m44); this->m45 = std::forward< T45>(vec.m45); this->m46 = std::forward< T46>(vec.m46); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector47( + vector47 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41 , vec.m42 , vec.m43 , vec.m44 , vec.m45 , vec.m46) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector47( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector47( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector47& + operator=(vector47 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; this->m46 = vec.m46; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; this->m42 = *i42; this->m43 = *i43; this->m44 = *i44; this->m45 = *i45; this->m46 = *i46; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<42>) { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<42>) const { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<43>) { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<43>) const { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<44>) { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<44>) const { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<45>) { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<45>) const { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<46>) { return this->m46; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<46>) const { return this->m46; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data48 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data48() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() , m42() , m43() , m44() , m45() , m46() , m47() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data48(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 , U46 && _46 , U47 && _47 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) , m42(std::forward(_42)) , m43(std::forward(_43)) , m44(std::forward(_44)) , m45(std::forward(_45)) , m46(std::forward(_46)) , m47(std::forward(_47)) {} + vector_data48( + vector_data48&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) , m42(std::forward(other.m42)) , m43(std::forward(other.m43)) , m44(std::forward(other.m44)) , m45(std::forward(other.m45)) , m46(std::forward(other.m46)) , m47(std::forward(other.m47)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data48( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45 , typename detail::call_param::type _46 , typename detail::call_param::type _47) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) , m42(_42) , m43(_43) , m44(_44) , m45(_45) , m46(_46) , m47(_47) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data48( + vector_data48 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) , m42(other.m42) , m43(other.m43) , m44(other.m44) , m45(other.m45) , m46(other.m46) , m47(other.m47) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data48& + operator=(vector_data48 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; this->m46 = vec.m46; this->m47 = vec.m47; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data48 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); + return vector_data48(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data48 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); + return vector_data48(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; T46 m46; T47 m47; + }; + template + struct vector48 + : vector_data48 + , sequence_base > + { + typedef vector48 this_type; + typedef vector_data48 base_type; + typedef mpl::vector48 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<48> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector48() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector48( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45 , typename detail::call_param::type _46 , typename detail::call_param::type _47) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41 , _42 , _43 , _44 , _45 , _46 , _47) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector48(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 , U46 && _46 , U47 && _47) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41) , std::forward(_42) , std::forward(_43) , std::forward(_44) , std::forward(_45) , std::forward(_46) , std::forward(_47)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector48(vector48&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector48(vector48 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector48& + operator=(vector48 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector48& + operator=(vector48&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); this->m42 = std::forward< T42>(vec.m42); this->m43 = std::forward< T43>(vec.m43); this->m44 = std::forward< T44>(vec.m44); this->m45 = std::forward< T45>(vec.m45); this->m46 = std::forward< T46>(vec.m46); this->m47 = std::forward< T47>(vec.m47); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector48( + vector48 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41 , vec.m42 , vec.m43 , vec.m44 , vec.m45 , vec.m46 , vec.m47) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector48( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector48( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector48& + operator=(vector48 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; this->m46 = vec.m46; this->m47 = vec.m47; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; this->m42 = *i42; this->m43 = *i43; this->m44 = *i44; this->m45 = *i45; this->m46 = *i46; this->m47 = *i47; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<42>) { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<42>) const { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<43>) { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<43>) const { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<44>) { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<44>) const { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<45>) { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<45>) const { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<46>) { return this->m46; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<46>) const { return this->m46; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<47>) { return this->m47; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<47>) const { return this->m47; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data49 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data49() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() , m42() , m43() , m44() , m45() , m46() , m47() , m48() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data49(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 , U46 && _46 , U47 && _47 , U48 && _48 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) , m42(std::forward(_42)) , m43(std::forward(_43)) , m44(std::forward(_44)) , m45(std::forward(_45)) , m46(std::forward(_46)) , m47(std::forward(_47)) , m48(std::forward(_48)) {} + vector_data49( + vector_data49&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) , m42(std::forward(other.m42)) , m43(std::forward(other.m43)) , m44(std::forward(other.m44)) , m45(std::forward(other.m45)) , m46(std::forward(other.m46)) , m47(std::forward(other.m47)) , m48(std::forward(other.m48)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data49( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45 , typename detail::call_param::type _46 , typename detail::call_param::type _47 , typename detail::call_param::type _48) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) , m42(_42) , m43(_43) , m44(_44) , m45(_45) , m46(_46) , m47(_47) , m48(_48) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data49( + vector_data49 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) , m42(other.m42) , m43(other.m43) , m44(other.m44) , m45(other.m45) , m46(other.m46) , m47(other.m47) , m48(other.m48) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data49& + operator=(vector_data49 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; this->m46 = vec.m46; this->m47 = vec.m47; this->m48 = vec.m48; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data49 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47); + return vector_data49(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47 , *i48); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data49 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47); + return vector_data49(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47 , *i48); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; T46 m46; T47 m47; T48 m48; + }; + template + struct vector49 + : vector_data49 + , sequence_base > + { + typedef vector49 this_type; + typedef vector_data49 base_type; + typedef mpl::vector49 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<49> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector49() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector49( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45 , typename detail::call_param::type _46 , typename detail::call_param::type _47 , typename detail::call_param::type _48) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41 , _42 , _43 , _44 , _45 , _46 , _47 , _48) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector49(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 , U46 && _46 , U47 && _47 , U48 && _48) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41) , std::forward(_42) , std::forward(_43) , std::forward(_44) , std::forward(_45) , std::forward(_46) , std::forward(_47) , std::forward(_48)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector49(vector49&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector49(vector49 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector49& + operator=(vector49 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector49& + operator=(vector49&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); this->m42 = std::forward< T42>(vec.m42); this->m43 = std::forward< T43>(vec.m43); this->m44 = std::forward< T44>(vec.m44); this->m45 = std::forward< T45>(vec.m45); this->m46 = std::forward< T46>(vec.m46); this->m47 = std::forward< T47>(vec.m47); this->m48 = std::forward< T48>(vec.m48); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector49( + vector49 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41 , vec.m42 , vec.m43 , vec.m44 , vec.m45 , vec.m46 , vec.m47 , vec.m48) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector49( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector49( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector49& + operator=(vector49 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; this->m46 = vec.m46; this->m47 = vec.m47; this->m48 = vec.m48; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; this->m42 = *i42; this->m43 = *i43; this->m44 = *i44; this->m45 = *i45; this->m46 = *i46; this->m47 = *i47; this->m48 = *i48; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<42>) { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<42>) const { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<43>) { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<43>) const { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<44>) { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<44>) const { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<45>) { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<45>) const { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<46>) { return this->m46; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<46>) const { return this->m46; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<47>) { return this->m47; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<47>) const { return this->m47; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<48>) { return this->m48; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<48>) const { return this->m48; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + template + struct vector_data50 + { + AUTOBOOST_FUSION_GPU_ENABLED + vector_data50() + : m0() , m1() , m2() , m3() , m4() , m5() , m6() , m7() , m8() , m9() , m10() , m11() , m12() , m13() , m14() , m15() , m16() , m17() , m18() , m19() , m20() , m21() , m22() , m23() , m24() , m25() , m26() , m27() , m28() , m29() , m30() , m31() , m32() , m33() , m34() , m35() , m36() , m37() , m38() , m39() , m40() , m41() , m42() , m43() , m44() , m45() , m46() , m47() , m48() , m49() {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector_data50(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 , U46 && _46 , U47 && _47 , U48 && _48 , U49 && _49 + , typename autoboost::enable_if >::type* = 0 + ) + : m0(std::forward(_0)) , m1(std::forward(_1)) , m2(std::forward(_2)) , m3(std::forward(_3)) , m4(std::forward(_4)) , m5(std::forward(_5)) , m6(std::forward(_6)) , m7(std::forward(_7)) , m8(std::forward(_8)) , m9(std::forward(_9)) , m10(std::forward(_10)) , m11(std::forward(_11)) , m12(std::forward(_12)) , m13(std::forward(_13)) , m14(std::forward(_14)) , m15(std::forward(_15)) , m16(std::forward(_16)) , m17(std::forward(_17)) , m18(std::forward(_18)) , m19(std::forward(_19)) , m20(std::forward(_20)) , m21(std::forward(_21)) , m22(std::forward(_22)) , m23(std::forward(_23)) , m24(std::forward(_24)) , m25(std::forward(_25)) , m26(std::forward(_26)) , m27(std::forward(_27)) , m28(std::forward(_28)) , m29(std::forward(_29)) , m30(std::forward(_30)) , m31(std::forward(_31)) , m32(std::forward(_32)) , m33(std::forward(_33)) , m34(std::forward(_34)) , m35(std::forward(_35)) , m36(std::forward(_36)) , m37(std::forward(_37)) , m38(std::forward(_38)) , m39(std::forward(_39)) , m40(std::forward(_40)) , m41(std::forward(_41)) , m42(std::forward(_42)) , m43(std::forward(_43)) , m44(std::forward(_44)) , m45(std::forward(_45)) , m46(std::forward(_46)) , m47(std::forward(_47)) , m48(std::forward(_48)) , m49(std::forward(_49)) {} + vector_data50( + vector_data50&& other) + : m0(std::forward(other.m0)) , m1(std::forward(other.m1)) , m2(std::forward(other.m2)) , m3(std::forward(other.m3)) , m4(std::forward(other.m4)) , m5(std::forward(other.m5)) , m6(std::forward(other.m6)) , m7(std::forward(other.m7)) , m8(std::forward(other.m8)) , m9(std::forward(other.m9)) , m10(std::forward(other.m10)) , m11(std::forward(other.m11)) , m12(std::forward(other.m12)) , m13(std::forward(other.m13)) , m14(std::forward(other.m14)) , m15(std::forward(other.m15)) , m16(std::forward(other.m16)) , m17(std::forward(other.m17)) , m18(std::forward(other.m18)) , m19(std::forward(other.m19)) , m20(std::forward(other.m20)) , m21(std::forward(other.m21)) , m22(std::forward(other.m22)) , m23(std::forward(other.m23)) , m24(std::forward(other.m24)) , m25(std::forward(other.m25)) , m26(std::forward(other.m26)) , m27(std::forward(other.m27)) , m28(std::forward(other.m28)) , m29(std::forward(other.m29)) , m30(std::forward(other.m30)) , m31(std::forward(other.m31)) , m32(std::forward(other.m32)) , m33(std::forward(other.m33)) , m34(std::forward(other.m34)) , m35(std::forward(other.m35)) , m36(std::forward(other.m36)) , m37(std::forward(other.m37)) , m38(std::forward(other.m38)) , m39(std::forward(other.m39)) , m40(std::forward(other.m40)) , m41(std::forward(other.m41)) , m42(std::forward(other.m42)) , m43(std::forward(other.m43)) , m44(std::forward(other.m44)) , m45(std::forward(other.m45)) , m46(std::forward(other.m46)) , m47(std::forward(other.m47)) , m48(std::forward(other.m48)) , m49(std::forward(other.m49)) {} +# endif + AUTOBOOST_FUSION_GPU_ENABLED + vector_data50( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45 , typename detail::call_param::type _46 , typename detail::call_param::type _47 , typename detail::call_param::type _48 , typename detail::call_param::type _49) + : m0(_0) , m1(_1) , m2(_2) , m3(_3) , m4(_4) , m5(_5) , m6(_6) , m7(_7) , m8(_8) , m9(_9) , m10(_10) , m11(_11) , m12(_12) , m13(_13) , m14(_14) , m15(_15) , m16(_16) , m17(_17) , m18(_18) , m19(_19) , m20(_20) , m21(_21) , m22(_22) , m23(_23) , m24(_24) , m25(_25) , m26(_26) , m27(_27) , m28(_28) , m29(_29) , m30(_30) , m31(_31) , m32(_32) , m33(_33) , m34(_34) , m35(_35) , m36(_36) , m37(_37) , m38(_38) , m39(_39) , m40(_40) , m41(_41) , m42(_42) , m43(_43) , m44(_44) , m45(_45) , m46(_46) , m47(_47) , m48(_48) , m49(_49) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data50( + vector_data50 const& other) + : m0(other.m0) , m1(other.m1) , m2(other.m2) , m3(other.m3) , m4(other.m4) , m5(other.m5) , m6(other.m6) , m7(other.m7) , m8(other.m8) , m9(other.m9) , m10(other.m10) , m11(other.m11) , m12(other.m12) , m13(other.m13) , m14(other.m14) , m15(other.m15) , m16(other.m16) , m17(other.m17) , m18(other.m18) , m19(other.m19) , m20(other.m20) , m21(other.m21) , m22(other.m22) , m23(other.m23) , m24(other.m24) , m25(other.m25) , m26(other.m26) , m27(other.m27) , m28(other.m28) , m29(other.m29) , m30(other.m30) , m31(other.m31) , m32(other.m32) , m33(other.m33) , m34(other.m34) , m35(other.m35) , m36(other.m36) , m37(other.m37) , m38(other.m38) , m39(other.m39) , m40(other.m40) , m41(other.m41) , m42(other.m42) , m43(other.m43) , m44(other.m44) , m45(other.m45) , m46(other.m46) , m47(other.m47) , m48(other.m48) , m49(other.m49) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector_data50& + operator=(vector_data50 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; this->m46 = vec.m46; this->m47 = vec.m47; this->m48 = vec.m48; this->m49 = vec.m49; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data50 + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47); typedef typename result_of::next< I48>::type I49; I49 i49 = fusion::next(i48); + return vector_data50(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47 , *i48 , *i49); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + static vector_data50 + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47); typedef typename result_of::next< I48>::type I49; I49 i49 = fusion::next(i48); + return vector_data50(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47 , *i48 , *i49); + } + T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; T46 m46; T47 m47; T48 m48; T49 m49; + }; + template + struct vector50 + : vector_data50 + , sequence_base > + { + typedef vector50 this_type; + typedef vector_data50 base_type; + typedef mpl::vector50 types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<50> size; + AUTOBOOST_FUSION_GPU_ENABLED + vector50() {} + AUTOBOOST_FUSION_GPU_ENABLED + vector50( + typename detail::call_param::type _0 , typename detail::call_param::type _1 , typename detail::call_param::type _2 , typename detail::call_param::type _3 , typename detail::call_param::type _4 , typename detail::call_param::type _5 , typename detail::call_param::type _6 , typename detail::call_param::type _7 , typename detail::call_param::type _8 , typename detail::call_param::type _9 , typename detail::call_param::type _10 , typename detail::call_param::type _11 , typename detail::call_param::type _12 , typename detail::call_param::type _13 , typename detail::call_param::type _14 , typename detail::call_param::type _15 , typename detail::call_param::type _16 , typename detail::call_param::type _17 , typename detail::call_param::type _18 , typename detail::call_param::type _19 , typename detail::call_param::type _20 , typename detail::call_param::type _21 , typename detail::call_param::type _22 , typename detail::call_param::type _23 , typename detail::call_param::type _24 , typename detail::call_param::type _25 , typename detail::call_param::type _26 , typename detail::call_param::type _27 , typename detail::call_param::type _28 , typename detail::call_param::type _29 , typename detail::call_param::type _30 , typename detail::call_param::type _31 , typename detail::call_param::type _32 , typename detail::call_param::type _33 , typename detail::call_param::type _34 , typename detail::call_param::type _35 , typename detail::call_param::type _36 , typename detail::call_param::type _37 , typename detail::call_param::type _38 , typename detail::call_param::type _39 , typename detail::call_param::type _40 , typename detail::call_param::type _41 , typename detail::call_param::type _42 , typename detail::call_param::type _43 , typename detail::call_param::type _44 , typename detail::call_param::type _45 , typename detail::call_param::type _46 , typename detail::call_param::type _47 , typename detail::call_param::type _48 , typename detail::call_param::type _49) + : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , _11 , _12 , _13 , _14 , _15 , _16 , _17 , _18 , _19 , _20 , _21 , _22 , _23 , _24 , _25 , _26 , _27 , _28 , _29 , _30 , _31 , _32 , _33 , _34 , _35 , _36 , _37 , _38 , _39 , _40 , _41 , _42 , _43 , _44 , _45 , _46 , _47 , _48 , _49) {} +# if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) + template + AUTOBOOST_FUSION_GPU_ENABLED + vector50(U0 && _0 , U1 && _1 , U2 && _2 , U3 && _3 , U4 && _4 , U5 && _5 , U6 && _6 , U7 && _7 , U8 && _8 , U9 && _9 , U10 && _10 , U11 && _11 , U12 && _12 , U13 && _13 , U14 && _14 , U15 && _15 , U16 && _16 , U17 && _17 , U18 && _18 , U19 && _19 , U20 && _20 , U21 && _21 , U22 && _22 , U23 && _23 , U24 && _24 , U25 && _25 , U26 && _26 , U27 && _27 , U28 && _28 , U29 && _29 , U30 && _30 , U31 && _31 , U32 && _32 , U33 && _33 , U34 && _34 , U35 && _35 , U36 && _36 , U37 && _37 , U38 && _38 , U39 && _39 , U40 && _40 , U41 && _41 , U42 && _42 , U43 && _43 , U44 && _44 , U45 && _45 , U46 && _46 , U47 && _47 , U48 && _48 , U49 && _49) + : base_type(std::forward(_0) , std::forward(_1) , std::forward(_2) , std::forward(_3) , std::forward(_4) , std::forward(_5) , std::forward(_6) , std::forward(_7) , std::forward(_8) , std::forward(_9) , std::forward(_10) , std::forward(_11) , std::forward(_12) , std::forward(_13) , std::forward(_14) , std::forward(_15) , std::forward(_16) , std::forward(_17) , std::forward(_18) , std::forward(_19) , std::forward(_20) , std::forward(_21) , std::forward(_22) , std::forward(_23) , std::forward(_24) , std::forward(_25) , std::forward(_26) , std::forward(_27) , std::forward(_28) , std::forward(_29) , std::forward(_30) , std::forward(_31) , std::forward(_32) , std::forward(_33) , std::forward(_34) , std::forward(_35) , std::forward(_36) , std::forward(_37) , std::forward(_38) , std::forward(_39) , std::forward(_40) , std::forward(_41) , std::forward(_42) , std::forward(_43) , std::forward(_44) , std::forward(_45) , std::forward(_46) , std::forward(_47) , std::forward(_48) , std::forward(_49)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector50(vector50&& rhs) + : base_type(std::forward(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector50(vector50 const& rhs) + : base_type(static_cast(rhs)) {} + AUTOBOOST_FUSION_GPU_ENABLED + vector50& + operator=(vector50 const& vec) + { + base_type::operator=(vec); + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED + vector50& + operator=(vector50&& vec) + { + this->m0 = std::forward< T0>(vec.m0); this->m1 = std::forward< T1>(vec.m1); this->m2 = std::forward< T2>(vec.m2); this->m3 = std::forward< T3>(vec.m3); this->m4 = std::forward< T4>(vec.m4); this->m5 = std::forward< T5>(vec.m5); this->m6 = std::forward< T6>(vec.m6); this->m7 = std::forward< T7>(vec.m7); this->m8 = std::forward< T8>(vec.m8); this->m9 = std::forward< T9>(vec.m9); this->m10 = std::forward< T10>(vec.m10); this->m11 = std::forward< T11>(vec.m11); this->m12 = std::forward< T12>(vec.m12); this->m13 = std::forward< T13>(vec.m13); this->m14 = std::forward< T14>(vec.m14); this->m15 = std::forward< T15>(vec.m15); this->m16 = std::forward< T16>(vec.m16); this->m17 = std::forward< T17>(vec.m17); this->m18 = std::forward< T18>(vec.m18); this->m19 = std::forward< T19>(vec.m19); this->m20 = std::forward< T20>(vec.m20); this->m21 = std::forward< T21>(vec.m21); this->m22 = std::forward< T22>(vec.m22); this->m23 = std::forward< T23>(vec.m23); this->m24 = std::forward< T24>(vec.m24); this->m25 = std::forward< T25>(vec.m25); this->m26 = std::forward< T26>(vec.m26); this->m27 = std::forward< T27>(vec.m27); this->m28 = std::forward< T28>(vec.m28); this->m29 = std::forward< T29>(vec.m29); this->m30 = std::forward< T30>(vec.m30); this->m31 = std::forward< T31>(vec.m31); this->m32 = std::forward< T32>(vec.m32); this->m33 = std::forward< T33>(vec.m33); this->m34 = std::forward< T34>(vec.m34); this->m35 = std::forward< T35>(vec.m35); this->m36 = std::forward< T36>(vec.m36); this->m37 = std::forward< T37>(vec.m37); this->m38 = std::forward< T38>(vec.m38); this->m39 = std::forward< T39>(vec.m39); this->m40 = std::forward< T40>(vec.m40); this->m41 = std::forward< T41>(vec.m41); this->m42 = std::forward< T42>(vec.m42); this->m43 = std::forward< T43>(vec.m43); this->m44 = std::forward< T44>(vec.m44); this->m45 = std::forward< T45>(vec.m45); this->m46 = std::forward< T46>(vec.m46); this->m47 = std::forward< T47>(vec.m47); this->m48 = std::forward< T48>(vec.m48); this->m49 = std::forward< T49>(vec.m49); + return *this; + } +# endif + template + AUTOBOOST_FUSION_GPU_ENABLED + vector50( + vector50 const& vec) + : base_type(vec.m0 , vec.m1 , vec.m2 , vec.m3 , vec.m4 , vec.m5 , vec.m6 , vec.m7 , vec.m8 , vec.m9 , vec.m10 , vec.m11 , vec.m12 , vec.m13 , vec.m14 , vec.m15 , vec.m16 , vec.m17 , vec.m18 , vec.m19 , vec.m20 , vec.m21 , vec.m22 , vec.m23 , vec.m24 , vec.m25 , vec.m26 , vec.m27 , vec.m28 , vec.m29 , vec.m30 , vec.m31 , vec.m32 , vec.m33 , vec.m34 , vec.m35 , vec.m36 , vec.m37 , vec.m38 , vec.m39 , vec.m40 , vec.m41 , vec.m42 , vec.m43 , vec.m44 , vec.m45 , vec.m46 , vec.m47 , vec.m48 , vec.m49) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector50( + Sequence const& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector50( + Sequence& seq + ) + : base_type(base_type::init_from_sequence(seq)) {} + template + AUTOBOOST_FUSION_GPU_ENABLED + vector50& + operator=(vector50 const& vec) + { + this->m0 = vec.m0; this->m1 = vec.m1; this->m2 = vec.m2; this->m3 = vec.m3; this->m4 = vec.m4; this->m5 = vec.m5; this->m6 = vec.m6; this->m7 = vec.m7; this->m8 = vec.m8; this->m9 = vec.m9; this->m10 = vec.m10; this->m11 = vec.m11; this->m12 = vec.m12; this->m13 = vec.m13; this->m14 = vec.m14; this->m15 = vec.m15; this->m16 = vec.m16; this->m17 = vec.m17; this->m18 = vec.m18; this->m19 = vec.m19; this->m20 = vec.m20; this->m21 = vec.m21; this->m22 = vec.m22; this->m23 = vec.m23; this->m24 = vec.m24; this->m25 = vec.m25; this->m26 = vec.m26; this->m27 = vec.m27; this->m28 = vec.m28; this->m29 = vec.m29; this->m30 = vec.m30; this->m31 = vec.m31; this->m32 = vec.m32; this->m33 = vec.m33; this->m34 = vec.m34; this->m35 = vec.m35; this->m36 = vec.m36; this->m37 = vec.m37; this->m38 = vec.m38; this->m39 = vec.m39; this->m40 = vec.m40; this->m41 = vec.m41; this->m42 = vec.m42; this->m43 = vec.m43; this->m44 = vec.m44; this->m45 = vec.m45; this->m46 = vec.m46; this->m47 = vec.m47; this->m48 = vec.m48; this->m49 = vec.m49; + return *this; + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47); typedef typename result_of::next< I48>::type I49; I49 i49 = fusion::next(i48); + this->m0 = *i0; this->m1 = *i1; this->m2 = *i2; this->m3 = *i3; this->m4 = *i4; this->m5 = *i5; this->m6 = *i6; this->m7 = *i7; this->m8 = *i8; this->m9 = *i9; this->m10 = *i10; this->m11 = *i11; this->m12 = *i12; this->m13 = *i13; this->m14 = *i14; this->m15 = *i15; this->m16 = *i16; this->m17 = *i17; this->m18 = *i18; this->m19 = *i19; this->m20 = *i20; this->m21 = *i21; this->m22 = *i22; this->m23 = *i23; this->m24 = *i24; this->m25 = *i25; this->m26 = *i26; this->m27 = *i27; this->m28 = *i28; this->m29 = *i29; this->m30 = *i30; this->m31 = *i31; this->m32 = *i32; this->m33 = *i33; this->m34 = *i34; this->m35 = *i35; this->m36 = *i36; this->m37 = *i37; this->m38 = *i38; this->m39 = *i39; this->m40 = *i40; this->m41 = *i41; this->m42 = *i42; this->m43 = *i43; this->m44 = *i44; this->m45 = *i45; this->m46 = *i46; this->m47 = *i47; this->m48 = *i48; this->m49 = *i49; + return *this; + } + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<0>) { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<0>) const { return this->m0; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<1>) { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<1>) const { return this->m1; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<2>) { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<2>) const { return this->m2; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<3>) { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<3>) const { return this->m3; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<4>) { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<4>) const { return this->m4; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<5>) { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<5>) const { return this->m5; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<6>) { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<6>) const { return this->m6; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<7>) { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<7>) const { return this->m7; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<8>) { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<8>) const { return this->m8; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<9>) { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<9>) const { return this->m9; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<10>) { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<10>) const { return this->m10; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<11>) { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<11>) const { return this->m11; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<12>) { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<12>) const { return this->m12; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<13>) { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<13>) const { return this->m13; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<14>) { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<14>) const { return this->m14; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<15>) { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<15>) const { return this->m15; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<16>) { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<16>) const { return this->m16; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<17>) { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<17>) const { return this->m17; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<18>) { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<18>) const { return this->m18; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<19>) { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<19>) const { return this->m19; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<20>) { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<20>) const { return this->m20; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<21>) { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<21>) const { return this->m21; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<22>) { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<22>) const { return this->m22; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<23>) { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<23>) const { return this->m23; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<24>) { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<24>) const { return this->m24; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<25>) { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<25>) const { return this->m25; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<26>) { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<26>) const { return this->m26; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<27>) { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<27>) const { return this->m27; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<28>) { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<28>) const { return this->m28; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<29>) { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<29>) const { return this->m29; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<30>) { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<30>) const { return this->m30; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<31>) { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<31>) const { return this->m31; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<32>) { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<32>) const { return this->m32; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<33>) { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<33>) const { return this->m33; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<34>) { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<34>) const { return this->m34; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<35>) { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<35>) const { return this->m35; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<36>) { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<36>) const { return this->m36; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<37>) { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<37>) const { return this->m37; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<38>) { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<38>) const { return this->m38; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<39>) { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<39>) const { return this->m39; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<40>) { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<40>) const { return this->m40; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<41>) { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<41>) const { return this->m41; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<42>) { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<42>) const { return this->m42; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<43>) { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<43>) const { return this->m43; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<44>) { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<44>) const { return this->m44; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<45>) { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<45>) const { return this->m45; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<46>) { return this->m46; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<46>) const { return this->m46; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<47>) { return this->m47; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<47>) const { return this->m47; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<48>) { return this->m48; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<48>) const { return this->m48; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type at_impl(mpl::int_<49>) { return this->m49; } AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(mpl::int_<49>) const { return this->m49; } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector50_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector50_fwd.hpp new file mode 100644 index 000000000..f1c11c4f1 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector50_fwd.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + + template + struct vector41; + template + struct vector42; + template + struct vector43; + template + struct vector44; + template + struct vector45; + template + struct vector46; + template + struct vector47; + template + struct vector48; + template + struct vector49; + template + struct vector50; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector_fwd.hpp new file mode 100644 index 000000000..31dcdf4d0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vector_fwd.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if FUSION_MAX_VECTOR_SIZE <= 10 +#include +#elif FUSION_MAX_VECTOR_SIZE <= 20 +#include +#elif FUSION_MAX_VECTOR_SIZE <= 30 +#include +#elif FUSION_MAX_VECTOR_SIZE <= 40 +#include +#elif FUSION_MAX_VECTOR_SIZE <= 50 +#include +#else +#error "FUSION_MAX_VECTOR_SIZE out of bounds for preprocessed headers" +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector10_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector10_fwd.hpp new file mode 100644 index 000000000..1b28c3e9e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector10_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ + > + struct vector; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector20_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector20_fwd.hpp new file mode 100644 index 000000000..512a0c568 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector20_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ + > + struct vector; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector30_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector30_fwd.hpp new file mode 100644 index 000000000..bd3d05dd9 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector30_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ + > + struct vector; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector40_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector40_fwd.hpp new file mode 100644 index 000000000..e2ddd79fb --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector40_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ + > + struct vector; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector50_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector50_fwd.hpp new file mode 100644 index 000000000..afa866b5b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/preprocessed/vvector50_fwd.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +namespace autoboost { namespace fusion +{ + struct void_; + template < + typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_ , typename T40 = void_ , typename T41 = void_ , typename T42 = void_ , typename T43 = void_ , typename T44 = void_ , typename T45 = void_ , typename T46 = void_ , typename T47 = void_ , typename T48 = void_ , typename T49 = void_ + > + struct vector; +}} diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/prior_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/prior_impl.hpp new file mode 100644 index 000000000..10ee0a987 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/prior_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_PRIOR_IMPL_05042005_1145) +#define FUSION_PRIOR_IMPL_05042005_1145 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_iterator_tag; + template + struct vector_iterator; + + namespace extension + { + template + struct prior_impl; + + template <> + struct prior_impl + { + template + struct apply + { + typedef typename Iterator::vector vector; + typedef typename Iterator::index index; + typedef vector_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(i.vec); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/value_at_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/value_at_impl.hpp new file mode 100644 index 000000000..fb83c1273 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/value_at_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VALUE_AT_IMPL_05052005_0232) +#define FUSION_VALUE_AT_IMPL_05052005_0232 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename mpl::at::type type; + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/value_of_impl.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/value_of_impl.hpp new file mode 100644 index 000000000..e47fe45c5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/value_of_impl.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VALUE_OF_IMPL_05052005_1128) +#define FUSION_VALUE_OF_IMPL_05052005_1128 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename Iterator::vector vector; + typedef typename Iterator::index index; + typedef typename mpl::at< + typename vector::types, index>::type + type; + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/detail/vector_n.hpp b/contrib/autoboost/autoboost/fusion/container/vector/detail/vector_n.hpp new file mode 100644 index 000000000..ed222a610 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/detail/vector_n.hpp @@ -0,0 +1,267 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) +==============================================================================*/ +// No include guard. This file is meant to be included many times + +#if !defined(FUSION_MACRO_05042005) +#define FUSION_MACRO_05042005 + +#define FUSION_VECTOR_CTOR_DEFAULT_INIT(z, n, _) \ + m##n() + +#define FUSION_VECTOR_CTOR_INIT(z, n, _) \ + m##n(_##n) + +#define FUSION_VECTOR_MEMBER_CTOR_INIT(z, n, _) \ + m##n(other.m##n) + +#define FUSION_VECTOR_CTOR_FORWARD(z, n, _) \ + m##n(std::forward(other.m##n)) + +#define FUSION_VECTOR_CTOR_ARG_FWD(z, n, _) \ + m##n(std::forward(_##n)) + +#define FUSION_VECTOR_MEMBER_DECL(z, n, _) \ + T##n m##n; + +#define FUSION_VECTOR_MEMBER_FORWARD(z, n, _) \ + std::forward(_##n) + +#define FUSION_VECTOR_MEMBER_ASSIGN(z, n, _) \ + this->AUTOBOOST_PP_CAT(m, n) = vec.AUTOBOOST_PP_CAT(m, n); + +#define FUSION_VECTOR_MEMBER_DEREF_ASSIGN(z, n, _) \ + this->AUTOBOOST_PP_CAT(m, n) = *AUTOBOOST_PP_CAT(i, n); + +#define FUSION_VECTOR_MEMBER_MOVE(z, n, _) \ + this->AUTOBOOST_PP_CAT(m, n) = std::forward< \ + AUTOBOOST_PP_CAT(T, n)>(vec.AUTOBOOST_PP_CAT(m, n)); + +#define FUSION_VECTOR_MEMBER_AT_IMPL(z, n, _) \ + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type \ + at_impl(mpl::int_) { return this->m##n; } \ + AUTOBOOST_FUSION_GPU_ENABLED typename add_reference::type>::type \ + at_impl(mpl::int_) const { return this->m##n; } + +#define FUSION_VECTOR_MEMBER_ITER_DECL_VAR(z, n, _) \ + typedef typename result_of::next< \ + AUTOBOOST_PP_CAT(I, AUTOBOOST_PP_DEC(n))>::type AUTOBOOST_PP_CAT(I, n); \ + AUTOBOOST_PP_CAT(I, n) AUTOBOOST_PP_CAT(i, n) \ + = fusion::next(AUTOBOOST_PP_CAT(i, AUTOBOOST_PP_DEC(n))); + +#endif + +#define N AUTOBOOST_PP_ITERATION() + + template + struct AUTOBOOST_PP_CAT(vector_data, N) + { + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector_data, N)() + : AUTOBOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_DEFAULT_INIT, _) {} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) +#endif +#if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) || \ + (defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES)) + template + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector_data, N)(AUTOBOOST_PP_ENUM_BINARY_PARAMS(N, U, && _) + , typename autoboost::enable_if >::type* /*dummy*/ = 0 + ) + : AUTOBOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_ARG_FWD, _) {} + AUTOBOOST_PP_CAT(vector_data, N)( + AUTOBOOST_PP_CAT(vector_data, N)&& other) + : AUTOBOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_FORWARD, _) {} +#endif +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH endif +#endif + + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector_data, N)( + AUTOBOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + : AUTOBOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_INIT, _) {} + + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector_data, N)( + AUTOBOOST_PP_CAT(vector_data, N) const& other) + : AUTOBOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_CTOR_INIT, _) {} + + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector_data, N)& + operator=(AUTOBOOST_PP_CAT(vector_data, N) const& vec) + { + AUTOBOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_ASSIGN, _) + return *this; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static AUTOBOOST_PP_CAT(vector_data, N) + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + AUTOBOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _) + return AUTOBOOST_PP_CAT(vector_data, N)(AUTOBOOST_PP_ENUM_PARAMS(N, *i)); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static AUTOBOOST_PP_CAT(vector_data, N) + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + AUTOBOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _) + return AUTOBOOST_PP_CAT(vector_data, N)(AUTOBOOST_PP_ENUM_PARAMS(N, *i)); + } + + AUTOBOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_DECL, _) + }; + + template + struct AUTOBOOST_PP_CAT(vector, N) + : AUTOBOOST_PP_CAT(vector_data, N) + , sequence_base > + { + typedef AUTOBOOST_PP_CAT(vector, N) this_type; + typedef AUTOBOOST_PP_CAT(vector_data, N) base_type; + typedef mpl::AUTOBOOST_PP_CAT(vector, N) types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_ size; + + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)() {} + + AUTOBOOST_FUSION_GPU_ENABLED +#if (N == 1) + explicit +#endif + AUTOBOOST_PP_CAT(vector, N)( + AUTOBOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + : base_type(AUTOBOOST_PP_ENUM_PARAMS(N, _)) {} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) +#endif +#if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) || \ + (defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES)) + template + AUTOBOOST_FUSION_GPU_ENABLED +#if (N == 1) + explicit + AUTOBOOST_PP_CAT(vector, N)(U0&& _0 + , typename autoboost::enable_if >::type* /*dummy*/ = 0 + ) + : base_type(std::forward(_0)) {} +#else + AUTOBOOST_PP_CAT(vector, N)(AUTOBOOST_PP_ENUM_BINARY_PARAMS(N, U, && _)) + : base_type(AUTOBOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FORWARD, _)) {} +#endif + + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)(AUTOBOOST_PP_CAT(vector, N)&& rhs) + : base_type(std::forward(rhs)) {} + + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)(AUTOBOOST_PP_CAT(vector, N) const& rhs) + : base_type(static_cast(rhs)) {} + + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)& + operator=(AUTOBOOST_PP_CAT(vector, N) const& vec) + { + base_type::operator=(vec); + return *this; + } + + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)& + operator=(AUTOBOOST_PP_CAT(vector, N)&& vec) + { + AUTOBOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MOVE, _) + return *this; + } +#endif +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH endif +#endif + + template + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)( + AUTOBOOST_PP_CAT(vector, N) const& vec) + : base_type(AUTOBOOST_PP_ENUM_PARAMS(N, vec.m)) {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)( + Sequence const& seq +#if (N == 1) + , typename autoboost::disable_if >::type* /*dummy*/ = 0 +#endif + ) + : base_type(base_type::init_from_sequence(seq)) {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)( + Sequence& seq +#if (N == 1) + , typename autoboost::disable_if >::type* /*dummy*/ = 0 +#endif + ) + : base_type(base_type::init_from_sequence(seq)) {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + AUTOBOOST_PP_CAT(vector, N)& + operator=(AUTOBOOST_PP_CAT(vector, N) const& vec) + { + AUTOBOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_ASSIGN, _) + return *this; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename autoboost::disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + AUTOBOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _) + AUTOBOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_DEREF_ASSIGN, _) + return *this; + } + + AUTOBOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_AT_IMPL, _) + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type + at_impl(I) + { + return this->at_impl(mpl::int_()); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename add_reference::type>::type>::type + at_impl(I) const + { + return this->at_impl(mpl::int_()); + } + }; + +#undef N diff --git a/contrib/autoboost/autoboost/fusion/container/vector/limits.hpp b/contrib/autoboost/autoboost/fusion/container/vector/limits.hpp new file mode 100644 index 000000000..48116d7a5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/limits.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VECTOR_LIMITS_07072005_1246) +#define FUSION_VECTOR_LIMITS_07072005_1246 + +#include +#include + +#if !defined(FUSION_MAX_VECTOR_SIZE) +# define FUSION_MAX_VECTOR_SIZE 10 +#else +# if FUSION_MAX_VECTOR_SIZE < 3 +# undef FUSION_MAX_VECTOR_SIZE +# define FUSION_MAX_VECTOR_SIZE 10 +# endif +#endif + +#define FUSION_MAX_VECTOR_SIZE_STR AUTOBOOST_PP_STRINGIZE(AUTOBOOST_FUSION_PP_ROUND_UP(FUSION_MAX_VECTOR_SIZE)) + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector10.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector10.hpp new file mode 100644 index 000000000..75a2f2c0c --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector10.hpp @@ -0,0 +1,104 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VECTOR10_05042005_0257) +#define FUSION_VECTOR10_05042005_0257 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + + template + struct vector0 : sequence_base > + { + typedef mpl::vector0<> types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<0> size; + + AUTOBOOST_FUSION_GPU_ENABLED + vector0() {} + + template + AUTOBOOST_FUSION_GPU_ENABLED + vector0(Sequence const& /*seq*/) + {} + }; +}} + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector10.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +#define FUSION_HASH # +// expand vector1 to vector10 +#define AUTOBOOST_PP_FILENAME_1 +#define AUTOBOOST_PP_ITERATION_LIMITS (1, 10) +#include AUTOBOOST_PP_ITERATE() +#undef FUSION_HASH +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector10_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector10_fwd.hpp new file mode 100644 index 000000000..317a2ccfd --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector10_fwd.hpp @@ -0,0 +1,64 @@ +#ifndef AUTOBOOST_PP_IS_ITERATING +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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(AUTOBOOST_FUSION_VECTOR10_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_VECTOR10_FWD_HPP_INCLUDED + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + template + struct vector0; +}} + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector10_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + // expand vector1 to vector10 + #define AUTOBOOST_PP_FILENAME_1 + #define AUTOBOOST_PP_ITERATION_LIMITS (1, 10) + #include AUTOBOOST_PP_ITERATE() +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + +#else + + template + struct AUTOBOOST_PP_CAT(vector, AUTOBOOST_PP_ITERATION()); + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector20.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector20.hpp new file mode 100644 index 000000000..a05994312 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector20.hpp @@ -0,0 +1,80 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VECTOR20_05052005_0205) +#define FUSION_VECTOR20_05052005_0205 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector20.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +#define FUSION_HASH # +// expand vector11 to vector20 +#define AUTOBOOST_PP_FILENAME_1 +#define AUTOBOOST_PP_ITERATION_LIMITS (11, 20) +#include AUTOBOOST_PP_ITERATE() +#undef FUSION_HASH +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector20_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector20_fwd.hpp new file mode 100644 index 000000000..03c32df44 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector20_fwd.hpp @@ -0,0 +1,59 @@ +#ifndef AUTOBOOST_PP_IS_ITERATING +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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(AUTOBOOST_FUSION_VECTOR20_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_VECTOR20_FWD_HPP_INCLUDED + +#include +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector20_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + // expand vector11 to vector20 + #define AUTOBOOST_PP_FILENAME_1 + #define AUTOBOOST_PP_ITERATION_LIMITS (11, 20) + #include AUTOBOOST_PP_ITERATE() +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + +#else + + template + struct AUTOBOOST_PP_CAT(vector, AUTOBOOST_PP_ITERATION()); + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector30.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector30.hpp new file mode 100644 index 000000000..32cfc8aa0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector30.hpp @@ -0,0 +1,79 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VECTOR30_05052005_0206) +#define FUSION_VECTOR30_05052005_0206 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector30.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +#define FUSION_HASH # +// expand vector21 to vector30 +#define AUTOBOOST_PP_FILENAME_1 +#define AUTOBOOST_PP_ITERATION_LIMITS (21, 30) +#include AUTOBOOST_PP_ITERATE() +#undef FUSION_HASH +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector30_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector30_fwd.hpp new file mode 100644 index 000000000..e01b47988 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector30_fwd.hpp @@ -0,0 +1,59 @@ +#ifndef AUTOBOOST_PP_IS_ITERATING +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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(AUTOBOOST_FUSION_VECTOR30_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_VECTOR30_FWD_HPP_INCLUDED + +#include +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector30_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + // expand vector21 to vector30 + #define AUTOBOOST_PP_FILENAME_1 + #define AUTOBOOST_PP_ITERATION_LIMITS (21, 30) + #include AUTOBOOST_PP_ITERATE() +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + +#else + + template + struct AUTOBOOST_PP_CAT(vector, AUTOBOOST_PP_ITERATION()); + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector40.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector40.hpp new file mode 100644 index 000000000..1feb50442 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector40.hpp @@ -0,0 +1,80 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VECTOR40_05052005_0208) +#define FUSION_VECTOR40_05052005_0208 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector40.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +#define FUSION_HASH # +// expand vector31 to vector40 +#define AUTOBOOST_PP_FILENAME_1 +#define AUTOBOOST_PP_ITERATION_LIMITS (31, 40) +#include AUTOBOOST_PP_ITERATE() +#undef FUSION_HASH +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector40_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector40_fwd.hpp new file mode 100644 index 000000000..86b7d9f4a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector40_fwd.hpp @@ -0,0 +1,59 @@ +#ifndef AUTOBOOST_PP_IS_ITERATING +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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(AUTOBOOST_FUSION_VECTOR40_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_VECTOR40_FWD_HPP_INCLUDED + +#include +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector40_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + // expand vector31 to vector40 + #define AUTOBOOST_PP_FILENAME_1 + #define AUTOBOOST_PP_ITERATION_LIMITS (31, 40) + #include AUTOBOOST_PP_ITERATE() +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + +#else + + template + struct AUTOBOOST_PP_CAT(vector, AUTOBOOST_PP_ITERATION()); + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector50.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector50.hpp new file mode 100644 index 000000000..eefcd1ede --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector50.hpp @@ -0,0 +1,79 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VECTOR50_05052005_0207) +#define FUSION_VECTOR50_05052005_0207 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector50.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +#define FUSION_HASH # +// expand vector41 to vector50 +#define AUTOBOOST_PP_FILENAME_1 +#define AUTOBOOST_PP_ITERATION_LIMITS (41, 50) +#include AUTOBOOST_PP_ITERATE() +#undef FUSION_HASH +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector50_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector50_fwd.hpp new file mode 100644 index 000000000..d41df59f6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector50_fwd.hpp @@ -0,0 +1,59 @@ +#ifndef AUTOBOOST_PP_IS_ITERATING +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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(AUTOBOOST_FUSION_VECTOR50_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_VECTOR50_FWD_HPP_INCLUDED + +#include +#include +#include +#include + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vector50_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2011 Eric Niebler + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + // expand vector41 to vector50 + #define AUTOBOOST_PP_FILENAME_1 + #define AUTOBOOST_PP_ITERATION_LIMITS (41, 50) + #include AUTOBOOST_PP_ITERATE() +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif + +#else + + template + struct AUTOBOOST_PP_CAT(vector, AUTOBOOST_PP_ITERATION()); + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector_fwd.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector_fwd.hpp new file mode 100644 index 000000000..d5a546f25 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector_fwd.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Jarvi + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VECTOR_FORWARD_07072005_0125) +#define FUSION_VECTOR_FORWARD_07072005_0125 + +#include +#include +#include + +#include +#if (FUSION_MAX_VECTOR_SIZE > 10) +#include +#endif +#if (FUSION_MAX_VECTOR_SIZE > 20) +#include +#endif +#if (FUSION_MAX_VECTOR_SIZE > 30) +#include +#endif +#if (FUSION_MAX_VECTOR_SIZE > 40) +#include +#endif + +#if !defined(AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/vvector" FUSION_MAX_VECTOR_SIZE_STR "_fwd.hpp") +#endif + +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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) + + This is an auto-generated file. Do not edit! +==============================================================================*/ + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1) +#endif + +namespace autoboost { namespace fusion +{ + struct void_; + + template < + AUTOBOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_VECTOR_SIZE, typename T, void_) + > + struct vector; +}} + +#if defined(__WAVE__) && defined(AUTOBOOST_FUSION_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif // AUTOBOOST_FUSION_DONT_USE_PREPROCESSED_FILES + +#endif diff --git a/contrib/autoboost/autoboost/fusion/container/vector/vector_iterator.hpp b/contrib/autoboost/autoboost/fusion/container/vector/vector_iterator.hpp new file mode 100644 index 000000000..165265e79 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/container/vector/vector_iterator.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VECTOR_ITERATOR_05042005_0635) +#define FUSION_VECTOR_ITERATOR_05042005_0635 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct vector_iterator_tag; + struct random_access_traversal_tag; + + template + struct vector_iterator_identity; + + template + struct vector_iterator : iterator_base > + { + typedef mpl::int_ index; + typedef Vector vector; + typedef vector_iterator_tag fusion_tag; + typedef random_access_traversal_tag category; + typedef vector_iterator_identity< + typename add_const::type, N> identity; + + AUTOBOOST_FUSION_GPU_ENABLED + vector_iterator(Vector& in_vec) + : vec(in_vec) {} + Vector& vec; + + private: + // silence MSVC warning C4512: assignment operator could not be generated + vector_iterator& operator= (vector_iterator const&); + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/include/any.hpp b/contrib/autoboost/autoboost/fusion/include/any.hpp new file mode 100644 index 000000000..c7d40e262 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/any.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_ANY) +#define FUSION_INCLUDE_ANY + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/begin.hpp b/contrib/autoboost/autoboost/fusion/include/begin.hpp new file mode 100644 index 000000000..8014de153 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/begin.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_BEGIN) +#define FUSION_INCLUDE_BEGIN + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/cons.hpp b/contrib/autoboost/autoboost/fusion/include/cons.hpp new file mode 100644 index 000000000..efb9720f2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/cons.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_CONS) +#define FUSION_INCLUDE_CONS + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/end.hpp b/contrib/autoboost/autoboost/fusion/include/end.hpp new file mode 100644 index 000000000..4a3e492f6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/end.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_END) +#define FUSION_INCLUDE_END + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/equal_to.hpp b/contrib/autoboost/autoboost/fusion/include/equal_to.hpp new file mode 100644 index 000000000..c93cf0fad --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/equal_to.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_EQUAL_TO) +#define FUSION_INCLUDE_EQUAL_TO + +#include +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/filter_view.hpp b/contrib/autoboost/autoboost/fusion/include/filter_view.hpp new file mode 100644 index 000000000..7fff6efb7 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/filter_view.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_FILTER_VIEW) +#define FUSION_INCLUDE_FILTER_VIEW + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/find_if.hpp b/contrib/autoboost/autoboost/fusion/include/find_if.hpp new file mode 100644 index 000000000..ba0bd49f9 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/find_if.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_FIND_IF) +#define FUSION_INCLUDE_FIND_IF + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/for_each.hpp b/contrib/autoboost/autoboost/fusion/include/for_each.hpp new file mode 100644 index 000000000..90e661b40 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/for_each.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_FOR_EACH) +#define FUSION_INCLUDE_FOR_EACH + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/mpl.hpp b/contrib/autoboost/autoboost/fusion/include/mpl.hpp new file mode 100644 index 000000000..f37284331 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/mpl.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_MPL) +#define FUSION_INCLUDE_MPL + +#include +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/next.hpp b/contrib/autoboost/autoboost/fusion/include/next.hpp new file mode 100644 index 000000000..4185500d2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/next.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_NEXT) +#define FUSION_INCLUDE_NEXT + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/include/value_of.hpp b/contrib/autoboost/autoboost/fusion/include/value_of.hpp new file mode 100644 index 000000000..3da8fd8b6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/include/value_of.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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(FUSION_INCLUDE_VALUE_OF) +#define FUSION_INCLUDE_VALUE_OF + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/advance.hpp b/contrib/autoboost/autoboost/fusion/iterator/advance.hpp new file mode 100644 index 000000000..3828fd119 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/advance.hpp @@ -0,0 +1,95 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ADVANCE_09172005_1146) +#define FUSION_ADVANCE_09172005_1146 + +#include +#include +#include + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct random_access_traversal_tag; + + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct boost_array_iterator_tag; // autoboost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct advance_impl + { + // default implementation + template + struct apply : + mpl::if_c< + (N::value > 0) + , advance_detail::forward + , advance_detail::backward + >::type + { + AUTOBOOST_MPL_ASSERT_NOT((traits::is_random_access)); + }; + }; + + template <> + struct advance_impl + { + template + struct apply : Iterator::template advance {}; + }; + + template <> + struct advance_impl; + + template <> + struct advance_impl; + + template <> + struct advance_impl; + } + + namespace result_of + { + template + struct advance_c + : extension::advance_impl::type>::template apply > + {}; + + template + struct advance + : extension::advance_impl::type>::template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::advance_c::type const + advance_c(Iterator const& i) + { + return result_of::advance_c::call(i); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::advance::type const + advance(Iterator const& i) + { + return result_of::advance::call(i); + } + +}} // namespace autoboost::fusion + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/deref.hpp b/contrib/autoboost/autoboost/fusion/iterator/deref.hpp new file mode 100644 index 000000000..ef190cba6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/deref.hpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_DEREF_05042005_1019) +#define FUSION_DEREF_05042005_1019 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct boost_array_iterator_tag; // autoboost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct deref_impl + { + template + struct apply {}; + }; + + template <> + struct deref_impl + { + template + struct apply : Iterator::template deref {}; + }; + + template <> + struct deref_impl; + + template <> + struct deref_impl; + + template <> + struct deref_impl; + } + + namespace result_of + { + template + struct deref + : extension::deref_impl::type>:: + template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::deref::type + deref(Iterator const& i) + { + typedef result_of::deref deref_meta; + return deref_meta::call(i); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::deref::type + operator*(iterator_base const& i) + { + return fusion::deref(i.cast()); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/deref_data.hpp b/contrib/autoboost/autoboost/fusion/iterator/deref_data.hpp new file mode 100644 index 000000000..3a6ef00ce --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/deref_data.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_ITERATOR_DEREF_DATA_HPP +#define AUTOBOOST_FUSION_ITERATOR_DEREF_DATA_HPP + +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_facade_tag; + + namespace extension + { + template + struct deref_data_impl; + + template <> + struct deref_data_impl + { + template + struct apply + : It::template deref_data + {}; + }; + } + + namespace result_of + { + template + struct deref_data + : extension::deref_data_impl::type>:: + template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::deref_data::type + deref_data(It const& it) + { + return result_of::deref_data::call(it); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/detail/adapt_deref_traits.hpp b/contrib/autoboost/autoboost/fusion/iterator/detail/adapt_deref_traits.hpp new file mode 100644 index 000000000..ec95d17e6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/detail/adapt_deref_traits.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ADAPT_DEREF_TRAITS_05062005_0900) +#define FUSION_ADAPT_DEREF_TRAITS_05062005_0900 + +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + struct adapt_deref_traits + { + template + struct apply + { + typedef typename + result_of::deref::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return *i.first; + } + }; + }; +}}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/iterator/detail/adapt_value_traits.hpp b/contrib/autoboost/autoboost/fusion/iterator/detail/adapt_value_traits.hpp new file mode 100644 index 000000000..b9948d9e2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/detail/adapt_value_traits.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ADAPT_VALUE_TRAITS_05062005_0859) +#define FUSION_ADAPT_VALUE_TRAITS_05062005_0859 + +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + struct adapt_value_traits + { + template + struct apply + { + typedef typename + result_of::value_of::type + type; + }; + }; +}}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/iterator/detail/advance.hpp b/contrib/autoboost/autoboost/fusion/iterator/detail/advance.hpp new file mode 100644 index 000000000..86afa17f0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/detail/advance.hpp @@ -0,0 +1,107 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ADVANCE_09172005_1149) +#define FUSION_ADVANCE_09172005_1149 + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace advance_detail +{ + // Default advance implementation, perform next(i) + // or prior(i) N times. + + template + struct forward; + + template + struct next_forward + { + typedef typename + forward< + typename result_of::next::type + , N-1 + >::type + type; + }; + + template + struct forward + { + typedef typename + mpl::eval_if_c< + (N == 0) + , mpl::identity + , next_forward + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type const& + call(type const& i) + { + return i; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(I const& i) + { + return call(fusion::next(i)); + } + }; + + template + struct backward; + + template + struct next_backward + { + typedef typename + backward< + typename result_of::prior::type + , N+1 + >::type + type; + }; + + template + struct backward + { + typedef typename + mpl::eval_if_c< + (N == 0) + , mpl::identity + , next_backward + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type const& + call(type const& i) + { + return i; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(I const& i) + { + return call(fusion::prior(i)); + } + }; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/detail/distance.hpp b/contrib/autoboost/autoboost/fusion/iterator/detail/distance.hpp new file mode 100644 index 000000000..6d83c9a14 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/detail/distance.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_DISTANCE_09172005_0730) +#define FUSION_DISTANCE_09172005_0730 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace distance_detail +{ + // Default distance implementation, linear + // search for the Last iterator. + + template + struct linear_distance; + + template + struct next_distance + { + typedef typename + mpl::next< + typename linear_distance< + typename result_of::next::type + , Last + >::type + >::type + type; + }; + + template + struct linear_distance + : mpl::eval_if< + result_of::equal_to + , mpl::identity > + , next_distance + >::type + { + typedef typename + mpl::eval_if< + result_of::equal_to + , mpl::identity > + , next_distance + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(First const&, Last const&) + { + return type(); + } + }; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/detail/segment_sequence.hpp b/contrib/autoboost/autoboost/fusion/iterator/detail/segment_sequence.hpp new file mode 100644 index 000000000..40c91b187 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/detail/segment_sequence.hpp @@ -0,0 +1,73 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_SEQUENCE_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_SEQUENCE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + struct segment_sequence_tag {}; + + // Here, Sequence is a sequence of ranges (which may or may not be + // segmented). + template + struct segment_sequence + : sequence_base > + { + typedef fusion_sequence_tag tag; + typedef segment_sequence_tag fusion_tag; + typedef typename Sequence::is_view is_view; + typedef typename Sequence::category category; + typedef Sequence sequence_type; + sequence_type sequence; + + AUTOBOOST_FUSION_GPU_ENABLED explicit segment_sequence(Sequence const & seq) + : sequence(seq) + {} + }; +} + +namespace extension +{ + template + struct is_segmented_impl; + + template<> + struct is_segmented_impl + { + template + struct apply + : mpl::true_ + {}; + }; + + template + struct segments_impl; + + template<> + struct segments_impl + { + template + struct apply + { + typedef typename Sequence::sequence_type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence & seq) + { + return seq.sequence; + } + }; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_equal_to.hpp b/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_equal_to.hpp new file mode 100644 index 000000000..2ffeecfd3 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_equal_to.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_ITERATOR_EQUAL_TO_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_ITERATOR_EQUAL_TO_HPP_INCLUDED + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct nil_; + + namespace detail + { + template + struct segmented_equal_to + : mpl::and_< + segmented_equal_to< + typename Stack1::cdr_type, + typename Stack2::cdr_type + > + , result_of::equal_to< + typename Stack1::car_type::begin_type, + typename Stack2::car_type::begin_type + > + > + {}; + + template <> + struct segmented_equal_to + : mpl::true_ + {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_iterator.hpp b/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_iterator.hpp new file mode 100644 index 000000000..7f64709ed --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_iterator.hpp @@ -0,0 +1,148 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_ITERATOR_SEGMENTED_ITERATOR_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_ITERATOR_SEGMENTED_ITERATOR_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct nil_; + + namespace detail + { + template + struct segmented_next_impl; + } + + // A segmented iterator wraps a "context", which is a cons list + // of ranges, the frontmost is range over values and the rest + // are ranges over internal segments. + template + struct segmented_iterator + : iterator_facade, forward_traversal_tag> + { + AUTOBOOST_FUSION_GPU_ENABLED explicit segmented_iterator(Context const& ctx) + : context(ctx) + {} + + //auto deref(it) + //{ + // return deref(begin(car(it.context))) + //} + template + struct deref + { + typedef + typename result_of::deref< + typename It::context_type::car_type::begin_type + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(It const& it) + { + return *it.context.car.first; + } + }; + + //auto deref_data(it) + //{ + // return deref_data(begin(car(it.context))) + //} + template + struct deref_data + { + typedef + typename result_of::deref_data< + typename It::context_type::car_type::begin_type + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(It const& it) + { + return fusion::deref_data(it.context.car.first); + } + }; + + //auto key_of(it) + //{ + // return key_of(begin(car(it.context))) + //} + template + struct key_of + : result_of::key_of + {}; + + //auto value_of(it) + //{ + // return value_of(begin(car(it.context))) + //} + template + struct value_of + : result_of::value_of + {}; + + //auto value_of_data(it) + //{ + // return value_of_data(begin(car(it.context))) + //} + template + struct value_of_data + : result_of::value_of_data + {}; + + // Compare all the segment iterators in each stack, starting with + // the bottom-most. + template < + typename It1 + , typename It2 + , int Size1 = It1::context_type::size::value + , int Size2 = It2::context_type::size::value + > + struct equal_to + : mpl::false_ + {}; + + template + struct equal_to + : detail::segmented_equal_to< + typename It1::context_type + , typename It2::context_type + > + {}; + + template + struct next + { + typedef detail::segmented_next_impl impl; + typedef segmented_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(It const& it) + { + return type(impl::call(it.context)); + } + }; + + typedef Context context_type; + context_type context; + }; + +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_next_impl.hpp b/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_next_impl.hpp new file mode 100644 index 000000000..8654548df --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/detail/segmented_next_impl.hpp @@ -0,0 +1,265 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_ITERATOR_NEXT_IMPL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_ITERATOR_NEXT_IMPL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + template + struct iterator_range; + + template + struct segmented_iterator; + + namespace detail + { + template + struct segmented_begin_impl; + + //bool is_invalid(stack) + //{ + // return empty(car(stack)); + //} + + template + struct is_invalid + : result_of::equal_to< + typename Stack::car_type::begin_type, + typename Stack::car_type::end_type + > + {}; + + ////Advance the first iterator in the seq at the + ////top of a stack of iterator ranges. Return the + ////new stack. + //auto pop_front_car(stack) + //{ + // return cons(iterator_range(next(begin(car(stack))), end(car(stack))), cdr(stack)); + //} + + template + struct pop_front_car + { + typedef + iterator_range< + typename result_of::next< + typename Stack::car_type::begin_type + >::type + , typename Stack::car_type::end_type + > + car_type; + + typedef + cons + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return type( + car_type(fusion::next(stack.car.first), stack.car.last), + stack.cdr); + } + }; + + template < + typename Stack, + typename Next = typename pop_front_car::type, + bool IsInvalid = is_invalid::value, + int StackSize = Stack::size::value> + struct segmented_next_impl_recurse; + + // Handle the case where the top of the stack has no usable + //auto segmented_next_impl_recurse3(stack) + //{ + // if (size(stack) == 1) + // return cons(iterator_range(end(car(stack)), end(car(stack))), nil_); + // else + // return segmented_next_impl_recurse(stack.cdr); + //} + + template < + typename Stack, + int StackSize = Stack::size::value> + struct segmented_next_impl_recurse3 + { + typedef segmented_next_impl_recurse impl; + typedef typename impl::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return impl::call(stack.cdr); + } + }; + + template + struct segmented_next_impl_recurse3 + { + typedef typename Stack::car_type::end_type end_type; + typedef iterator_range range_type; + typedef cons type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return type(range_type(stack.car.last, stack.car.last)); + } + }; + + //auto segmented_next_impl_recurse2(stack) + //{ + // auto res = segmented_begin_impl(front(car(stack)), stack); + // if (is_invalid(res)) + // return segmented_next_impl_recurse3(stack); + // else + // return res; + //} + + template < + typename Stack, + typename Sequence = + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type, + typename Result = + typename segmented_begin_impl::type, + bool IsInvalid = + is_invalid::value> + struct segmented_next_impl_recurse2 + { + typedef segmented_next_impl_recurse3 impl; + typedef typename impl::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return impl::call(stack); + } + }; + + template + struct segmented_next_impl_recurse2 + { + typedef Result type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return segmented_begin_impl::call(*stack.car.first, stack); + } + }; + + //auto segmented_next_impl_recurse(stack) + //{ + // auto next = pop_front_car(stack); + // if (is_invalid(next)) + // if (1 == size(stack)) + // return next; + // else + // return segmented_next_impl_recurse(cdr(stack)); + // else + // return segmented_next_impl_recurse2(next) + //} + + template + struct segmented_next_impl_recurse + { + typedef + typename segmented_next_impl_recurse::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const& stack) + { + return segmented_next_impl_recurse::call(stack.cdr); + } + }; + + template + struct segmented_next_impl_recurse + { + typedef Next type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return pop_front_car::call(stack); + } + }; + + template + struct segmented_next_impl_recurse + { + typedef segmented_next_impl_recurse2 impl; + typedef typename impl::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return impl::call(pop_front_car::call(stack)); + } + }; + + //auto segmented_next_impl(stack) + //{ + // // car(stack) is a seq of values, not a seq of segments + // auto next = pop_front_car(stack); + // if (is_invalid(next)) + // return segmented_next_impl_recurse(cdr(next)); + // else + // return next; + //} + + template < + typename Stack, + typename Next = typename pop_front_car::type, + bool IsInvalid = is_invalid::value> + struct segmented_next_impl_aux + { + typedef segmented_next_impl_recurse impl; + typedef typename impl::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return impl::call(stack.cdr); + } + }; + + template + struct segmented_next_impl_aux + { + typedef Next type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const & stack) + { + return pop_front_car::call(stack); + } + }; + + template + struct segmented_next_impl + : segmented_next_impl_aux + {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/distance.hpp b/contrib/autoboost/autoboost/fusion/iterator/distance.hpp new file mode 100644 index 000000000..9de81cd6d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/distance.hpp @@ -0,0 +1,80 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_DISTANCE_09172005_0721) +#define FUSION_DISTANCE_09172005_0721 + +#include +#include +#include + +#include +#include +#include + +#include + +namespace autoboost { namespace fusion +{ + struct random_access_traversal_tag; + + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct boost_array_iterator_tag; // autoboost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct distance_impl + { + // default implementation + template + struct apply : distance_detail::linear_distance + {}; + }; + + template <> + struct distance_impl + { + template + struct apply : First::template distance {}; + }; + + template <> + struct distance_impl; + + template <> + struct distance_impl; + + template <> + struct distance_impl; + } + + namespace result_of + { + template + struct distance + : extension::distance_impl::type>:: + template apply + { + typedef typename extension::distance_impl::type>:: + template apply::type distance_application; + AUTOBOOST_STATIC_CONSTANT(int, value = distance_application::value); + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::distance::type + distance(First const& a, Last const& b) + { + return result_of::distance::call(a,b); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/equal_to.hpp b/contrib/autoboost/autoboost/fusion/iterator/equal_to.hpp new file mode 100644 index 000000000..7c07e526e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/equal_to.hpp @@ -0,0 +1,106 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_EQUAL_TO_05052005_1208) +#define FUSION_EQUAL_TO_05052005_1208 + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct boost_array_iterator_tag; // autoboost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct equal_to_impl + { + // default implementation + template + struct apply + : is_same::type, typename add_const::type> + {}; + }; + + template <> + struct equal_to_impl + { + template + struct dispatch : mpl::false_ {}; + + template + struct dispatch // same tag + : It1::template equal_to + {}; + + template + struct apply : dispatch + {}; + }; + + template <> + struct equal_to_impl; + + template <> + struct equal_to_impl; + + template <> + struct equal_to_impl; + } + + namespace result_of + { + template + struct equal_to + : extension::equal_to_impl::type>:: + template apply + {}; + } + + namespace iterator_operators + { + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + autoboost::enable_if< + mpl::and_, is_fusion_iterator > + , bool + >::type + operator==(Iter1 const&, Iter2 const&) + { + return result_of::equal_to::value; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + autoboost::enable_if< + mpl::and_, is_fusion_iterator > + , bool + >::type + operator!=(Iter1 const&, Iter2 const&) + { + return !result_of::equal_to::value; + } + } + + using iterator_operators::operator==; + using iterator_operators::operator!=; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/iterator/iterator_adapter.hpp b/contrib/autoboost/autoboost/fusion/iterator/iterator_adapter.hpp new file mode 100644 index 000000000..0c545d933 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/iterator_adapter.hpp @@ -0,0 +1,131 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ITERATOR_ADAPTER_08112011_0942) +#define FUSION_ITERATOR_ADAPTER_08112011_0942 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + template + struct iterator_adapter + : iterator_facade + { + typedef typename + remove_const::type + iterator_base_type; + iterator_base_type iterator_base; + + AUTOBOOST_FUSION_GPU_ENABLED + iterator_adapter(iterator_base_type const& iterator_base_) + : iterator_base(iterator_base_) {} + + // default implementation + template + struct equal_to + : result_of::equal_to< + typename I1::iterator_base_type + , typename I2::iterator_base_type + > + {}; + + // default implementation + template + struct advance + { + typedef typename Derived_::template make< + typename result_of::advance< + typename Iterator::iterator_base_type, N + >::type>::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& it) + { + return type(fusion::advance(it.iterator_base)); + } + }; + + // default implementation + template + struct distance + : result_of::distance< + typename First::iterator_base_type + , typename Last::iterator_base_type + > + {}; + + // default implementation + template + struct value_of + : result_of::value_of< + typename Iterator::iterator_base_type + > + {}; + + // default implementation + template + struct deref + { + typedef typename + result_of::deref< + typename Iterator::iterator_base_type + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& it) + { + return fusion::deref(it.iterator_base); + } + }; + + // default implementation + template + struct next + { + typedef typename Derived_::template make< + typename result_of::next< + typename Iterator::iterator_base_type + >::type>::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(fusion::next(i.iterator_base)); + } + }; + + // default implementation + template + struct prior + { + typedef typename Derived_::template make< + typename result_of::prior< + typename Iterator::iterator_base_type + >::type>::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(fusion::prior(i.iterator_base)); + } + }; + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/iterator_facade.hpp b/contrib/autoboost/autoboost/fusion/iterator/iterator_facade.hpp new file mode 100644 index 000000000..ce52b26be --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/iterator_facade.hpp @@ -0,0 +1,58 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ITERATOR_FACADE_09252006_1011) +#define FUSION_ITERATOR_FACADE_09252006_1011 + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_facade_tag; + + template + struct iterator_facade : iterator_base + { + typedef iterator_facade_tag fusion_tag; + typedef Derived derived_type; + typedef Category category; + + // default implementation + template + struct equal_to // default implementation + : is_same< + typename I1::derived_type + , typename I2::derived_type + > + {}; + + // default implementation + template + struct advance : + mpl::if_c< + (N::value > 0) + , advance_detail::forward + , advance_detail::backward + >::type + { + AUTOBOOST_MPL_ASSERT_NOT((traits::is_random_access)); + }; + + // default implementation + template + struct distance : + distance_detail::linear_distance + {}; + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/key_of.hpp b/contrib/autoboost/autoboost/fusion/iterator/key_of.hpp new file mode 100644 index 000000000..a72be8a5f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/key_of.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_ITERATOR_KEY_OF_HPP +#define AUTOBOOST_FUSION_ITERATOR_KEY_OF_HPP + +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_facade_tag; + + namespace extension + { + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + : It::template key_of + {}; + }; + } + + namespace result_of + { + template + struct key_of + : extension::key_of_impl::type>:: + template apply + {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/mpl.hpp b/contrib/autoboost/autoboost/fusion/iterator/mpl.hpp new file mode 100644 index 000000000..ec7c7e1df --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/mpl.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ITERATOR_MPL_10022005_0557) +#define FUSION_ITERATOR_MPL_10022005_0557 + +#include +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/mpl/convert_iterator.hpp b/contrib/autoboost/autoboost/fusion/iterator/mpl/convert_iterator.hpp new file mode 100644 index 000000000..ac146a825 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/mpl/convert_iterator.hpp @@ -0,0 +1,62 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_CONVERT_ITERATOR_05062005_1218) +#define FUSION_CONVERT_ITERATOR_05062005_1218 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + template + struct mpl_iterator; // forward declaration + + // Test T. If it is a fusion iterator, return a reference to it. + // else, assume it is an mpl iterator. + + template + struct convert_iterator + { + typedef typename + mpl::if_< + is_fusion_iterator + , T + , mpl_iterator + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static T const& + call(T const& x, mpl::true_) + { + return x; + } + + AUTOBOOST_FUSION_GPU_ENABLED + static mpl_iterator + call(T const& /*x*/, mpl::false_) + { + return mpl_iterator(); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static typename + mpl::if_< + is_fusion_iterator + , T const& + , mpl_iterator + >::type + call(T const& x) + { + return call(x, is_fusion_iterator()); + } + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/mpl/fusion_iterator.hpp b/contrib/autoboost/autoboost/fusion/iterator/mpl/fusion_iterator.hpp new file mode 100644 index 000000000..f22067acb --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/mpl/fusion_iterator.hpp @@ -0,0 +1,80 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_FUSION_ITERATOR_10012005_1551) +#define FUSION_FUSION_ITERATOR_10012005_1551 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + +template +struct to_mpl_category { + typedef typename mpl::eval_if< + is_base_of, + mpl::random_access_iterator_tag, + mpl::eval_if< + is_base_of, + mpl::bidirectional_iterator_tag, + mpl::forward_iterator_tag + > + >::type type; +}; + +}}} + +namespace autoboost { namespace mpl +{ + template + struct fusion_iterator + { + typedef typename fusion::result_of::value_of::type type; + typedef typename fusion::traits::category_of::type fusion_category; + typedef typename fusion::detail::to_mpl_category::type category; + typedef Iterator iterator; + }; + + template + struct next > + { + typedef fusion_iterator::type> type; + }; + + template + struct prior > + { + typedef fusion_iterator::type> type; + }; + + template + struct advance, N> + { + typedef fusion_iterator::type> type; + }; + + template + struct distance, fusion_iterator > + : fusion::result_of::distance + {}; + +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/iterator/next.hpp b/contrib/autoboost/autoboost/fusion/iterator/next.hpp new file mode 100644 index 000000000..5bbd3ca29 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/next.hpp @@ -0,0 +1,65 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_NEXT_05042005_1101) +#define FUSION_NEXT_05042005_1101 + +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct boost_array_iterator_tag; // autoboost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct next_impl + { + template + struct apply {}; + }; + + template <> + struct next_impl + { + template + struct apply : Iterator::template next {}; + }; + + template <> + struct next_impl; + + template <> + struct next_impl; + + template <> + struct next_impl; + } + + namespace result_of + { + template + struct next + : extension::next_impl::type>:: + template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::next::type const + next(Iterator const& i) + { + return result_of::next::call(i); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/prior.hpp b/contrib/autoboost/autoboost/fusion/iterator/prior.hpp new file mode 100644 index 000000000..960f0beb0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/prior.hpp @@ -0,0 +1,65 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_PRIOR_05042005_1144) +#define FUSION_PRIOR_05042005_1144 + +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct boost_array_iterator_tag; // autoboost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct prior_impl + { + template + struct apply {}; + }; + + template <> + struct prior_impl + { + template + struct apply : Iterator::template prior {}; + }; + + template <> + struct prior_impl; + + template <> + struct prior_impl; + + template <> + struct prior_impl; + } + + namespace result_of + { + template + struct prior + : extension::prior_impl::type>:: + template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::prior::type const + prior(Iterator const& i) + { + return result_of::prior::call(i); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/segmented_iterator.hpp b/contrib/autoboost/autoboost/fusion/iterator/segmented_iterator.hpp new file mode 100644 index 000000000..3a199f9cd --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/segmented_iterator.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_ITERATOR_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_ITERATOR_HPP_INCLUDED + +#include +#include +#include +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/value_of.hpp b/contrib/autoboost/autoboost/fusion/iterator/value_of.hpp new file mode 100644 index 000000000..4c1b5ea75 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/value_of.hpp @@ -0,0 +1,58 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VALUE_OF_05052005_1126) +#define FUSION_VALUE_OF_05052005_1126 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct boost_array_iterator_tag; // autoboost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct value_of_impl + { + template + struct apply {}; + }; + + template <> + struct value_of_impl + { + template + struct apply : Iterator::template value_of {}; + }; + + template <> + struct value_of_impl; + + template <> + struct value_of_impl; + + template <> + struct value_of_impl; + } + + namespace result_of + { + template + struct value_of + : extension::value_of_impl::type>:: + template apply + {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/iterator/value_of_data.hpp b/contrib/autoboost/autoboost/fusion/iterator/value_of_data.hpp new file mode 100644 index 000000000..60b42ed92 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/iterator/value_of_data.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_ITERATOR_VALUE_OF_DATA_HPP +#define AUTOBOOST_FUSION_ITERATOR_VALUE_OF_DATA_HPP + +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_facade_tag; + + namespace extension + { + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + { + template + struct apply + : It::template value_of_data + {}; + }; + } + + namespace result_of + { + template + struct value_of_data + : extension::value_of_data_impl::type>:: + template apply + {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/mpl.hpp b/contrib/autoboost/autoboost/fusion/mpl.hpp new file mode 100644 index 000000000..91d13fdca --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_MPL_09172006_2049) +#define FUSION_MPL_09172006_2049 + +// The fusion <--> MPL link headers +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/mpl/at.hpp b/contrib/autoboost/autoboost/fusion/mpl/at.hpp new file mode 100644 index 000000000..1da3efa0e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/at.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_AT_10022005_1616) +#define FUSION_AT_10022005_1616 + +#include +#include +#include + +namespace autoboost { +namespace fusion +{ + struct fusion_sequence_tag; +} + +namespace mpl +{ + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply : fusion::result_of::value_at {}; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/back.hpp b/contrib/autoboost/autoboost/fusion/mpl/back.hpp new file mode 100644 index 000000000..a284516b5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/back.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_BACK_10022005_1620) +#define FUSION_BACK_10022005_1620 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct back_impl; + + template <> + struct back_impl + { + template + struct apply : + fusion::result_of::value_of< + typename fusion::result_of::prior< + typename fusion::result_of::end::type + >::type> {}; + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/mpl/begin.hpp b/contrib/autoboost/autoboost/fusion/mpl/begin.hpp new file mode 100644 index 000000000..0a00d6d92 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/begin.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_BEGIN_10022005_1620) +#define FUSION_BEGIN_10022005_1620 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef fusion_iterator::type> type; + }; + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/mpl/clear.hpp b/contrib/autoboost/autoboost/fusion/mpl/clear.hpp new file mode 100644 index 000000000..dc9a8eada --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/clear.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_CLEAR_10022005_1817) +#define FUSION_CLEAR_10022005_1817 + +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct clear_impl; + + template <> + struct clear_impl + { + template + struct apply + { + typedef typename + fusion::detail::clear::type>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/detail/clear.hpp b/contrib/autoboost/autoboost/fusion/mpl/detail/clear.hpp new file mode 100644 index 000000000..aa736f3f9 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/detail/clear.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_CLEAR_10022005_1442) +#define FUSION_CLEAR_10022005_1442 + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct cons_tag; + struct map_tag; + struct set_tag; + struct vector_tag; + struct deque_tag; + + namespace detail + { + template + struct clear; + + template <> + struct clear : mpl::identity > {}; + + template <> + struct clear : mpl::identity > {}; + + template <> + struct clear : mpl::identity > {}; + + template <> + struct clear : mpl::identity > {}; + + template <> + struct clear : mpl::identity > {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/mpl/empty.hpp b/contrib/autoboost/autoboost/fusion/mpl/empty.hpp new file mode 100644 index 000000000..c82dca7af --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/empty.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_EMPTY_10022005_1619) +#define FUSION_EMPTY_10022005_1619 + +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct empty_impl; + + template <> + struct empty_impl + { + template + struct apply : fusion::result_of::empty {}; + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/mpl/end.hpp b/contrib/autoboost/autoboost/fusion/mpl/end.hpp new file mode 100644 index 000000000..ef32e342c --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/end.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_END_10022005_1619) +#define FUSION_END_10022005_1619 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef fusion_iterator::type> type; + }; + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/mpl/erase.hpp b/contrib/autoboost/autoboost/fusion/mpl/erase.hpp new file mode 100644 index 000000000..5cf51164d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/erase.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ERASE_10022005_1835) +#define FUSION_ERASE_10022005_1835 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct erase_impl; + + template <> + struct erase_impl + { + template + struct apply + { + typedef typename + fusion::result_of::erase::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/erase_key.hpp b/contrib/autoboost/autoboost/fusion/mpl/erase_key.hpp new file mode 100644 index 000000000..531e2152b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/erase_key.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ERASE_KEY_10022005_1907) +#define FUSION_ERASE_KEY_10022005_1907 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct erase_key_impl; + + template <> + struct erase_key_impl + { + template + struct apply + { + typedef typename + fusion::result_of::erase_key::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/front.hpp b/contrib/autoboost/autoboost/fusion/mpl/front.hpp new file mode 100644 index 000000000..3223c6aff --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/front.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_FRONT_10022005_1618) +#define FUSION_FRONT_10022005_1618 + +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct front_impl; + + template <> + struct front_impl + { + template + struct apply : + fusion::result_of::value_of::type> {}; + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/mpl/has_key.hpp b/contrib/autoboost/autoboost/fusion/mpl/has_key.hpp new file mode 100644 index 000000000..958a97fff --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/has_key.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_HAS_KEY_10022005_1617) +#define FUSION_HAS_KEY_10022005_1617 + +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct has_key_impl; + + template <> + struct has_key_impl + { + template + struct apply : fusion::result_of::has_key {}; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/insert.hpp b/contrib/autoboost/autoboost/fusion/mpl/insert.hpp new file mode 100644 index 000000000..f3a37554c --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/insert.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_INSERT_10022005_1837) +#define FUSION_INSERT_10022005_1837 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct insert_impl; + + template <> + struct insert_impl + { + template + struct apply + { + typedef typename + fusion::result_of::insert::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/insert_range.hpp b/contrib/autoboost/autoboost/fusion/mpl/insert_range.hpp new file mode 100644 index 000000000..7d9d4dcbb --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/insert_range.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_INSERT_RANGE_10022005_1838) +#define FUSION_INSERT_RANGE_10022005_1838 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct insert_range_impl; + + template <> + struct insert_range_impl + { + template + struct apply + { + typedef typename + fusion::result_of::insert_range::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/pop_back.hpp b/contrib/autoboost/autoboost/fusion/mpl/pop_back.hpp new file mode 100644 index 000000000..a01e58330 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/pop_back.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_POP_BACK_10022005_1801) +#define FUSION_POP_BACK_10022005_1801 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct pop_back_impl; + + template <> + struct pop_back_impl + { + template + struct apply + { + typedef typename + fusion::result_of::pop_back::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/pop_front.hpp b/contrib/autoboost/autoboost/fusion/mpl/pop_front.hpp new file mode 100644 index 000000000..914e5e1c0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/pop_front.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_POP_FRONT_10022005_1800) +#define FUSION_POP_FRONT_10022005_1800 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct pop_front_impl; + + template <> + struct pop_front_impl + { + template + struct apply + { + typedef typename + fusion::result_of::pop_front::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/push_back.hpp b/contrib/autoboost/autoboost/fusion/mpl/push_back.hpp new file mode 100644 index 000000000..6e606aee5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/push_back.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_PUSH_BACK_10022005_1647) +#define FUSION_PUSH_BACK_10022005_1647 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct push_back_impl; + + template <> + struct push_back_impl + { + template + struct apply + { + typedef typename + fusion::result_of::push_back::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/push_front.hpp b/contrib/autoboost/autoboost/fusion/mpl/push_front.hpp new file mode 100644 index 000000000..8e7b6a80a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/push_front.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_PUSH_FRONT_10022005_1720) +#define FUSION_PUSH_FRONT_10022005_1720 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct push_front_impl; + + template <> + struct push_front_impl + { + template + struct apply + { + typedef typename + fusion::result_of::push_front::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/mpl/size.hpp b/contrib/autoboost/autoboost/fusion/mpl/size.hpp new file mode 100644 index 000000000..4a9f103a1 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/mpl/size.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_SIZE_10022005_1617) +#define FUSION_SIZE_10022005_1617 + +#include +#include +#include + +namespace autoboost { namespace mpl +{ + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply : fusion::result_of::size {}; + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/comparison/detail/equal_to.hpp b/contrib/autoboost/autoboost/fusion/sequence/comparison/detail/equal_to.hpp new file mode 100644 index 000000000..b6136c958 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/comparison/detail/equal_to.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Jarvi + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_EQUAL_TO_05052005_1142) +#define FUSION_EQUAL_TO_05052005_1142 + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct sequence_equal_to + { + typedef typename result_of::end::type end1_type; + typedef typename result_of::end::type end2_type; + + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool + call(I1 const&, I2 const&, mpl::true_) + { + return true; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool + call(I1 const& a, I2 const& b, mpl::false_) + { + return extension::as_const(*a) == extension::as_const(*b) + && call(fusion::next(a), fusion::next(b)); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool + call(I1 const& a, I2 const& b) + { + typename result_of::equal_to::type eq; + return call(a, b, eq); + } + }; + + template + struct sequence_equal_to + { + template + AUTOBOOST_FUSION_GPU_ENABLED + static bool + call(I1 const& /*a*/, I2 const& /*b*/) + { + return false; + } + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/comparison/enable_comparison.hpp b/contrib/autoboost/autoboost/fusion/sequence/comparison/enable_comparison.hpp new file mode 100644 index 000000000..cdd7a9d9d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/comparison/enable_comparison.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ENABLE_COMPARISON_09232005_1958) +#define FUSION_ENABLE_COMPARISON_09232005_1958 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace traits +{ + template + struct enable_equality + : mpl::or_, traits::is_sequence > + {}; + + template + struct enable_comparison + : mpl::and_< + mpl::or_, traits::is_sequence > + , mpl::equal_to, result_of::size > + > + {}; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/comparison/equal_to.hpp b/contrib/autoboost/autoboost/fusion/sequence/comparison/equal_to.hpp new file mode 100644 index 000000000..9c0c07c6b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/comparison/equal_to.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Jarvi + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_EQUAL_TO_05052005_0431) +#define FUSION_EQUAL_TO_05052005_0431 + +#include +#include +#include +#include +#include +#include +#include + +#if defined (AUTOBOOST_MSVC) +# pragma warning(push) +# pragma warning (disable: 4100) // unreferenced formal parameter +#endif + +namespace autoboost { namespace fusion +{ + template + AUTOBOOST_FUSION_GPU_ENABLED + inline bool + equal_to(Seq1 const& a, Seq2 const& b) + { + return result_of::size::value == result_of::size::value + && detail::sequence_equal_to< + Seq1 const, Seq2 const + , result_of::size::value == result_of::size::value>:: + call(fusion::begin(a), fusion::begin(b)); + } + + namespace operators + { + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + autoboost::enable_if< + traits::enable_equality + , bool + >::type + operator==(Seq1 const& a, Seq2 const& b) + { + return fusion::equal_to(a, b); + } + } + using operators::operator==; +}} + +#if defined (AUTOBOOST_MSVC) +# pragma warning(pop) +#endif + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/convert.hpp b/contrib/autoboost/autoboost/fusion/sequence/convert.hpp new file mode 100644 index 000000000..2241b0a8d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/convert.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_CONVERT_10022005_1442) +#define FUSION_CONVERT_10022005_1442 + +namespace autoboost { namespace fusion +{ + namespace extension + { + template + struct convert_impl; + } + + namespace result_of + { + template + struct convert + { + typedef typename + extension::convert_impl::template apply + gen; + + typedef typename gen::type type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::convert::type + convert(Sequence& seq) + { + typedef typename result_of::convert::gen gen; + return gen::call(seq); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::convert::type + convert(Sequence const& seq) + { + typedef typename result_of::convert::gen gen; + return gen::call(seq); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/begin.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/begin.hpp new file mode 100644 index 000000000..409c4d1fe --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/begin.hpp @@ -0,0 +1,98 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_BEGIN_04052005_1132) +#define FUSION_BEGIN_04052005_1132 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; // iterator facade tag + struct boost_tuple_tag; // autoboost::tuples::tuple tag + struct boost_array_tag; // autoboost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct begin_impl + { + template + struct apply + : mpl::if_< + traits::is_segmented + , detail::segmented_begin + , blank + >::type + {}; + }; + + template <> + struct begin_impl + { + template + struct apply : Sequence::template begin {}; + }; + + template <> + struct begin_impl; + + template <> + struct begin_impl; + + template <> + struct begin_impl; + + template <> + struct begin_impl; + } + + namespace result_of + { + template + struct begin + : extension::begin_impl::type>:: + template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + lazy_enable_if< + traits::is_sequence + , result_of::begin + >::type const + begin(Sequence& seq) + { + return result_of::begin::call(seq); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + lazy_enable_if< + traits::is_sequence + , result_of::begin + >::type const + begin(Sequence const& seq) + { + return result_of::begin::call(seq); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_begin.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_begin.hpp new file mode 100644 index 000000000..60f010750 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_begin.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_BEGIN_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_BEGIN_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + //auto segmented_begin( seq ) + //{ + // return make_segmented_iterator( segmented_begin_impl( seq, nil_ ) ); + //} + + template + struct segmented_begin + { + typedef + segmented_iterator< + typename segmented_begin_impl::type + > + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq) + { + return type( + segmented_begin_impl::call(seq, Nil_())); + } + }; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp new file mode 100644 index 000000000..0ec186f2e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp @@ -0,0 +1,96 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_BEGIN_IMPL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_BEGIN_IMPL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + template + struct iterator_range; +}} + +namespace autoboost { namespace fusion { namespace detail +{ + struct segmented_begin_fun + { + template + struct apply + { + typedef + iterator_range< + typename fusion::result_of::begin::type + , typename fusion::result_of::end::type + > + range_type; + + typedef cons type; + typedef mpl::false_ continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq, State const&, Context const& context, segmented_begin_fun) + { + return type(range_type(fusion::begin(seq), fusion::end(seq)), context); + } + }; + }; + + template ::type::value> + struct segmented_begin_impl_aux + { + typedef + segmented_end_impl + end_impl; + + typedef + segmented_fold_until_impl< + Sequence + , typename end_impl::type + , Stack + , segmented_begin_fun + > + fold_impl; + + typedef typename fold_impl::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq, Stack const& stack) + { + return fold_impl::call(seq, end_impl::call(seq, stack), stack, segmented_begin_fun()); + } + }; + + template + struct segmented_begin_impl_aux + { + typedef typename result_of::begin::type begin_type; + typedef typename result_of::end::type end_type; + typedef iterator_range pair_type; + typedef cons type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq, Stack stack) + { + return type(pair_type(fusion::begin(seq), fusion::end(seq)), stack); + } + }; + + template + struct segmented_begin_impl + : segmented_begin_impl_aux + {}; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_end.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_end.hpp new file mode 100644 index 000000000..f4e2cb33c --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_end.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_END_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_END_HPP_INCLUDED + +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + //auto segmented_end( seq ) + //{ + // return make_segmented_iterator( segmented_end_impl( seq ) ); + //} + + template + struct segmented_end + { + typedef + segmented_iterator< + typename segmented_end_impl::type + > + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence & seq) + { + return type( + segmented_end_impl::call(seq, Nil_())); + } + }; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp new file mode 100644 index 000000000..5f130e1ea --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_END_IMPL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_END_IMPL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + template + struct iterator_range; +}} + +namespace autoboost { namespace fusion { namespace detail +{ + //auto segmented_end_impl( seq, stack ) + //{ + // assert(is_segmented(seq)); + // auto it = end(segments(seq)); + // return cons(iterator_range(it, it), stack); + //} + + template + struct segmented_end_impl + { + AUTOBOOST_MPL_ASSERT((traits::is_segmented)); + + typedef + typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::segments::type + >::type + >::type + >::type + end_type; + + typedef iterator_range pair_type; + typedef cons type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence & seq, Stack stack) + { + end_type end = fusion::end(fusion::segments(seq)); + return type(pair_type(end, end), stack); + } + }; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_size.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_size.hpp new file mode 100644 index 000000000..32e1994f7 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/detail/segmented_size.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_SIZE_08112006_1141) +#define AUTOBOOST_FUSION_SEGMENTED_SIZE_08112006_1141 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + /////////////////////////////////////////////////////////////////////////// + // calculates the size of any segmented data structure. + template + struct segmented_size; + + /////////////////////////////////////////////////////////////////////////// + template::value> + struct segmented_size_impl + : mpl::fold< + typename remove_reference< + typename add_const< + typename result_of::segments::type + >::type + >::type + , mpl::size_t<0> + , mpl::plus > > + >::type + {}; + + template + struct segmented_size_impl + : result_of::size::type + {}; + + template + struct segmented_size + : segmented_size_impl + {}; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/empty.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/empty.hpp new file mode 100644 index 000000000..3158f5f98 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/empty.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_EMPTY_09162005_0335) +#define FUSION_EMPTY_09162005_0335 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct mpl_sequence_tag; // mpl sequence tag + + namespace extension + { + template + struct empty_impl + { + template + struct apply + : mpl::bool_<(result_of::size::value == 0)> + {}; + }; + + template <> + struct empty_impl + { + template + struct apply : Sequence::template empty {}; + }; + + template <> + struct empty_impl; + } + + namespace result_of + { + template + struct empty + : extension::empty_impl::type>:: + template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::empty::type + empty(Sequence const&) + { + typedef typename result_of::empty::type result; + return result(); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/end.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/end.hpp new file mode 100644 index 000000000..8fec928ef --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/end.hpp @@ -0,0 +1,98 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_END_04052005_1141) +#define FUSION_END_04052005_1141 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // autoboost::tuples::tuple tag + struct boost_array_tag; // autoboost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct end_impl + { + template + struct apply + : mpl::if_< + traits::is_segmented + , detail::segmented_end + , blank + >::type + {}; + }; + + template <> + struct end_impl + { + template + struct apply : Sequence::template end {}; + }; + + template <> + struct end_impl; + + template <> + struct end_impl; + + template <> + struct end_impl; + + template <> + struct end_impl; + } + + namespace result_of + { + template + struct end + : extension::end_impl::type>:: + template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + lazy_enable_if< + traits::is_sequence + , result_of::end + >::type const + end(Sequence& seq) + { + return result_of::end::call(seq); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + lazy_enable_if< + traits::is_sequence + , result_of::end + >::type const + end(Sequence const& seq) + { + return result_of::end::call(seq); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/has_key.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/has_key.hpp new file mode 100644 index 000000000..47dccc5ad --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/has_key.hpp @@ -0,0 +1,81 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_HAS_KEY_09232005_1454) +#define FUSION_HAS_KEY_09232005_1454 + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct void_; + + // Special tags: + struct sequence_facade_tag; + struct boost_array_tag; // autoboost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct has_key_impl + { + template + struct apply + : mpl::not_< + typename result_of::equal_to< + typename result_of::find::type + , typename result_of::end::type + >::type + >::type + {}; + }; + + template <> + struct has_key_impl + { + template + struct apply : Sequence::template has_key {}; + }; + + template <> + struct has_key_impl; + + template <> + struct has_key_impl; + + template <> + struct has_key_impl; + } + + namespace result_of + { + template + struct has_key + : extension::has_key_impl::type>:: + template apply + {}; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::has_key::type + has_key(Sequence const&) + { + typedef typename result_of::has_key::type result; + return result(); + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/segments.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/segments.hpp new file mode 100644 index 000000000..ce13d310f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/segments.hpp @@ -0,0 +1,79 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTS_04052005_1141) +#define AUTOBOOST_FUSION_SEGMENTS_04052005_1141 + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct iterator_range_tag; + + // segments: returns a sequence of sequences + namespace extension + { + template + struct segments_impl + { + template + struct apply {}; + }; + + template <> + struct segments_impl + { + template + struct apply : Sequence::template segments {}; + }; + + template <> + struct segments_impl; + } + + namespace result_of + { + template + struct segments + { + typedef typename traits::tag_of::type tag_type; + + typedef typename + extension::segments_impl::template apply::type + type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename + lazy_disable_if< + is_const + , result_of::segments + >::type + segments(Sequence& seq) + { + typedef typename traits::tag_of::type tag_type; + return extension::segments_impl::template apply::call(seq); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::segments::type + segments(Sequence const& seq) + { + typedef typename traits::tag_of::type tag_type; + return extension::segments_impl::template apply::call(seq); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/size.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/size.hpp new file mode 100644 index 000000000..ea76b9616 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/size.hpp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_SIZE_05052005_0214) +#define FUSION_SIZE_05052005_0214 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // autoboost::tuples::tuple tag + struct boost_array_tag; // autoboost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct size_impl + { + template + struct unsegmented_size : Sequence::size {}; + + template + struct apply + : mpl::if_< + traits::is_segmented + , detail::segmented_size + , unsegmented_size + >::type + {}; + }; + + template <> + struct size_impl + { + template + struct apply : Sequence::template size {}; + }; + + template <> + struct size_impl; + + template <> + struct size_impl; + + template <> + struct size_impl; + + template <> + struct size_impl; + } + + namespace result_of + { + template + struct size + : extension::size_impl::type>:: + template apply + + { + typedef typename extension::size_impl::type>:: + template apply::type size_application; + AUTOBOOST_STATIC_CONSTANT(int, value = size_application::value); + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline typename result_of::size::type + size(Sequence const&) + { + typedef typename result_of::size::type result; + return result(); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic/value_at.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/value_at.hpp new file mode 100644 index 000000000..f07274939 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic/value_at.hpp @@ -0,0 +1,69 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VALUE_AT_05052005_0229) +#define FUSION_VALUE_AT_05052005_0229 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // autoboost::tuples::tuple tag + struct boost_array_tag; // autoboost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct value_at_impl + { + template + struct apply; + }; + + template <> + struct value_at_impl + { + template + struct apply : Sequence::template value_at {}; + }; + + template <> + struct value_at_impl; + + template <> + struct value_at_impl; + + template <> + struct value_at_impl; + + template <> + struct value_at_impl; + } + + namespace result_of + { + template + struct value_at + : extension::value_at_impl::type>:: + template apply + {}; + + template + struct value_at_c + : fusion::result_of::value_at > + {}; + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/sequence/intrinsic_fwd.hpp b/contrib/autoboost/autoboost/fusion/sequence/intrinsic_fwd.hpp new file mode 100644 index 000000000..9279788d5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/sequence/intrinsic_fwd.hpp @@ -0,0 +1,223 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(AUTOBOOST_FUSION_SEQUENCE_INTRINSIC_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEQUENCE_INTRINSIC_FWD_HPP_INCLUDED + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + namespace extension + { + template + struct at_impl; + + template + struct begin_impl; + + template + struct empty_impl; + + template + struct end_impl; + + template + struct has_key_impl; + + template + struct segments_impl; + + template + struct size_impl; + + template + struct value_at_impl; + + template + struct at_key_impl; + + template + struct value_at_key_impl; + } + + namespace result_of + { + template + struct at; + + template + struct at_c; + + template + struct back; + + template + struct begin; + + template + struct empty; + + template + struct end; + + template + struct front; + + template + struct has_key; + + template + struct segments; + + template + struct size; + + template + struct value_at; + + template + struct value_at_c; + + template + struct at_key; + + template + struct value_at_key; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_disable_if< + is_const + , result_of::at + >::type + at(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::at::type + at(Sequence const& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_disable_if< + is_const + , result_of::at_c + >::type + at_c(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::at_c::type + at_c(Sequence const& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::back::type + back(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::back::type + back(Sequence const& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_enable_if< + traits::is_sequence + , result_of::begin + >::type const + begin(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_enable_if< + traits::is_sequence + , result_of::begin + >::type const + begin(Sequence const& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::empty::type + empty(Sequence const&); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_enable_if< + traits::is_sequence + , result_of::end + >::type const + end(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_enable_if< + traits::is_sequence + , result_of::end + >::type const + end(Sequence const& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::front::type + front(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::front::type + front(Sequence const& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::has_key::type + has_key(Sequence const& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_disable_if< + is_const + , result_of::segments + >::type + segments(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::segments::type + segments(Sequence const& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::size::type + size(Sequence const&); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_disable_if< + is_const + , result_of::at_key + >::type + at_key(Sequence& seq); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::at_key::type + at_key(Sequence const& seq); +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/as_const.hpp b/contrib/autoboost/autoboost/fusion/support/as_const.hpp new file mode 100644 index 000000000..e184e307b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/as_const.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2012 Nathan Ridge + + 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) +==============================================================================*/ +#ifndef AUTOBOOST_FUSION_SUPPORT_AS_CONST_HPP +#define AUTOBOOST_FUSION_SUPPORT_AS_CONST_HPP + +namespace autoboost { namespace fusion { namespace extension +{ + // A customization point that allows certain wrappers around + // Fusion sequence elements (e.g. adt_attribute_proxy) to be + // unwrapped in contexts where the element only needs to be + // read. The library wraps accesses to Fusion elements in + // such contexts with calls to this function. Users can + // specialize this function for their own wrappers. + template + AUTOBOOST_FUSION_GPU_ENABLED + const T& as_const(const T& obj) + { + return obj; + } + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/category_of.hpp b/contrib/autoboost/autoboost/fusion/support/category_of.hpp new file mode 100644 index 000000000..7b9ef0617 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/category_of.hpp @@ -0,0 +1,113 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_CATEGORY_OF_07202005_0308) +#define FUSION_CATEGORY_OF_07202005_0308 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct boost_tuple_tag; // autoboost::tuples::tuple tag + struct boost_array_tag; // autoboost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + struct incrementable_traversal_tag {}; + + struct single_pass_traversal_tag + : incrementable_traversal_tag {}; + + struct forward_traversal_tag + : single_pass_traversal_tag {}; + + struct bidirectional_traversal_tag + : forward_traversal_tag {}; + + struct random_access_traversal_tag + : bidirectional_traversal_tag {}; + + struct associative_tag {}; + + namespace extension + { + template + struct category_of_impl + { + template + struct apply : detail::fusion_category_of {}; + }; + + template <> + struct category_of_impl; + + template <> + struct category_of_impl; + + template <> + struct category_of_impl; + + template <> + struct category_of_impl; + } + + namespace traits + { + template + struct category_of + : extension::category_of_impl::type>:: + template apply + {}; + + template + struct is_associative + : is_base_of< + associative_tag + , typename category_of::type> + {}; + + template + struct is_incrementable + : is_base_of< + incrementable_traversal_tag + , typename category_of::type> + {}; + + template + struct is_single_pass + : is_base_of< + single_pass_traversal_tag + , typename category_of::type> + {}; + + template + struct is_forward + : is_base_of< + forward_traversal_tag + , typename category_of::type> + {}; + + template + struct is_bidirectional + : is_base_of< + bidirectional_traversal_tag + , typename category_of::type> + {}; + + template + struct is_random_access + : is_base_of< + random_access_traversal_tag + , typename category_of::type> + {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/config.hpp b/contrib/autoboost/autoboost/fusion/support/config.hpp new file mode 100644 index 000000000..18ced388a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/config.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2014 Eric Niebler + + 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(FUSION_SUPPORT_CONFIG_01092014_1718) +#define FUSION_SUPPORT_CONFIG_01092014_1718 + +#include + +#ifndef AUTOBOOST_FUSION_GPU_ENABLED +#define AUTOBOOST_FUSION_GPU_ENABLED AUTOBOOST_GPU_ENABLED +#endif + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/detail/access.hpp b/contrib/autoboost/autoboost/fusion/support/detail/access.hpp new file mode 100644 index 000000000..b5d948c55 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/detail/access.hpp @@ -0,0 +1,65 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ACCESS_04182005_0737) +#define FUSION_ACCESS_04182005_0737 + +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct ref_result + { + typedef typename add_reference::type type; + }; + + template + struct cref_result + { + typedef typename + add_reference< + typename add_const::type + >::type + type; + }; + + template + struct call_param + { + typedef T const& type; + }; + + template + struct call_param + { + typedef T& type; + }; + + template + struct call_param + { + typedef T const& type; + }; + + template + struct call_param + { + typedef T const& type; + }; + + template + struct call_param + { + typedef T const& type; + }; + +}}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/support/detail/as_fusion_element.hpp b/contrib/autoboost/autoboost/fusion/support/detail/as_fusion_element.hpp new file mode 100644 index 000000000..f5ac38da2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/detail/as_fusion_element.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Jarvi + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_AS_FUSION_ELEMENT_05052005_0338) +#define FUSION_AS_FUSION_ELEMENT_05052005_0338 + +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct as_fusion_element + { + typedef T type; + }; + + template + struct as_fusion_element > + { + typedef T& type; + }; + + template + struct as_fusion_element + { + typedef const T(&type)[N]; + }; + + template + struct as_fusion_element + { + typedef const volatile T(&type)[N]; + }; + + template + struct as_fusion_element + { + typedef const volatile T(&type)[N]; + }; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/detail/category_of.hpp b/contrib/autoboost/autoboost/fusion/support/detail/category_of.hpp new file mode 100644 index 000000000..81e886067 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/detail/category_of.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_CATEGORY_OF_07212005_1025) +#define FUSION_CATEGORY_OF_07212005_1025 + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct fusion_category_of + { + typedef typename T::category type; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/detail/is_mpl_sequence.hpp b/contrib/autoboost/autoboost/fusion/support/detail/is_mpl_sequence.hpp new file mode 100644 index 000000000..b134f00ba --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/detail/is_mpl_sequence.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105) +#define FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105 + +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct is_mpl_sequence + : mpl::and_< + mpl::not_ > + , mpl::is_sequence > + {}; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/detail/is_view.hpp b/contrib/autoboost/autoboost/fusion/support/detail/is_view.hpp new file mode 100644 index 000000000..48e4ec75f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/detail/is_view.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_IS_VIEW_03202006_0018) +#define FUSION_IS_VIEW_03202006_0018 + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct fusion_is_view + { + typedef typename T::is_view type; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/detail/mpl_iterator_category.hpp b/contrib/autoboost/autoboost/fusion/support/detail/mpl_iterator_category.hpp new file mode 100644 index 000000000..005b60f4e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/detail/mpl_iterator_category.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_MPL_ITERATOR_CATEGORY_07212005_0923) +#define FUSION_MPL_ITERATOR_CATEGORY_07212005_0923 + +namespace autoboost { namespace mpl +{ + struct forward_iterator_tag; + struct bidirectional_iterator_tag; + struct random_access_iterator_tag; +}} + +namespace autoboost { namespace fusion +{ + struct forward_traversal_tag; + struct bidirectional_traversal_tag; + struct random_access_traversal_tag; +}} + +namespace autoboost { namespace fusion { namespace detail +{ + template + struct mpl_iterator_category; + + template <> + struct mpl_iterator_category + { + typedef forward_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef bidirectional_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef random_access_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef forward_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef bidirectional_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef random_access_traversal_tag type; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/detail/pp_round.hpp b/contrib/autoboost/autoboost/fusion/support/detail/pp_round.hpp new file mode 100644 index 000000000..3b19babca --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/detail/pp_round.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + Copyright (c) 2011 Thomas Heller + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_AUTOBOOST_FUSION_SUPPORT_PP_ROUND_HPP +#define AUTOBOOST_AUTOBOOST_FUSION_SUPPORT_PP_ROUND_HPP + +#include +#include +#include +#include + +#define AUTOBOOST_FUSION_PP_ROUND_UP(N) \ + AUTOBOOST_PP_CAT(AUTOBOOST_FUSION_PP_DO_ROUND_UP_, N)() \ +/**/ + +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_0() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_1() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_2() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_3() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_4() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_5() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_6() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_7() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_8() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_9() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_10() 10 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_11() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_12() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_13() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_14() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_15() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_16() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_17() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_18() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_19() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_20() 20 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_21() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_22() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_23() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_24() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_25() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_26() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_27() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_28() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_29() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_30() 30 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_31() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_32() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_33() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_34() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_35() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_36() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_37() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_38() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_39() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_40() 40 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_41() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_42() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_43() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_44() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_45() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_46() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_47() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_48() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_49() 50 +#define AUTOBOOST_FUSION_PP_DO_ROUND_UP_50() 50 + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/detail/segmented_fold_until_impl.hpp b/contrib/autoboost/autoboost/fusion/support/detail/segmented_fold_until_impl.hpp new file mode 100644 index 000000000..21108c2e7 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/detail/segmented_fold_until_impl.hpp @@ -0,0 +1,401 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_FOLD_UNTIL_IMPL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_FOLD_UNTIL_IMPL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +// fun(seq, state, context) +// seq: a non-segmented range +// state: the state of the fold so far +// context: the path to the current range +// +// returns: (state', fcontinue) + +namespace autoboost { namespace fusion +{ + template + struct iterator_range; + + template + struct segmented_iterator; + + namespace result_of + { + template + struct make_segmented_iterator + { + typedef + iterator_range< + Cur + , typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Context::car_type::begin_type + >::type + >::type + >::type + >::type + > + range_type; + + typedef + segmented_iterator > + type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::make_segmented_iterator::type + make_segmented_iterator(Cur const& cur, Context const& context) + { + typedef result_of::make_segmented_iterator impl_type; + typedef typename impl_type::type type; + typedef typename impl_type::range_type range_type; + return type(cons(range_type(cur, fusion::end(*context.car.first)), context)); + } + + namespace detail + { + template < + typename Begin + , typename End + , typename State + , typename Context + , typename Fun + , bool IsEmpty + > + struct segmented_fold_until_iterate_skip_empty; + + template < + typename Begin + , typename End + , typename State + , typename Context + , typename Fun + , bool IsDone = result_of::equal_to::type::value + > + struct segmented_fold_until_iterate; + + template < + typename Sequence + , typename State + , typename Context + , typename Fun + , bool IsSegmented = traits::is_segmented::type::value + > + struct segmented_fold_until_impl; + + template + struct segmented_fold_until_on_segments; + + //auto push_context(cur, end, context) + //{ + // return push_back(context, segment_sequence(iterator_range(cur, end))); + //} + + template + struct push_context + { + typedef iterator_range range_type; + typedef cons type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Cur const& cur, End const& end, Context const& context) + { + return cons(range_type(cur, end), context); + } + }; + + //auto make_segmented_iterator(cur, end, context) + //{ + // return segmented_iterator(push_context(cur, end, context)); + //} + // + //auto segmented_fold_until_impl(seq, state, context, fun) + //{ + // if (is_segmented(seq)) + // { + // segmented_fold_until_on_segments(segments(seq), state, context, fun); + // } + // else + // { + // return fun(seq, state, context); + // } + //} + + template < + typename Sequence + , typename State + , typename Context + , typename Fun + , bool IsSegmented + > + struct segmented_fold_until_impl + { + typedef + segmented_fold_until_on_segments< + typename remove_reference< + typename add_const< + typename result_of::segments::type + >::type + >::type + , State + , Context + , Fun + > + impl; + + typedef typename impl::type type; + typedef typename impl::continue_type continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun) + { + return impl::call(fusion::segments(seq), state, context, fun); + } + }; + + template < + typename Sequence + , typename State + , typename Context + , typename Fun + > + struct segmented_fold_until_impl + { + typedef + typename Fun::template apply + apply_type; + + typedef typename apply_type::type type; + typedef typename apply_type::continue_type continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun) + { + return apply_type::call(seq, state, context, fun); + } + }; + + //auto segmented_fold_until_on_segments(segs, state, context, fun) + //{ + // auto cur = begin(segs), end = end(segs); + // for (; cur != end; ++cur) + // { + // if (empty(*cur)) + // continue; + // auto context` = push_context(cur, end, context); + // state = segmented_fold_until_impl(*cur, state, context`, fun); + // if (!second(state)) + // return state; + // } + //} + + template + struct continue_wrap + { + typedef typename Apply::continue_type type; + }; + + template + struct segmented_fold_until_iterate_skip_empty + { + // begin != end and !empty(*begin) + typedef + push_context + push_context_impl; + + typedef + typename push_context_impl::type + next_context_type; + + typedef + segmented_fold_until_impl< + typename remove_reference< + typename add_const< + typename result_of::deref::type + >::type + >::type + , State + , next_context_type + , Fun + > + fold_recurse_impl; + + typedef + typename fold_recurse_impl::type + next_state_type; + + typedef + segmented_fold_until_iterate< + typename result_of::next::type + , End + , next_state_type + , Context + , Fun + > + next_iteration_impl; + + typedef + typename mpl::eval_if< + typename fold_recurse_impl::continue_type + , next_iteration_impl + , mpl::identity + >::type + type; + + typedef + typename mpl::eval_if< + typename fold_recurse_impl::continue_type + , continue_wrap + , mpl::identity + >::type + continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun) + { + return call(beg, end, state, context, fun, typename fold_recurse_impl::continue_type()); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun, mpl::true_) // continue + { + return next_iteration_impl::call( + fusion::next(beg) + , end + , fold_recurse_impl::call( + *beg + , state + , push_context_impl::call(beg, end, context) + , fun) + , context + , fun); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun, mpl::false_) // break + { + return fold_recurse_impl::call( + *beg + , state + , push_context_impl::call(beg, end, context) + , fun); + } + }; + + template + struct segmented_fold_until_iterate_skip_empty + { + typedef + segmented_fold_until_iterate< + typename result_of::next::type + , End + , State + , Context + , Fun + > + impl; + + typedef typename impl::type type; + typedef typename impl::continue_type continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun) + { + return impl::call(fusion::next(beg), end, state, context, fun); + } + }; + + template + struct segmented_fold_until_iterate + { + typedef + typename result_of::empty< + typename remove_reference< + typename result_of::deref::type + >::type + >::type + empty_type; + + typedef + segmented_fold_until_iterate_skip_empty + impl; + + typedef typename impl::type type; + typedef typename impl::continue_type continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun) + { + return impl::call(beg, end, state, context, fun); + } + }; + + template + struct segmented_fold_until_iterate + { + typedef State type; + typedef mpl::true_ continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Begin const&, End const&, State const& state + , Context const&, Fun const&) + { + return state; + } + }; + + template + struct segmented_fold_until_on_segments + { + typedef + segmented_fold_until_iterate< + typename result_of::begin::type + , typename result_of::end::type + , State + , Context + , Fun + > + impl; + + typedef typename impl::type type; + typedef typename impl::continue_type continue_type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Segments& segs, State const& state, Context const& context, Fun const& fun) + { + return impl::call(fusion::begin(segs), fusion::end(segs), state, context, fun); + } + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/is_iterator.hpp b/contrib/autoboost/autoboost/fusion/support/is_iterator.hpp new file mode 100644 index 000000000..653177af6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/is_iterator.hpp @@ -0,0 +1,21 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_IS_ITERATOR_05062005_1219) +#define FUSION_IS_ITERATOR_05062005_1219 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_root; + + template + struct is_fusion_iterator : is_base_of {}; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/is_segmented.hpp b/contrib/autoboost/autoboost/fusion/support/is_segmented.hpp new file mode 100644 index 000000000..957e3a4ca --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/is_segmented.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + 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(FUSION_IS_SEGMENTED_03202006_0015) +#define FUSION_IS_SEGMENTED_03202006_0015 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct iterator_range_tag; + + namespace extension + { + template + struct is_segmented_impl + { + template + struct apply + : mpl::false_ + {}; + }; + + template <> + struct is_segmented_impl + { + template + struct apply : Sequence::is_segmented {}; + }; + + template <> + struct is_segmented_impl; + } + + namespace traits + { + template + struct is_segmented + : mpl::bool_< + (bool)extension::is_segmented_impl::type>:: + template apply::type::value + > + { + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/is_sequence.hpp b/contrib/autoboost/autoboost/fusion/support/is_sequence.hpp new file mode 100644 index 000000000..b7969c40d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/is_sequence.hpp @@ -0,0 +1,77 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_IS_SEQUENCE_05052005_1002) +#define FUSION_IS_SEQUENCE_05052005_1002 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct non_fusion_tag; + struct boost_tuple_tag; // autoboost::tuples::tuple tag + struct boost_array_tag; // autoboost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct is_sequence_impl + { + template + struct apply + : is_convertible + {}; + }; + + template <> + struct is_sequence_impl + { + template + struct apply : mpl::false_ {}; + }; + + template <> + struct is_sequence_impl; + + template <> + struct is_sequence_impl; + + template <> + struct is_sequence_impl; + + template <> + struct is_sequence_impl; + } + + namespace traits + { + template + struct is_sequence + : mpl::bool_< + (bool)extension::is_sequence_impl< + typename fusion::detail::tag_of::type + >::template apply::type::value + > + {}; + + template + struct is_native_fusion_sequence + : is_convertible + {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/is_view.hpp b/contrib/autoboost/autoboost/fusion/support/is_view.hpp new file mode 100644 index 000000000..eb0d97e7e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/is_view.hpp @@ -0,0 +1,67 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_IS_VIEW_03202006_0015) +#define FUSION_IS_VIEW_03202006_0015 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // autoboost::tuples::tuple tag + struct boost_array_tag; // autoboost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct is_view_impl + { + template + struct apply + : detail::fusion_is_view + {}; + }; + + template <> + struct is_view_impl + { + template + struct apply : Sequence::is_view {}; + }; + + template <> + struct is_view_impl; + + template <> + struct is_view_impl; + + template <> + struct is_view_impl; + + template <> + struct is_view_impl; + } + + namespace traits + { + template + struct is_view : + mpl::bool_< + (bool)extension::is_view_impl::type>:: + template apply::type::value + > + {}; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/iterator_base.hpp b/contrib/autoboost/autoboost/fusion/support/iterator_base.hpp new file mode 100644 index 000000000..3172800e5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/iterator_base.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ITERATOR_BASE_05042005_1008) +#define FUSION_ITERATOR_BASE_05042005_1008 + +#include + +namespace autoboost { namespace fusion +{ + struct iterator_root {}; + + template + struct iterator_base : iterator_root + { + AUTOBOOST_FUSION_GPU_ENABLED + Iterator const& + cast() const + { + return static_cast(*this); + } + + AUTOBOOST_FUSION_GPU_ENABLED + Iterator& + cast() + { + return static_cast(*this); + } + }; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/segmented_fold_until.hpp b/contrib/autoboost/autoboost/fusion/support/segmented_fold_until.hpp new file mode 100644 index 000000000..436457195 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/segmented_fold_until.hpp @@ -0,0 +1,76 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_FOLD_UNTIL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_FOLD_UNTIL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + //auto segmented_fold_until(seq, state, fun) + //{ + // return first(segmented_fold_until_impl(seq, state, nil_, fun)); + //} + + namespace result_of + { + template + struct segmented_fold_until + { + typedef + detail::segmented_fold_until_impl< + Sequence + , State + , fusion::nil_ + , Fun + > + filter; + + typedef + typename filter::type + type; + }; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_disable_if< + is_const + , result_of::segmented_fold_until + >::type + segmented_fold_until(Sequence& seq, State const& state, Fun const& fun) + { + typedef + typename result_of::segmented_fold_until::filter + filter; + + return filter::call(seq, state, fusion::nil_(), fun); + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename result_of::segmented_fold_until::type + segmented_fold_until(Sequence const& seq, State const& state, Fun const& fun) + { + typedef + typename result_of::segmented_fold_until::filter + filter; + + return filter::call(seq, state, fusion::nil_(), fun); + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/sequence_base.hpp b/contrib/autoboost/autoboost/fusion/support/sequence_base.hpp new file mode 100644 index 000000000..cf1f11098 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/sequence_base.hpp @@ -0,0 +1,58 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2007 Tobias Schwinger + + 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(FUSION_SEQUENCE_BASE_04182005_0737) +#define FUSION_SEQUENCE_BASE_04182005_0737 + +#include +#include + +namespace autoboost { namespace fusion +{ + namespace detail + { + struct from_sequence_convertible_type + {}; + } + + template + struct sequence_base + { + AUTOBOOST_FUSION_GPU_ENABLED + Sequence const& + derived() const + { + return static_cast(*this); + } + + AUTOBOOST_FUSION_GPU_ENABLED + Sequence& + derived() + { + return static_cast(*this); + } + + AUTOBOOST_FUSION_GPU_ENABLED + operator detail::from_sequence_convertible_type()const + { + return detail::from_sequence_convertible_type(); + } + }; + + struct fusion_sequence_tag; +}} + +namespace autoboost { namespace mpl +{ + // Deliberately break mpl::begin, so it doesn't lie that a Fusion sequence + // is not an MPL sequence by returning mpl::void_. + // In other words: Fusion Sequences are always MPL Sequences, but they can + // be incompletely defined. + template<> struct begin_impl< autoboost::fusion::fusion_sequence_tag >; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/tag_of.hpp b/contrib/autoboost/autoboost/fusion/support/tag_of.hpp new file mode 100644 index 000000000..99d138bd7 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/tag_of.hpp @@ -0,0 +1,83 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_TAG_OF_09232005_0845) +#define FUSION_TAG_OF_09232005_0845 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost +{ + template + class array; // forward + + namespace tuples + { + struct null_type; + + template < + class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7, class T8, class T9 + > + class tuple; + + template + struct cons; + } +} + +namespace autoboost { namespace fusion +{ + struct non_fusion_tag; + struct mpl_sequence_tag; + + namespace detail + { + AUTOBOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag) + + template + struct tag_of_impl + : mpl::if_, + mpl::identity, + mpl::identity >::type + {}; + + template + struct tag_of_impl< + Sequence + , typename autoboost::enable_if >::type> + { + typedef typename Sequence::fusion_tag type; + }; + } + + namespace traits + { + template + struct tag_of + : autoboost::fusion::detail::tag_of_impl + {}; + } + + namespace detail + { + template + struct tag_of + : traits::tag_of::type> + {}; + } +}} +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/tag_of_fwd.hpp b/contrib/autoboost/autoboost/fusion/support/tag_of_fwd.hpp new file mode 100644 index 000000000..265cd7721 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/tag_of_fwd.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_TAG_OF_FWD_31122005_1445) +#define AUTOBOOST_FUSION_TAG_OF_FWD_31122005_1445 + +namespace autoboost { namespace fusion +{ + namespace traits + { + template + struct tag_of; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/support/void.hpp b/contrib/autoboost/autoboost/fusion/support/void.hpp new file mode 100644 index 000000000..bd157536b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/support/void.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(AUTOBOOST_FUSION_SUPPORT_VOID_20070706_2125) +#define AUTOBOOST_FUSION_SUPPORT_VOID_20070706_2125 + +namespace autoboost { namespace fusion +{ + struct void_ {}; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view.hpp new file mode 100644 index 000000000..54328d79f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_SEQUENCE_VIEW_FILTER_VIEW_10022005_0608) +#define FUSION_SEQUENCE_VIEW_FILTER_VIEW_10022005_0608 + +#include +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/begin_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/begin_impl.hpp new file mode 100644 index 000000000..d2f6f1268 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/begin_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_BEGIN_IMPL_05062005_0903) +#define FUSION_BEGIN_IMPL_05062005_0903 + +namespace autoboost { namespace fusion +{ + struct filter_view_tag; + + template + struct filter_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::first_type first_type; + typedef typename Sequence::last_type last_type; + typedef typename Sequence::pred_type pred_type; + typedef typename Sequence::category category; + typedef filter_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s) + { + return type(s.first()); + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/deref_data_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/deref_data_impl.hpp new file mode 100644 index 000000000..2df11155b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/deref_data_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP +#define AUTOBOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP + +#include +#include + +namespace autoboost { namespace fusion { namespace extension +{ + template + struct deref_data_impl; + + template <> + struct deref_data_impl + { + template + struct apply + { + typedef typename + result_of::deref_data::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(It const& it) + { + return fusion::deref_data(it.first); + } + }; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/deref_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/deref_impl.hpp new file mode 100644 index 000000000..e9453661e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/deref_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_DEREF_IMPL_05062005_0905) +#define FUSION_DEREF_IMPL_05062005_0905 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + : detail::adapt_deref_traits {}; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/end_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/end_impl.hpp new file mode 100644 index 000000000..5e079d611 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/end_impl.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_END_IMPL_05062005_0906) +#define FUSION_END_IMPL_05062005_0906 + +namespace autoboost { namespace fusion +{ + struct filter_view_tag; + + template + struct filter_iterator; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::last_type last_type; + typedef typename Sequence::pred_type pred_type; + typedef typename Sequence::category category; + typedef filter_iterator type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s) + { + return type(s.last()); + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/equal_to_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/equal_to_impl.hpp new file mode 100644 index 000000000..733ca9bd6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/equal_to_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + 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) +==============================================================================*/ +#if !defined(AUTOBOOST_FUSION_EQUAL_TO_IMPL_02012005_2133) +#define AUTOBOOST_FUSION_EQUAL_TO_IMPL_02012005_2133 + +namespace autoboost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template + struct equal_to; + + template + struct equal_to_impl; + + template<> + struct equal_to_impl + { + template + struct apply + : result_of::equal_to + {}; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/key_of_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/key_of_impl.hpp new file mode 100644 index 000000000..622cd6c27 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/key_of_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP +#define AUTOBOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP + +#include +#include + +namespace autoboost { namespace fusion { namespace extension +{ + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + : result_of::key_of + {}; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/next_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/next_impl.hpp new file mode 100644 index 000000000..f59861a1b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/next_impl.hpp @@ -0,0 +1,79 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_NEXT_IMPL_06052005_0900) +#define FUSION_NEXT_IMPL_06052005_0900 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct filter_view_iterator_tag; + + template + struct filter_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename Iterator::last_type last_type; + typedef typename Iterator::pred_type pred_type; + typedef typename Iterator::category category; + + typedef typename + mpl::eval_if< + result_of::equal_to + , mpl::identity + , result_of::next + >::type + next_type; + + typedef typename + detail::static_find_if< + next_type + , last_type + , mpl::bind1< + typename mpl::lambda::type + , mpl::bind1,mpl::_1> + > + > + filter; + + typedef filter_iterator< + category, typename filter::type, last_type, pred_type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(filter::iter_call(i.first)); + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/size_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/size_impl.hpp new file mode 100644 index 000000000..251a8c8e2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/size_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_SIZE_IMPL_09232005_1058) +#define FUSION_SIZE_IMPL_09232005_1058 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct filter_view_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply + : result_of::distance< + typename result_of::begin::type + , typename result_of::end::type> + {}; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/value_of_data_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/value_of_data_impl.hpp new file mode 100644 index 000000000..e1a5a0fd5 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/value_of_data_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define AUTOBOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP + +#include +#include + +namespace autoboost { namespace fusion { namespace extension +{ + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + { + template + struct apply + : result_of::value_of_data + {}; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/detail/value_of_impl.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/value_of_impl.hpp new file mode 100644 index 000000000..93656bb85 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/detail/value_of_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VALUE_OF_IMPL_05062005_0857) +#define FUSION_VALUE_OF_IMPL_05062005_0857 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + : detail::adapt_value_traits {}; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/filter_view.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/filter_view.hpp new file mode 100644 index 000000000..19fd1ee2e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/filter_view.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_SEQUENCE_FILTER_VIEW_HPP) +#define FUSION_SEQUENCE_FILTER_VIEW_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct filter_view_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template + struct filter_view : sequence_base > + { + typedef filter_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef typename + mpl::eval_if< + traits::is_associative + , mpl::inherit2 + , mpl::identity + >::type + category; + typedef mpl::true_ is_view; + + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + typedef Pred pred_type; + + AUTOBOOST_FUSION_GPU_ENABLED + filter_view(Sequence& in_seq) + : seq(in_seq) + {} + + AUTOBOOST_FUSION_GPU_ENABLED + first_type first() const { return fusion::begin(seq); } + AUTOBOOST_FUSION_GPU_ENABLED + last_type last() const { return fusion::end(seq); } + typename mpl::if_, Sequence, Sequence&>::type seq; + + private: + // silence MSVC warning C4512: assignment operator could not be generated + filter_view& operator= (filter_view const&); + }; +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/filter_view/filter_view_iterator.hpp b/contrib/autoboost/autoboost/fusion/view/filter_view/filter_view_iterator.hpp new file mode 100644 index 000000000..87f2743c6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/filter_view/filter_view_iterator.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_FILTER_VIEW_ITERATOR_05062005_0849) +#define FUSION_FILTER_VIEW_ITERATOR_05062005_0849 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct filter_view_iterator_tag; + struct forward_traversal_tag; + + template + struct filter_iterator : iterator_base > + { + typedef convert_iterator first_converter; + typedef typename first_converter::type first_iter; + typedef convert_iterator last_converter; + typedef typename last_converter::type last_iter; + + typedef filter_view_iterator_tag fusion_tag; + typedef Category category; + typedef + detail::static_find_if< + first_iter + , last_iter + , mpl::bind1< + typename mpl::lambda::type + , mpl::bind1,mpl::_1> + > + > + filter; + typedef typename filter::type first_type; + typedef last_iter last_type; + typedef Pred pred_type; + + AUTOBOOST_FUSION_GPU_ENABLED + filter_iterator(First const& in_first) + : first(filter::iter_call(first_converter::call(in_first))) {} + + first_type first; + + private: + // silence MSVC warning C4512: assignment operator could not be generated + filter_iterator& operator= (filter_iterator const&); + }; +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range.hpp new file mode 100644 index 000000000..7922d1be6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_SEQUENCE_VIEW_ITERATOR_RANGE_10022005_0610) +#define FUSION_SEQUENCE_VIEW_ITERATOR_RANGE_10022005_0610 + +#include +#include + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/at_impl.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/at_impl.hpp new file mode 100644 index 000000000..88becfc44 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/at_impl.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + 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(AUTOBOOST_FUSION_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef typename Seq::begin_type begin_type; + typedef typename result_of::advance::type pos; + typedef typename result_of::deref::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Seq& s) + { + return * fusion::advance(s.first); + } + }; + }; + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/begin_impl.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/begin_impl.hpp new file mode 100644 index 000000000..795722a50 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/begin_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_BEGIN_IMPL_05062005_1226) +#define FUSION_BEGIN_IMPL_05062005_1226 + +namespace autoboost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::begin_type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s) + { + return s.first; + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/end_impl.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/end_impl.hpp new file mode 100644 index 000000000..842d06448 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/end_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_END_IMPL_05062005_1226) +#define FUSION_END_IMPL_05062005_1226 + +namespace autoboost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::end_type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s) + { + return s.last; + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/is_segmented_impl.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/is_segmented_impl.hpp new file mode 100644 index 000000000..24d1b7179 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/is_segmented_impl.hpp @@ -0,0 +1,67 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_ITERATOR_RANGE_IS_SEGMENTED_HPP_INCLUDED) +#define AUTOBOOST_FUSION_ITERATOR_RANGE_IS_SEGMENTED_HPP_INCLUDED + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_range_tag; + + template + struct segmented_iterator; + + namespace extension + { + template + struct is_segmented_impl; + + // An iterator_range of segmented_iterators is segmented + template <> + struct is_segmented_impl + { + private: + template + struct is_segmented_iterator + : mpl::false_ + {}; + + template + struct is_segmented_iterator + : is_segmented_iterator + {}; + + template + struct is_segmented_iterator + : is_segmented_iterator + {}; + + template + struct is_segmented_iterator > + : mpl::true_ + {}; + + public: + template + struct apply + : is_segmented_iterator + { + AUTOBOOST_MPL_ASSERT_RELATION( + is_segmented_iterator::value + , == + , is_segmented_iterator::value); + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp new file mode 100644 index 000000000..fac66f90f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp @@ -0,0 +1,545 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SEGMENTED_ITERATOR_RANGE_HPP_INCLUDED) +#define AUTOBOOST_FUSION_SEGMENTED_ITERATOR_RANGE_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Invariants: +// - Each segmented iterator has a stack +// - Each value in the stack is an iterator range +// - The range at the top of the stack points to values +// - All other ranges point to ranges +// - The front of each range in the stack (besides the +// topmost) is the range above it + +namespace autoboost { namespace fusion +{ + template + struct iterator_range; + + namespace result_of + { + template + struct push_back; + + template + struct push_front; + } + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_enable_if< + traits::is_sequence + , result_of::push_back + >::type + push_back(Sequence const& seq, T const& x); + + template + AUTOBOOST_FUSION_GPU_ENABLED + typename + lazy_enable_if< + traits::is_sequence + , result_of::push_front + >::type + push_front(Sequence const& seq, T const& x); +}} + +namespace autoboost { namespace fusion { namespace detail +{ + //auto make_segment_sequence_front(stack_begin) + //{ + // switch (size(stack_begin)) + // { + // case 1: + // return nil_; + // case 2: + // // car(cdr(stack_begin)) is a range over values. + // assert(end(front(car(stack_begin))) == end(car(cdr(stack_begin)))); + // return iterator_range(begin(car(cdr(stack_begin))), end(front(car(stack_begin)))); + // default: + // // car(cdr(stack_begin)) is a range over segments. We replace the + // // front with a view that is restricted. + // assert(end(segments(front(car(stack_begin)))) == end(car(cdr(stack_begin)))); + // return segment_sequence( + // push_front( + // // The following could be a segment_sequence. It then gets wrapped + // // in a single_view, and push_front puts it in a join_view with the + // // following iterator_range. + // iterator_range(next(begin(car(cdr(stack_begin)))), end(segments(front(car(stack_begin))))), + // make_segment_sequence_front(cdr(stack_begin)))); + // } + //} + + template + struct make_segment_sequence_front + { + // assert(end(segments(front(car(stack_begin)))) == end(car(cdr(stack_begin)))); + AUTOBOOST_MPL_ASSERT(( + result_of::equal_to< + typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::segments< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type + >::type + >::type + >::type + >::type + , typename Stack::cdr_type::car_type::end_type + >)); + + typedef + iterator_range< + typename result_of::next< + typename Stack::cdr_type::car_type::begin_type + >::type + , typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::segments< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type + >::type + >::type + >::type + >::type + > + rest_type; + + typedef + make_segment_sequence_front + recurse; + + typedef + segment_sequence< + typename result_of::push_front< + rest_type const + , typename recurse::type + >::type + > + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const& stack) + { + //return segment_sequence( + // push_front( + // iterator_range(next(begin(car(cdr(stack_begin)))), end(segments(front(car(stack_begin))))), + // make_segment_sequence_front(cdr(stack_begin)))); + return type( + fusion::push_front( + rest_type(fusion::next(stack.cdr.car.first), fusion::end(fusion::segments(*stack.car.first))) + , recurse::call(stack.cdr))); + } + }; + + template + struct make_segment_sequence_front + { + // assert(end(front(car(stack_begin))) == end(car(cdr(stack_begin)))); + AUTOBOOST_MPL_ASSERT(( + result_of::equal_to< + typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type + >::type + , typename Stack::cdr_type::car_type::end_type + >)); + + typedef + iterator_range< + typename Stack::cdr_type::car_type::begin_type + , typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type + >::type + > + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const& stack) + { + // return iterator_range(begin(car(cdr(stack_begin))), end(front(car(stack_begin)))); + return type(stack.cdr.car.first, fusion::end(*stack.car.first)); + } + }; + + template + struct make_segment_sequence_front + { + typedef typename Stack::cdr_type type; // nil_ + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const &stack) + { + return stack.cdr; + } + }; + + //auto make_segment_sequence_back(stack_end) + //{ + // switch (size(stack_end)) + // { + // case 1: + // return nil_; + // case 2: + // // car(cdr(stack_back)) is a range over values. + // assert(end(front(car(stack_end))) == end(car(cdr(stack_end)))); + // return iterator_range(begin(front(car(stack_end))), begin(car(cdr(stack_end)))); + // default: + // // car(cdr(stack_begin)) is a range over segments. We replace the + // // back with a view that is restricted. + // assert(end(segments(front(car(stack_end)))) == end(car(cdr(stack_end)))); + // return segment_sequence( + // push_back( + // iterator_range(begin(segments(front(car(stack_end)))), begin(car(cdr(stack_end)))), + // make_segment_sequence_back(cdr(stack_end)))); + // } + //} + + template + struct make_segment_sequence_back + { + // assert(end(segments(front(car(stack_begin)))) == end(car(cdr(stack_begin)))); + AUTOBOOST_MPL_ASSERT(( + result_of::equal_to< + typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::segments< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type + >::type + >::type + >::type + >::type + , typename Stack::cdr_type::car_type::end_type + >)); + + typedef + iterator_range< + typename result_of::begin< + typename remove_reference< + typename add_const< + typename result_of::segments< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type + >::type + >::type + >::type + >::type + , typename Stack::cdr_type::car_type::begin_type + > + rest_type; + + typedef + make_segment_sequence_back + recurse; + + typedef + segment_sequence< + typename result_of::push_back< + rest_type const + , typename recurse::type + >::type + > + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const& stack) + { + // return segment_sequence( + // push_back( + // iterator_range(begin(segments(front(car(stack_end)))), begin(car(cdr(stack_end)))), + // make_segment_sequence_back(cdr(stack_end)))); + return type( + fusion::push_back( + rest_type(fusion::begin(fusion::segments(*stack.car.first)), stack.cdr.car.first) + , recurse::call(stack.cdr))); + } + }; + + template + struct make_segment_sequence_back + { + // assert(end(front(car(stack_end))) == end(car(cdr(stack_end)))); + AUTOBOOST_MPL_ASSERT(( + result_of::equal_to< + typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type + >::type + , typename Stack::cdr_type::car_type::end_type + >)); + + typedef + iterator_range< + typename result_of::begin< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Stack::car_type::begin_type + >::type + >::type + >::type + >::type + , typename Stack::cdr_type::car_type::begin_type + > + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const& stack) + { + // return iterator_range(begin(front(car(stack_end))), begin(car(cdr(stack_end)))); + return type(fusion::begin(*stack.car.first), stack.cdr.car.first); + } + }; + + template + struct make_segment_sequence_back + { + typedef typename Stack::cdr_type type; // nil_ + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Stack const& stack) + { + return stack.cdr; + } + }; + + //auto make_segmented_range_reduce(stack_begin, stack_end) + //{ + // if (size(stack_begin) == 1 && size(stack_end) == 1) + // { + // return segment_sequence( + // single_view( + // iterator_range(begin(car(stack_begin)), begin(car(stack_end))))); + // } + // else + // { + // // We are in the case where both begin_stack and/or end_stack have + // // more than one element. Throw away any part of the tree where + // // begin and end refer to the same segment. + // if (begin(car(stack_begin)) == begin(car(stack_end))) + // { + // return make_segmented_range_reduce(cdr(stack_begin), cdr(stack_end)); + // } + // else + // { + // // We are in the case where begin_stack and end_stack (a) have + // // more than one element each, and (b) they point to different + // // segments. We must construct a segmented sequence. + // return segment_sequence( + // push_back( + // push_front( + // iterator_range( + // fusion::next(begin(car(stack_begin))), + // begin(car(stack_end))), // a range of (possibly segmented) ranges. + // make_segment_sequence_front(stack_begin)), // should be a (possibly segmented) range. + // make_segment_sequence_back(stack_end))); // should be a (possibly segmented) range. + // } + // } + //} + + template < + typename StackBegin + , typename StackEnd + , int StackBeginSize = StackBegin::size::value + , int StackEndSize = StackEnd::size::value> + struct make_segmented_range_reduce; + + template < + typename StackBegin + , typename StackEnd + , bool SameSegment = + result_of::equal_to< + typename StackBegin::car_type::begin_type + , typename StackEnd::car_type::begin_type + >::type::value> + struct make_segmented_range_reduce2 + { + typedef + iterator_range< + typename result_of::next< + typename StackBegin::car_type::begin_type + >::type + , typename StackEnd::car_type::begin_type + > + rest_type; + + typedef + segment_sequence< + typename result_of::push_back< + typename result_of::push_front< + rest_type const + , typename make_segment_sequence_front::type + >::type const + , typename make_segment_sequence_back::type + >::type + > + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(StackBegin stack_begin, StackEnd stack_end) + { + //return segment_sequence( + // push_back( + // push_front( + // iterator_range( + // fusion::next(begin(car(stack_begin))), + // begin(car(stack_end))), // a range of (possibly segmented) ranges. + // make_segment_sequence_front(stack_begin)), // should be a (possibly segmented) range. + // make_segment_sequence_back(stack_end))); // should be a (possibly segmented) range. + return type( + fusion::push_back( + fusion::push_front( + rest_type(fusion::next(stack_begin.car.first), stack_end.car.first) + , make_segment_sequence_front::call(stack_begin)) + , make_segment_sequence_back::call(stack_end))); + } + }; + + template + struct make_segmented_range_reduce2 + { + typedef + make_segmented_range_reduce< + typename StackBegin::cdr_type + , typename StackEnd::cdr_type + > + impl; + + typedef + typename impl::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(StackBegin stack_begin, StackEnd stack_end) + { + return impl::call(stack_begin.cdr, stack_end.cdr); + } + }; + + template + struct make_segmented_range_reduce + : make_segmented_range_reduce2 + {}; + + template + struct make_segmented_range_reduce + { + typedef + iterator_range< + typename StackBegin::car_type::begin_type + , typename StackEnd::car_type::begin_type + > + range_type; + + typedef + single_view + segment_type; + + typedef + segment_sequence + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(StackBegin stack_begin, StackEnd stack_end) + { + //return segment_sequence( + // single_view( + // iterator_range(begin(car(stack_begin)), begin(car(stack_end))))); + return type(segment_type(range_type(stack_begin.car.first, stack_end.car.first))); + } + }; + + //auto make_segmented_range(begin, end) + //{ + // return make_segmented_range_reduce(reverse(begin.context), reverse(end.context)); + //} + + template + struct make_segmented_range + { + typedef reverse_cons reverse_begin_cons; + typedef reverse_cons reverse_end_cons; + + typedef + make_segmented_range_reduce< + typename reverse_begin_cons::type + , typename reverse_end_cons::type + > + impl; + + typedef typename impl::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Begin const& begin, End const& end) + { + return impl::call( + reverse_begin_cons::call(begin.context) + , reverse_end_cons::call(end.context)); + } + }; + +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/segments_impl.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/segments_impl.hpp new file mode 100644 index 000000000..84c4a7327 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/segments_impl.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED) +#define AUTOBOOST_FUSION_ITERATOR_RANGE_SEGMENTS_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct segments_impl; + + template <> + struct segments_impl + { + template + struct apply + { + typedef + detail::make_segmented_range< + typename Sequence::begin_type + , typename Sequence::end_type + > + impl; + + AUTOBOOST_MPL_ASSERT((traits::is_segmented)); + + typedef + typename result_of::segments::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type call(Sequence & seq) + { + return fusion::segments(impl::call(seq.first, seq.last)); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/size_impl.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/size_impl.hpp new file mode 100644 index 000000000..72805925d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/size_impl.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_ITERATOR_RANGE_SIZE_IMPL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_ITERATOR_RANGE_SIZE_IMPL_HPP_INCLUDED + +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply + : result_of::distance< + typename Seq::begin_type, + typename Seq::end_type + > + {}; + }; + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/value_at_impl.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/value_at_impl.hpp new file mode 100644 index 000000000..b2ac706a2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/detail/value_at_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + 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(AUTOBOOST_FUSION_ITERATOR_RANGE_VALUE_AT_IMPL_HPP_INCLUDED) +#define AUTOBOOST_FUSION_ITERATOR_RANGE_VALUE_AT_IMPL_HPP_INCLUDED + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename Seq::begin_type begin_type; + typedef typename result_of::advance::type pos; + typedef typename result_of::value_of::type type; + }; + }; + } +}} + +#endif + diff --git a/contrib/autoboost/autoboost/fusion/view/iterator_range/iterator_range.hpp b/contrib/autoboost/autoboost/fusion/view/iterator_range/iterator_range.hpp new file mode 100644 index 000000000..1086a99e0 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/iterator_range/iterator_range.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_ITERATOR_RANGE_05062005_1224) +#define FUSION_ITERATOR_RANGE_05062005_1224 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined (AUTOBOOST_MSVC) +# pragma warning(push) +# pragma warning (disable: 4512) // assignment operator could not be generated. +#endif + +namespace autoboost { namespace fusion +{ + struct iterator_range_tag; + struct fusion_sequence_tag; + + template + struct iterator_range : sequence_base > + { + typedef typename convert_iterator::type begin_type; + typedef typename convert_iterator::type end_type; + typedef iterator_range_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + + typedef typename traits::category_of::type category; + + AUTOBOOST_FUSION_GPU_ENABLED + iterator_range(First const& in_first, Last const& in_last) + : first(convert_iterator::call(in_first)) + , last(convert_iterator::call(in_last)) {} + + begin_type first; + end_type last; + }; +}} + +#if defined (AUTOBOOST_MSVC) +# pragma warning(pop) +#endif + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/detail/begin_impl.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/begin_impl.hpp new file mode 100644 index 000000000..12fffa010 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/begin_impl.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_BEGIN_IMPL_07162005_0115) +#define FUSION_BEGIN_IMPL_07162005_0115 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct joint_view_tag; + + template + struct joint_view_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::first_type first_type; + typedef typename Sequence::last_type last_type; + typedef typename Sequence::concat_type concat_type; + typedef typename Sequence::category category; + typedef result_of::equal_to equal_to; + + typedef typename + mpl::if_< + equal_to + , concat_type + , joint_view_iterator + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s, mpl::true_) + { + return s.concat(); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s, mpl::false_) + { + return type(s.first(), s.concat()); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s) + { + return call(s, equal_to()); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/detail/deref_data_impl.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/deref_data_impl.hpp new file mode 100644 index 000000000..761289763 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/deref_data_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_DEREF_DATA_IMPL_HPP +#define AUTOBOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_DEREF_DATA_IMPL_HPP + +#include +#include + +namespace autoboost { namespace fusion { namespace extension +{ + template + struct deref_data_impl; + + template <> + struct deref_data_impl + { + template + struct apply + { + typedef typename + result_of::deref_data::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(It const& it) + { + return fusion::deref_data(it.first); + } + }; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/detail/deref_impl.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/deref_impl.hpp new file mode 100644 index 000000000..05a8e948f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/deref_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_DEREF_IMPL_07162005_0137) +#define FUSION_DEREF_IMPL_07162005_0137 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct joint_view_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + : detail::adapt_deref_traits {}; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/detail/end_impl.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/end_impl.hpp new file mode 100644 index 000000000..5f0b12d04 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/end_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_END_IMPL_07162005_0128) +#define FUSION_END_IMPL_07162005_0128 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct joint_view_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::concat_last_type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& s) + { + return s.concat_last(); + } + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/detail/key_of_impl.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/key_of_impl.hpp new file mode 100644 index 000000000..7181717f2 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/key_of_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_KEY_OF_IMPL_HPP +#define AUTOBOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_KEY_OF_IMPL_HPP + +#include +#include + +namespace autoboost { namespace fusion { namespace extension +{ + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + : result_of::key_of + {}; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/detail/next_impl.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/next_impl.hpp new file mode 100644 index 000000000..e29e8425b --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/next_impl.hpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_NEXT_IMPL_07162005_0136) +#define FUSION_NEXT_IMPL_07162005_0136 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct joint_view_iterator_tag; + + template + struct joint_view_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename Iterator::last_type last_type; + typedef typename Iterator::concat_type concat_type; + typedef typename Iterator::category category; + typedef typename result_of::next::type next_type; + typedef result_of::equal_to equal_to; + + typedef typename + mpl::if_< + equal_to + , concat_type + , joint_view_iterator + >::type + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i, mpl::true_) + { + return i.concat; + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i, mpl::false_) + { + return type(fusion::next(i.first), i.concat); + } + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return call(i, equal_to()); + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/detail/value_of_data_impl.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/value_of_data_impl.hpp new file mode 100644 index 000000000..52707e063 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/value_of_data_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + 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) +==============================================================================*/ + +#ifndef AUTOBOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define AUTOBOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP + +#include +#include + +namespace autoboost { namespace fusion { namespace extension +{ + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + { + template + struct apply + : result_of::value_of_data + {}; + }; +}}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/detail/value_of_impl.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/value_of_impl.hpp new file mode 100644 index 000000000..81fadc782 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/detail/value_of_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_VALUE_IMPL_07162005_0132) +#define FUSION_VALUE_IMPL_07162005_0132 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct joint_view_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + : detail::adapt_value_traits {}; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view.hpp new file mode 100644 index 000000000..bcb2fa3b6 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view.hpp @@ -0,0 +1,83 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_JOINT_VIEW_07162005_0140) +#define FUSION_JOINT_VIEW_07162005_0140 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct joint_view_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template + struct joint_view : sequence_base > + { + typedef joint_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef typename + mpl::eval_if< + mpl::and_< + traits::is_associative + , traits::is_associative + > + , mpl::inherit2 + , mpl::identity + >::type + category; + typedef mpl::true_ is_view; + + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + typedef typename result_of::begin::type concat_type; + typedef typename result_of::end::type concat_last_type; + typedef typename mpl::int_< + result_of::size::value + result_of::size::value> + size; + + AUTOBOOST_FUSION_GPU_ENABLED + joint_view(Sequence1& in_seq1, Sequence2& in_seq2) + : seq1(in_seq1) + , seq2(in_seq2) + {} + + AUTOBOOST_FUSION_GPU_ENABLED + first_type first() const { return fusion::begin(seq1); } + AUTOBOOST_FUSION_GPU_ENABLED + concat_type concat() const { return fusion::begin(seq2); } + AUTOBOOST_FUSION_GPU_ENABLED + concat_last_type concat_last() const { return fusion::end(seq2); } + + private: + // silence MSVC warning C4512: assignment operator could not be generated + joint_view& operator= (joint_view const&); + + typename mpl::if_, Sequence1, Sequence1&>::type seq1; + typename mpl::if_, Sequence2, Sequence2&>::type seq2; + }; +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view_fwd.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view_fwd.hpp new file mode 100644 index 000000000..cb5cbed42 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view_fwd.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_JOINT_VIEW_FWD_HPP_INCLUDED) +#define AUTOBOOST_FUSION_JOINT_VIEW_FWD_HPP_INCLUDED + +namespace autoboost { namespace fusion +{ + struct joint_view_tag; + + template + struct joint_view; +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view_iterator.hpp b/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view_iterator.hpp new file mode 100644 index 000000000..47fe3cb19 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/joint_view/joint_view_iterator.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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(FUSION_JOINT_VIEW_ITERATOR_07162005_0140) +#define FUSION_JOINT_VIEW_ITERATOR_07162005_0140 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct joint_view_iterator_tag; + struct forward_traversal_tag; + + template + struct joint_view_iterator + : iterator_base > + { + typedef convert_iterator first_converter; + typedef convert_iterator last_converter; + typedef convert_iterator concat_converter; + + typedef typename first_converter::type first_type; + typedef typename last_converter::type last_type; + typedef typename concat_converter::type concat_type; + + typedef joint_view_iterator_tag fusion_tag; + typedef Category category; + AUTOBOOST_STATIC_ASSERT((!result_of::equal_to::value)); + + AUTOBOOST_FUSION_GPU_ENABLED + joint_view_iterator(First const& in_first, Concat const& in_concat) + : first(first_converter::call(in_first)) + , concat(concat_converter::call(in_concat)) + {} + + first_type first; + concat_type concat; + + private: + // silence MSVC warning C4512: assignment operator could not be generated + joint_view_iterator& operator= (joint_view_iterator const&); + }; +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/advance_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/advance_impl.hpp new file mode 100644 index 000000000..aeeb6d62a --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/advance_impl.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_ADVANCE_IMPL_JUL_07_2011_1348PM) +#define AUTOBOOST_FUSION_SINGLE_VIEW_ADVANCE_IMPL_JUL_07_2011_1348PM + +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_iterator_tag; + + template + struct single_view_iterator; + + namespace extension + { + template + struct advance_impl; + + template<> + struct advance_impl + { + template + struct apply + { + typedef single_view_iterator< + typename Iterator::single_view_type, + typename mpl::plus::type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(i.view); + } + }; + }; + } + +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/at_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/at_impl.hpp new file mode 100644 index 000000000..a1a230ccd --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/at_impl.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_AT_IMPL_JUL_07_2011_1348PM) +#define AUTOBOOST_FUSION_SINGLE_VIEW_AT_IMPL_JUL_07_2011_1348PM + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_tag; + + namespace extension + { + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply + { + AUTOBOOST_MPL_ASSERT((mpl::equal_to >)); + typedef typename Sequence::value_type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& seq) + { + return seq.val; + } + }; + }; + } + +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/begin_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/begin_impl.hpp new file mode 100644 index 000000000..a4842f162 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/begin_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_BEGIN_IMPL_05052005_0305) +#define AUTOBOOST_FUSION_SINGLE_VIEW_BEGIN_IMPL_05052005_0305 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_tag; + + template + struct single_view_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef single_view_iterator > type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& seq) + { + return type(seq); + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/deref_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/deref_impl.hpp new file mode 100644 index 000000000..6687bf892 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/deref_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_DEREF_IMPL_05052005_0258) +#define AUTOBOOST_FUSION_SINGLE_VIEW_DEREF_IMPL_05052005_0258 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + AUTOBOOST_MPL_ASSERT((mpl::equal_to >)); + typedef typename Iterator::value_type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return i.view.val; + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/distance_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/distance_impl.hpp new file mode 100644 index 000000000..5b0834cce --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/distance_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_DISTANCE_IMPL_JUL_07_2011_1348PM) +#define AUTOBOOST_FUSION_SINGLE_VIEW_DISTANCE_IMPL_JUL_07_2011_1348PM + +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_iterator_tag; + + namespace extension + { + template + struct distance_impl; + + template<> + struct distance_impl + { + template + struct apply + : mpl::minus + { + typedef typename mpl::minus::type type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(First const& /*first*/, Last const& /*last*/) + { + return type(); + } + }; + }; + } + +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/end_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/end_impl.hpp new file mode 100644 index 000000000..3c1b748a9 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/end_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_END_IMPL_05052005_0332) +#define AUTOBOOST_FUSION_SINGLE_VIEW_END_IMPL_05052005_0332 + +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_tag; + + template + struct single_view_iterator; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef single_view_iterator > type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Sequence& seq) + { + return type(seq); + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/equal_to_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/equal_to_impl.hpp new file mode 100644 index 000000000..c8c50eb65 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/equal_to_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_ITERATOR_JUL_07_2011_1348PM) +#define AUTOBOOST_FUSION_SINGLE_VIEW_ITERATOR_JUL_07_2011_1348PM + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_iterator_tag; + + namespace extension + { + template + struct equal_to_impl; + + template<> + struct equal_to_impl + { + template + struct apply + : mpl::equal_to + { + AUTOBOOST_MPL_ASSERT((is_same::type, + typename add_const::type>)); + }; + }; + } +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/next_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/next_impl.hpp new file mode 100644 index 000000000..c140b547d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/next_impl.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_NEXT_IMPL_05052005_0331) +#define AUTOBOOST_FUSION_SINGLE_VIEW_NEXT_IMPL_05052005_0331 + +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_iterator_tag; + + template + struct single_view_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef single_view_iterator< + typename Iterator::single_view_type, + typename mpl::next::type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + AUTOBOOST_STATIC_ASSERT((type::position::value < 2)); + return type(i.view); + } + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/prior_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/prior_impl.hpp new file mode 100644 index 000000000..161da1bf4 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/prior_impl.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_PRIOR_IMPL_JUL_07_2011_1348PM) +#define AUTOBOOST_FUSION_SINGLE_VIEW_PRIOR_IMPL_JUL_07_2011_1348PM + +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_iterator_tag; + + template + struct single_view_iterator; + + namespace extension + { + template + struct prior_impl; + + template <> + struct prior_impl + { + template + struct apply + { + typedef single_view_iterator< + typename Iterator::single_view_type, + typename mpl::prior::type> + type; + + AUTOBOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return type(i.view); + } + }; + }; + } + +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/size_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/size_impl.hpp new file mode 100644 index 000000000..2ba40d32e --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/size_impl.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(FUSION_SINGLE_VIEW_SIZE_IMPL_JUL_07_2011_1348PM) +#define FUSION_SINGLE_VIEW_SIZE_IMPL_JUL_07_2011_1348PM + +namespace autoboost { namespace fusion +{ + struct single_view_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply + { + typedef mpl::int_<1> type; + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/value_at_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/value_at_impl.hpp new file mode 100644 index 000000000..ccac6738f --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/value_at_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_VALUE_AT_IMPL_JUL_07_2011_1348PM) +#define AUTOBOOST_FUSION_SINGLE_VIEW_VALUE_AT_IMPL_JUL_07_2011_1348PM + +#include +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_tag; + + namespace extension + { + template + struct value_at_impl; + + template<> + struct value_at_impl + { + template + struct apply + { + AUTOBOOST_MPL_ASSERT((mpl::equal_to >)); + typedef typename Sequence::value_type type; + }; + }; + } + +}} + +#endif diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/detail/value_of_impl.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/detail/value_of_impl.hpp new file mode 100644 index 000000000..5eef51e2d --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/detail/value_of_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_VALUE_OF_IMPL_05052005_0324) +#define AUTOBOOST_FUSION_SINGLE_VIEW_VALUE_OF_IMPL_05052005_0324 + +#include +#include +#include +#include + +namespace autoboost { namespace fusion +{ + struct single_view_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + AUTOBOOST_MPL_ASSERT((mpl::equal_to >)); + typedef typename Iterator::value_type type; + }; + }; + } +}} + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/single_view.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/single_view.hpp new file mode 100644 index 000000000..2ff26a640 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/single_view.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_05052005_0335) +#define AUTOBOOST_FUSION_SINGLE_VIEW_05052005_0335 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined (AUTOBOOST_MSVC) +# pragma warning(push) +# pragma warning (disable: 4512) // assignment operator could not be generated. +#endif + +namespace autoboost { namespace fusion +{ + struct single_view_tag; + struct random_access_traversal_tag; + struct fusion_sequence_tag; + + template + struct single_view : sequence_base > + { + typedef single_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef random_access_traversal_tag category; + typedef mpl::true_ is_view; + typedef mpl::int_<1> size; + typedef T value_type; + + AUTOBOOST_FUSION_GPU_ENABLED + single_view() + : val() {} + + AUTOBOOST_FUSION_GPU_ENABLED explicit single_view(typename detail::call_param::type in_val) + : val(in_val) {} + + value_type val; + }; + + template + AUTOBOOST_FUSION_GPU_ENABLED + inline single_view::type> + make_single_view(T const& v) + { + return single_view::type>(v); + } +}} + +#if defined (AUTOBOOST_MSVC) +# pragma warning(pop) +#endif + +#endif + + diff --git a/contrib/autoboost/autoboost/fusion/view/single_view/single_view_iterator.hpp b/contrib/autoboost/autoboost/fusion/view/single_view/single_view_iterator.hpp new file mode 100644 index 000000000..78666fa74 --- /dev/null +++ b/contrib/autoboost/autoboost/fusion/view/single_view/single_view_iterator.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2011 Eric Niebler + + 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(AUTOBOOST_FUSION_SINGLE_VIEW_ITERATOR_05052005_0340) +#define AUTOBOOST_FUSION_SINGLE_VIEW_ITERATOR_05052005_0340 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined (AUTOBOOST_MSVC) +# pragma warning(push) +# pragma warning (disable: 4512) // assignment operator could not be generated. +#endif + +namespace autoboost { namespace fusion +{ + struct single_view_iterator_tag; + struct random_access_traversal_tag; + + template + struct single_view_iterator + : iterator_base > + { + typedef single_view_iterator_tag fusion_tag; + typedef random_access_traversal_tag category; + typedef typename SingleView::value_type value_type; + typedef Pos position; + typedef SingleView single_view_type; + + AUTOBOOST_FUSION_GPU_ENABLED explicit single_view_iterator(single_view_type& in_view) + : view(in_view) {} + + SingleView& view; + + private: + single_view_iterator& operator=(single_view_iterator const&); + }; +}} + +#if defined (AUTOBOOST_MSVC) +# pragma warning(pop) +#endif + +#endif + + diff --git a/contrib/autoboost/autoboost/generator_iterator.hpp b/contrib/autoboost/autoboost/generator_iterator.hpp new file mode 100644 index 000000000..c0113373e --- /dev/null +++ b/contrib/autoboost/autoboost/generator_iterator.hpp @@ -0,0 +1,85 @@ +// (C) Copyright Jens Maurer 2001. +// 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) +// +// Revision History: + +// 15 Nov 2001 Jens Maurer +// created. + +// See http://www.boost.org/libs/utility/iterator_adaptors.htm for documentation. + +#ifndef AUTOBOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP +#define AUTOBOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP + +#include +#include + +namespace autoboost { +namespace iterators { + +template +class generator_iterator + : public iterator_facade< + generator_iterator + , typename Generator::result_type + , single_pass_traversal_tag + , typename Generator::result_type const& + > +{ + typedef iterator_facade< + generator_iterator + , typename Generator::result_type + , single_pass_traversal_tag + , typename Generator::result_type const& + > super_t; + + public: + generator_iterator() {} + generator_iterator(Generator* g) : m_g(g), m_value((*m_g)()) {} + + void increment() + { + m_value = (*m_g)(); + } + + const typename Generator::result_type& + dereference() const + { + return m_value; + } + + bool equal(generator_iterator const& y) const + { + return this->m_g == y.m_g && this->m_value == y.m_value; + } + + private: + Generator* m_g; + typename Generator::result_type m_value; +}; + +template +struct generator_iterator_generator +{ + typedef generator_iterator type; +}; + +template +inline generator_iterator +make_generator_iterator(Generator & gen) +{ + typedef generator_iterator result_t; + return result_t(&gen); +} + +} // namespace iterators + +using iterators::generator_iterator; +using iterators::generator_iterator_generator; +using iterators::make_generator_iterator; + +} // namespace autoboost + +#endif // AUTOBOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP diff --git a/contrib/autoboost/boost/get_pointer.hpp b/contrib/autoboost/autoboost/get_pointer.hpp similarity index 81% rename from contrib/autoboost/boost/get_pointer.hpp rename to contrib/autoboost/autoboost/get_pointer.hpp index 2c15d1ecb..0b98f3ad7 100644 --- a/contrib/autoboost/boost/get_pointer.hpp +++ b/contrib/autoboost/autoboost/get_pointer.hpp @@ -2,16 +2,16 @@ // 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) -#ifndef GET_POINTER_DWA20021219_HPP -#define GET_POINTER_DWA20021219_HPP +#ifndef AB_GET_POINTER_DWA20021219_HPP +#define AB_GET_POINTER_DWA20021219_HPP -#include +#include // In order to avoid circular dependencies with Boost.TR1 // we make sure that our include of doesn't try to // pull in the TR1 headers: that's why we use this header // rather than including directly: -#include // std::auto_ptr +#include // std::auto_ptr namespace autoboost { @@ -29,7 +29,7 @@ template T * get_pointer(std::auto_ptr const& p) return p.get(); } -#if !defined( BOOST_NO_CXX11_SMART_PTR ) +#if !defined( AUTOBOOST_NO_CXX11_SMART_PTR ) template T * get_pointer( std::unique_ptr const& p ) { diff --git a/contrib/autoboost/autoboost/indirect_reference.hpp b/contrib/autoboost/autoboost/indirect_reference.hpp new file mode 100644 index 000000000..fa597eb8a --- /dev/null +++ b/contrib/autoboost/autoboost/indirect_reference.hpp @@ -0,0 +1,43 @@ +#ifndef AB_INDIRECT_REFERENCE_DWA200415_HPP +# define AB_INDIRECT_REFERENCE_DWA200415_HPP + +// +// Copyright David Abrahams 2004. Use, modification and distribution is +// subject to 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) +// +// typename indirect_reference

::type provides the type of *p. +// +// http://www.boost.org/libs/iterator/doc/pointee.html +// + +# include +# include +# include +# include +# include + +namespace autoboost { + +namespace detail +{ + template + struct smart_ptr_reference + { + typedef typename autoboost::pointee

::type& type; + }; +} + +template +struct indirect_reference + : mpl::eval_if< + detail::is_incrementable

+ , iterator_reference

+ , detail::smart_ptr_reference

+ > +{ +}; + +} // namespace autoboost + +#endif // INDIRECT_REFERENCE_DWA200415_HPP diff --git a/contrib/autoboost/boost/integer.hpp b/contrib/autoboost/autoboost/integer.hpp similarity index 85% rename from contrib/autoboost/boost/integer.hpp rename to contrib/autoboost/autoboost/integer.hpp index 8a54f84de..a6d469f94 100644 --- a/contrib/autoboost/boost/integer.hpp +++ b/contrib/autoboost/autoboost/integer.hpp @@ -8,19 +8,19 @@ // Revision History // 22 Sep 01 Added value-based integer templates. (Daryle Walker) -// 01 Apr 01 Modified to use new header. (John Maddock) +// 01 Apr 01 Modified to use new header. (John Maddock) // 30 Jul 00 Add typename syntax fix (Jens Maurer) // 28 Aug 99 Initial version -#ifndef BOOST_INTEGER_HPP -#define BOOST_INTEGER_HPP +#ifndef AUTOBOOST_INTEGER_HPP +#define AUTOBOOST_INTEGER_HPP -#include // self include +#include // self include -#include // for autoboost::::autoboost::integer_traits -#include // for ::std::numeric_limits -#include // for autoboost::int64_t and BOOST_NO_INTEGRAL_INT64_T -#include +#include // for autoboost::::autoboost::integer_traits +#include // for ::std::numeric_limits +#include // for autoboost::int64_t and AUTOBOOST_NO_INTEGRAL_INT64_T +#include // // We simply cannot include this header on gcc without getting copious warnings of the kind: @@ -57,18 +57,18 @@ namespace autoboost // specializatons: 1=long, 2=int, 3=short, 4=signed char, // 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char // no specializations for 0 and 5: requests for a type > long are in error -#ifdef BOOST_HAS_LONG_LONG +#ifdef AUTOBOOST_HAS_LONG_LONG template<> struct int_least_helper<1> { typedef autoboost::long_long_type least; }; -#elif defined(BOOST_HAS_MS_INT64) +#elif defined(AUTOBOOST_HAS_MS_INT64) template<> struct int_least_helper<1> { typedef __int64 least; }; #endif template<> struct int_least_helper<2> { typedef long least; }; template<> struct int_least_helper<3> { typedef int least; }; template<> struct int_least_helper<4> { typedef short least; }; template<> struct int_least_helper<5> { typedef signed char least; }; -#ifdef BOOST_HAS_LONG_LONG +#ifdef AUTOBOOST_HAS_LONG_LONG template<> struct uint_least_helper<1> { typedef autoboost::ulong_long_type least; }; -#elif defined(BOOST_HAS_MS_INT64) +#elif defined(AUTOBOOST_HAS_MS_INT64) template<> struct uint_least_helper<1> { typedef unsigned __int64 least; }; #endif template<> struct uint_least_helper<2> { typedef unsigned long least; }; @@ -95,7 +95,7 @@ namespace autoboost template <> struct exact_signed_base_helper { typedef long exact; }; template <> struct exact_unsigned_base_helper { typedef unsigned long exact; }; #endif -#if defined(BOOST_HAS_LONG_LONG) &&\ +#if defined(AUTOBOOST_HAS_LONG_LONG) &&\ ((defined(ULLONG_MAX) && (ULLONG_MAX != ULONG_MAX)) ||\ (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX != ULONG_MAX)) ||\ (defined(ULONGLONG_MAX) && (ULONGLONG_MAX != ULONG_MAX)) ||\ @@ -113,11 +113,11 @@ namespace autoboost template< int Bits > // bits (including sign) required struct int_t : public detail::exact_signed_base_helper { - BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(autoboost::intmax_t) * CHAR_BIT), + AUTOBOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(autoboost::intmax_t) * CHAR_BIT), "No suitable signed integer type with the requested number of bits is available."); typedef typename detail::int_least_helper < -#ifdef BOOST_HAS_LONG_LONG +#ifdef AUTOBOOST_HAS_LONG_LONG (Bits <= (int)(sizeof(autoboost::long_long_type) * CHAR_BIT)) + #else 1 + @@ -134,11 +134,11 @@ namespace autoboost template< int Bits > // bits required struct uint_t : public detail::exact_unsigned_base_helper { - BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(autoboost::uintmax_t) * CHAR_BIT), + AUTOBOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(autoboost::uintmax_t) * CHAR_BIT), "No suitable unsigned integer type with the requested number of bits is available."); -#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T) +#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(AUTOBOOST_NO_INTEGRAL_INT64_T) // It's really not clear why this workaround should be needed... shrug I guess! JM - BOOST_STATIC_CONSTANT(int, s = + AUTOBOOST_STATIC_CONSTANT(int, s = 6 + (Bits <= ::std::numeric_limits::digits) + (Bits <= ::std::numeric_limits::digits) + @@ -148,7 +148,7 @@ namespace autoboost #else typedef typename detail::uint_least_helper < -#ifdef BOOST_HAS_LONG_LONG +#ifdef AUTOBOOST_HAS_LONG_LONG (Bits <= (int)(sizeof(autoboost::long_long_type) * CHAR_BIT)) + #else 1 + @@ -166,7 +166,7 @@ namespace autoboost // integer templates specifying extreme value ----------------------------// // signed -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) template< autoboost::long_long_type MaxValue > // maximum value to require support #else template< long MaxValue > // maximum value to require support @@ -175,7 +175,7 @@ namespace autoboost { typedef typename detail::int_least_helper < -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) (MaxValue <= ::autoboost::integer_traits::const_max) + #else 1 + @@ -188,7 +188,7 @@ namespace autoboost typedef typename int_fast_t::type fast; }; -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) template< autoboost::long_long_type MinValue > // minimum value to require support #else template< long MinValue > // minimum value to require support @@ -197,7 +197,7 @@ namespace autoboost { typedef typename detail::int_least_helper < -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) (MinValue >= ::autoboost::integer_traits::const_min) + #else 1 + @@ -211,7 +211,7 @@ namespace autoboost }; // unsigned -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) template< autoboost::ulong_long_type MaxValue > // minimum value to require support #else template< unsigned long MaxValue > // minimum value to require support @@ -220,16 +220,16 @@ namespace autoboost { #if (defined(__BORLANDC__) || defined(__CODEGEAR__)) // It's really not clear why this workaround should be needed... shrug I guess! JM -#if defined(BOOST_NO_INTEGRAL_INT64_T) - BOOST_STATIC_CONSTANT(unsigned, which = +#if defined(AUTOBOOST_NO_INTEGRAL_INT64_T) + AUTOBOOST_STATIC_CONSTANT(unsigned, which = 1 + (MaxValue <= ::autoboost::integer_traits::const_max) + (MaxValue <= ::autoboost::integer_traits::const_max) + (MaxValue <= ::autoboost::integer_traits::const_max) + (MaxValue <= ::autoboost::integer_traits::const_max)); typedef typename detail::int_least_helper< ::autoboost::uint_value_t::which>::least least; -#else // BOOST_NO_INTEGRAL_INT64_T - BOOST_STATIC_CONSTANT(unsigned, which = +#else // AUTOBOOST_NO_INTEGRAL_INT64_T + AUTOBOOST_STATIC_CONSTANT(unsigned, which = 1 + (MaxValue <= ::autoboost::integer_traits::const_max) + (MaxValue <= ::autoboost::integer_traits::const_max) + @@ -237,11 +237,11 @@ namespace autoboost (MaxValue <= ::autoboost::integer_traits::const_max) + (MaxValue <= ::autoboost::integer_traits::const_max)); typedef typename detail::uint_least_helper< ::autoboost::uint_value_t::which>::least least; -#endif // BOOST_NO_INTEGRAL_INT64_T +#endif // AUTOBOOST_NO_INTEGRAL_INT64_T #else typedef typename detail::uint_least_helper < -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) (MaxValue <= ::autoboost::integer_traits::const_max) + #else 1 + @@ -258,4 +258,4 @@ namespace autoboost } // namespace autoboost -#endif // BOOST_INTEGER_HPP +#endif // AUTOBOOST_INTEGER_HPP diff --git a/contrib/autoboost/autoboost/integer/integer_log2.hpp b/contrib/autoboost/autoboost/integer/integer_log2.hpp new file mode 100644 index 000000000..fbc6539f9 --- /dev/null +++ b/contrib/autoboost/autoboost/integer/integer_log2.hpp @@ -0,0 +1,112 @@ +// ----------------------------------------------------------- +// integer_log2.hpp +// +// Gives the integer part of the logarithm, in base 2, of a +// given number. Behavior is undefined if the argument is <= 0. +// +// Copyright (c) 2003-2004, 2008 Gennaro Prota +// +// 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) +// +// ----------------------------------------------------------- + +#ifndef AUTOBOOST_INTEGER_INTEGER_LOG2_HPP +#define AUTOBOOST_INTEGER_INTEGER_LOG2_HPP + +#include +#ifdef __BORLANDC__ +#include +#endif +#include +#include + + +namespace autoboost { + namespace detail { + + template + int integer_log2_impl(T x, int n) { + + int result = 0; + + while (x != 1) { + + const T t = static_cast(x >> n); + if (t) { + result += n; + x = t; + } + n /= 2; + + } + + return result; + } + + + + // helper to find the maximum power of two + // less than p (more involved than necessary, + // to avoid PTS) + // + template + struct max_pow2_less { + + enum { c = 2*n < p }; + + AUTOBOOST_STATIC_CONSTANT(int, value = + c ? (max_pow2_less< c*p, 2*c*n>::value) : n); + + }; + + template <> + struct max_pow2_less<0, 0> { + + AUTOBOOST_STATIC_CONSTANT(int, value = 0); + }; + + // this template is here just for Borland :( + // we could simply rely on numeric_limits but sometimes + // Borland tries to use numeric_limits, because + // of its usual const-related problems in argument deduction + // - gps + template + struct width { + +#ifdef __BORLANDC__ + AUTOBOOST_STATIC_CONSTANT(int, value = sizeof(T) * CHAR_BIT); +#else + AUTOBOOST_STATIC_CONSTANT(int, value = (std::numeric_limits::digits)); +#endif + + }; + + } // detail + + + // --------- + // integer_log2 + // --------------- + // + template + int integer_log2(T x) { + + assert(x > 0); + + const int n = detail::max_pow2_less< + detail::width :: value, 4 + > :: value; + + return detail::integer_log2_impl(x, n); + + } + + + +} + + + +#endif // include guard diff --git a/contrib/autoboost/autoboost/integer/integer_mask.hpp b/contrib/autoboost/autoboost/integer/integer_mask.hpp new file mode 100644 index 000000000..d9acf3fa1 --- /dev/null +++ b/contrib/autoboost/autoboost/integer/integer_mask.hpp @@ -0,0 +1,126 @@ +// Boost integer/integer_mask.hpp header file ------------------------------// + +// (C) Copyright Daryle Walker 2001. +// 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 updates, documentation, and revision history. + +#ifndef AUTOBOOST_INTEGER_INTEGER_MASK_HPP +#define AUTOBOOST_INTEGER_INTEGER_MASK_HPP + +#include // self include + +#include // for AUTOBOOST_STATIC_CONSTANT +#include // for autoboost::uint_t + +#include // for UCHAR_MAX, etc. +#include // for std::size_t + +#include // for std::numeric_limits + +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// boost/integer/integer_mask.hpp:93:35: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + +namespace autoboost +{ + + +// Specified single-bit mask class declaration -----------------------------// +// (Lowest bit starts counting at 0.) + +template < std::size_t Bit > +struct high_bit_mask_t +{ + typedef typename uint_t<(Bit + 1)>::least least; + typedef typename uint_t<(Bit + 1)>::fast fast; + + AUTOBOOST_STATIC_CONSTANT( least, high_bit = (least( 1u ) << Bit) ); + AUTOBOOST_STATIC_CONSTANT( fast, high_bit_fast = (fast( 1u ) << Bit) ); + + AUTOBOOST_STATIC_CONSTANT( std::size_t, bit_position = Bit ); + +}; // autoboost::high_bit_mask_t + + +// Specified bit-block mask class declaration ------------------------------// +// Makes masks for the lowest N bits +// (Specializations are needed when N fills up a type.) + +template < std::size_t Bits > +struct low_bits_mask_t +{ + typedef typename uint_t::least least; + typedef typename uint_t::fast fast; + + AUTOBOOST_STATIC_CONSTANT( least, sig_bits = (~( ~(least( 0u )) << Bits )) ); + AUTOBOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) ); + + AUTOBOOST_STATIC_CONSTANT( std::size_t, bit_count = Bits ); + +}; // autoboost::low_bits_mask_t + + +#define AUTOBOOST_LOW_BITS_MASK_SPECIALIZE( Type ) \ + template < > struct low_bits_mask_t< std::numeric_limits::digits > { \ + typedef std::numeric_limits limits_type; \ + typedef uint_t::least least; \ + typedef uint_t::fast fast; \ + AUTOBOOST_STATIC_CONSTANT( least, sig_bits = (~( least(0u) )) ); \ + AUTOBOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) ); \ + AUTOBOOST_STATIC_CONSTANT( std::size_t, bit_count = limits_type::digits ); \ + } + +#ifdef AUTOBOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4245) // 'initializing' : conversion from 'int' to 'const autoboost::low_bits_mask_t<8>::least', signed/unsigned mismatch +#endif + +AUTOBOOST_LOW_BITS_MASK_SPECIALIZE( unsigned char ); + +#if USHRT_MAX > UCHAR_MAX +AUTOBOOST_LOW_BITS_MASK_SPECIALIZE( unsigned short ); +#endif + +#if UINT_MAX > USHRT_MAX +AUTOBOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int ); +#endif + +#if ULONG_MAX > UINT_MAX +AUTOBOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long ); +#endif + +#if defined(AUTOBOOST_HAS_LONG_LONG) + #if ((defined(ULLONG_MAX) && (ULLONG_MAX > ULONG_MAX)) ||\ + (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX > ULONG_MAX)) ||\ + (defined(ULONGLONG_MAX) && (ULONGLONG_MAX > ULONG_MAX)) ||\ + (defined(_ULLONG_MAX) && (_ULLONG_MAX > ULONG_MAX))) + AUTOBOOST_LOW_BITS_MASK_SPECIALIZE( autoboost::ulong_long_type ); + #endif +#elif defined(AUTOBOOST_HAS_MS_INT64) + #if 18446744073709551615ui64 > ULONG_MAX + AUTOBOOST_LOW_BITS_MASK_SPECIALIZE( unsigned __int64 ); + #endif +#endif + +#ifdef AUTOBOOST_MSVC +#pragma warning(pop) +#endif + +#undef AUTOBOOST_LOW_BITS_MASK_SPECIALIZE + + +} // namespace autoboost + + +#endif // AUTOBOOST_INTEGER_INTEGER_MASK_HPP diff --git a/contrib/autoboost/boost/integer/static_log2.hpp b/contrib/autoboost/autoboost/integer/static_log2.hpp similarity index 85% rename from contrib/autoboost/boost/integer/static_log2.hpp rename to contrib/autoboost/autoboost/integer/static_log2.hpp index 7120ad259..b848a2340 100644 --- a/contrib/autoboost/boost/integer/static_log2.hpp +++ b/contrib/autoboost/autoboost/integer/static_log2.hpp @@ -13,10 +13,10 @@ // ------------------------------------------------------------------------- // -#ifndef BOOST_INTEGER_STATIC_LOG2_HPP -#define BOOST_INTEGER_STATIC_LOG2_HPP +#ifndef AUTOBOOST_INTEGER_STATIC_LOG2_HPP +#define AUTOBOOST_INTEGER_STATIC_LOG2_HPP -#include "boost/integer_fwd.hpp" // for autoboost::intmax_t +#include "autoboost/integer_fwd.hpp" // for autoboost::intmax_t namespace autoboost { @@ -47,8 +47,8 @@ namespace autoboost { template struct choose_initial_n { - BOOST_STATIC_CONSTANT(bool, c = (argument_type(1) << n << n) != 0); - BOOST_STATIC_CONSTANT( + AUTOBOOST_STATIC_CONSTANT(bool, c = (argument_type(1) << n << n) != 0); + AUTOBOOST_STATIC_CONSTANT( result_type, value = !c*n + choose_initial_n<2*c*n>::value ); @@ -57,7 +57,7 @@ namespace autoboost { template <> struct choose_initial_n<0> { - BOOST_STATIC_CONSTANT(result_type, value = 0); + AUTOBOOST_STATIC_CONSTANT(result_type, value = 0); }; @@ -84,8 +84,8 @@ namespace autoboost { template struct static_log2_impl { - BOOST_STATIC_CONSTANT(bool, c = (x >> n) > 0); // x >= 2**n ? - BOOST_STATIC_CONSTANT( + AUTOBOOST_STATIC_CONSTANT(bool, c = (x >> n) > 0); // x >= 2**n ? + AUTOBOOST_STATIC_CONSTANT( result_type, value = c*n + (static_log2_impl< (x>>c*n), n/2 >::value) ); @@ -94,7 +94,7 @@ namespace autoboost { template <> struct static_log2_impl<1, 0> { - BOOST_STATIC_CONSTANT(result_type, value = 0); + AUTOBOOST_STATIC_CONSTANT(result_type, value = 0); }; } @@ -109,7 +109,7 @@ namespace autoboost { template struct static_log2 { - BOOST_STATIC_CONSTANT( + AUTOBOOST_STATIC_CONSTANT( static_log2_result_type, value = detail::static_log2_impl::static_log2_impl::value ); diff --git a/contrib/autoboost/autoboost/integer_fwd.hpp b/contrib/autoboost/autoboost/integer_fwd.hpp new file mode 100644 index 000000000..e0feaf847 --- /dev/null +++ b/contrib/autoboost/autoboost/integer_fwd.hpp @@ -0,0 +1,164 @@ +// Boost integer_fwd.hpp header file ---------------------------------------// + +// (C) Copyright Dave Abrahams and Daryle Walker 2001. 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/libs/integer for documentation. + +#ifndef AUTOBOOST_INTEGER_FWD_HPP +#define AUTOBOOST_INTEGER_FWD_HPP + +#include // for UCHAR_MAX, etc. +#include // for std::size_t + +#include // for AUTOBOOST_NO_INTRINSIC_WCHAR_T +#include // for std::numeric_limits +#include // For intmax_t + + +namespace autoboost +{ + +#ifdef AUTOBOOST_NO_INTEGRAL_INT64_T + typedef unsigned long static_log2_argument_type; + typedef int static_log2_result_type; + typedef long static_min_max_signed_type; + typedef unsigned long static_min_max_unsigned_type; +#else + typedef autoboost::uintmax_t static_min_max_unsigned_type; + typedef autoboost::intmax_t static_min_max_signed_type; + typedef autoboost::uintmax_t static_log2_argument_type; + typedef int static_log2_result_type; +#endif + +// From ------------------------------------------------// + +// Only has typedefs or using statements, with #conditionals + + +// From -----------------------------------------// + +template < class T > + class integer_traits; + +template < > + class integer_traits< bool >; + +template < > + class integer_traits< char >; + +template < > + class integer_traits< signed char >; + +template < > + class integer_traits< unsigned char >; + +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T +template < > + class integer_traits< wchar_t >; +#endif + +template < > + class integer_traits< short >; + +template < > + class integer_traits< unsigned short >; + +template < > + class integer_traits< int >; + +template < > + class integer_traits< unsigned int >; + +template < > + class integer_traits< long >; + +template < > + class integer_traits< unsigned long >; + +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && !defined(AUTOBOOST_NO_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) +template < > +class integer_traits< ::autoboost::long_long_type>; + +template < > +class integer_traits< ::autoboost::ulong_long_type >; +#elif !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && !defined(AUTOBOOST_NO_INT64_T) && defined(AUTOBOOST_HAS_MS_INT64) +template < > +class integer_traits<__int64>; + +template < > +class integer_traits; +#endif + + +// From ------------------------------------------------// + +template < typename LeastInt > + struct int_fast_t; + +template< int Bits > + struct int_t; + +template< int Bits > + struct uint_t; + +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) + template< autoboost::long_long_type MaxValue > // maximum value to require support +#else + template< long MaxValue > // maximum value to require support +#endif + struct int_max_value_t; + +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) + template< autoboost::long_long_type MinValue > // minimum value to require support +#else + template< long MinValue > // minimum value to require support +#endif + struct int_min_value_t; + +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && defined(AUTOBOOST_HAS_LONG_LONG) + template< autoboost::ulong_long_type MaxValue > // maximum value to require support +#else + template< unsigned long MaxValue > // maximum value to require support +#endif + struct uint_value_t; + + +// From -----------------------------------// + +template < std::size_t Bit > + struct high_bit_mask_t; + +template < std::size_t Bits > + struct low_bits_mask_t; + +template < > + struct low_bits_mask_t< ::std::numeric_limits::digits >; + +// From ------------------------------------// + +template + struct static_log2; + +template <> struct static_log2<0u>; + + +// From ---------------------------------// + +template + struct static_signed_min; + +template + struct static_signed_max; + +template + struct static_unsigned_min; + +template + struct static_unsigned_max; + +} // namespace autoboost + + +#endif // AUTOBOOST_INTEGER_FWD_HPP diff --git a/contrib/autoboost/boost/integer_traits.hpp b/contrib/autoboost/autoboost/integer_traits.hpp similarity index 87% rename from contrib/autoboost/boost/integer_traits.hpp rename to contrib/autoboost/autoboost/integer_traits.hpp index 8548868f7..972f6390b 100644 --- a/contrib/autoboost/boost/integer_traits.hpp +++ b/contrib/autoboost/autoboost/integer_traits.hpp @@ -13,17 +13,17 @@ // See http://www.boost.org/libs/integer for documentation. -#ifndef BOOST_INTEGER_TRAITS_HPP -#define BOOST_INTEGER_TRAITS_HPP +#ifndef AUTOBOOST_INTEGER_TRAITS_HPP +#define AUTOBOOST_INTEGER_TRAITS_HPP -#include -#include +#include +#include // These are an implementation detail and not part of the interface #include // we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it, // and some may have but not ... -#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun) || defined(__QNX__)) +#if !defined(AUTOBOOST_NO_INTRINSIC_WCHAR_T) && (!defined(AUTOBOOST_NO_CWCHAR) || defined(sun) || defined(__sun) || defined(__QNX__)) #include #endif @@ -44,7 +44,7 @@ template class integer_traits : public std::numeric_limits { public: - BOOST_STATIC_CONSTANT(bool, is_integral = false); + AUTOBOOST_STATIC_CONSTANT(bool, is_integral = false); }; namespace detail { @@ -52,12 +52,12 @@ template class integer_traits_base { public: - BOOST_STATIC_CONSTANT(bool, is_integral = true); - BOOST_STATIC_CONSTANT(T, const_min = min_val); - BOOST_STATIC_CONSTANT(T, const_max = max_val); + AUTOBOOST_STATIC_CONSTANT(bool, is_integral = true); + AUTOBOOST_STATIC_CONSTANT(T, const_min = min_val); + AUTOBOOST_STATIC_CONSTANT(T, const_max = max_val); }; -#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +#ifndef AUTOBOOST_NO_INCLASS_MEMBER_INITIALIZATION // A definition is required even for integral static constants template const bool integer_traits_base::is_integral; @@ -95,7 +95,7 @@ class integer_traits public detail::integer_traits_base { }; -#ifndef BOOST_NO_INTRINSIC_WCHAR_T +#ifndef AUTOBOOST_NO_INTRINSIC_WCHAR_T template<> class integer_traits : public std::numeric_limits, @@ -123,7 +123,7 @@ class integer_traits #error No WCHAR_MIN and WCHAR_MAX present, please adjust integer_traits<> for your compiler. #endif { }; -#endif // BOOST_NO_INTRINSIC_WCHAR_T +#endif // AUTOBOOST_NO_INTRINSIC_WCHAR_T template<> class integer_traits @@ -161,8 +161,8 @@ class integer_traits public detail::integer_traits_base { }; -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) -#if defined(ULLONG_MAX) && defined(BOOST_HAS_LONG_LONG) +#if !defined(AUTOBOOST_NO_INTEGRAL_INT64_T) && !defined(AUTOBOOST_NO_INT64_T) +#if defined(ULLONG_MAX) && defined(AUTOBOOST_HAS_LONG_LONG) template<> class integer_traits< ::autoboost::long_long_type> @@ -176,7 +176,7 @@ class integer_traits< ::autoboost::ulong_long_type> public detail::integer_traits_base< ::autoboost::ulong_long_type, 0, ULLONG_MAX> { }; -#elif defined(ULONG_LONG_MAX) && defined(BOOST_HAS_LONG_LONG) +#elif defined(ULONG_LONG_MAX) && defined(AUTOBOOST_HAS_LONG_LONG) template<> class integer_traits< ::autoboost::long_long_type> : public std::numeric_limits< ::autoboost::long_long_type>, public detail::integer_traits_base< ::autoboost::long_long_type, LONG_LONG_MIN, LONG_LONG_MAX>{ }; @@ -186,7 +186,7 @@ class integer_traits< ::autoboost::ulong_long_type> public detail::integer_traits_base< ::autoboost::ulong_long_type, 0, ULONG_LONG_MAX> { }; -#elif defined(ULONGLONG_MAX) && defined(BOOST_HAS_LONG_LONG) +#elif defined(ULONGLONG_MAX) && defined(AUTOBOOST_HAS_LONG_LONG) template<> class integer_traits< ::autoboost::long_long_type> @@ -200,7 +200,7 @@ class integer_traits< ::autoboost::ulong_long_type> public detail::integer_traits_base< ::autoboost::ulong_long_type, 0, ULONGLONG_MAX> { }; -#elif defined(_LLONG_MAX) && defined(_C2) && defined(BOOST_HAS_LONG_LONG) +#elif defined(_LLONG_MAX) && defined(_C2) && defined(AUTOBOOST_HAS_LONG_LONG) template<> class integer_traits< ::autoboost::long_long_type> @@ -214,7 +214,7 @@ class integer_traits< ::autoboost::ulong_long_type> public detail::integer_traits_base< ::autoboost::ulong_long_type, 0, _ULLONG_MAX> { }; -#elif defined(BOOST_HAS_LONG_LONG) +#elif defined(AUTOBOOST_HAS_LONG_LONG) // // we have long long but no constants, this happens for example with gcc in -ansi mode, // we'll just have to work out the values for ourselves (assumes 2's compliment representation): @@ -231,7 +231,7 @@ class integer_traits< ::autoboost::ulong_long_type> public detail::integer_traits_base< ::autoboost::ulong_long_type, 0, ~0uLL> { }; -#elif defined(BOOST_HAS_MS_INT64) +#elif defined(AUTOBOOST_HAS_MS_INT64) template<> class integer_traits< __int64> @@ -250,7 +250,7 @@ class integer_traits< unsigned __int64> } // namespace autoboost -#endif /* BOOST_INTEGER_TRAITS_HPP */ +#endif /* AUTOBOOST_INTEGER_TRAITS_HPP */ diff --git a/contrib/autoboost/autoboost/interprocess/containers/version_type.hpp b/contrib/autoboost/autoboost/interprocess/containers/version_type.hpp new file mode 100644 index 000000000..6d3a77791 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/containers/version_type.hpp @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2008-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_CONTAINERS_VERSION_TYPE_HPP +#define AUTOBOOST_INTERPROCESS_CONTAINERS_VERSION_TYPE_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +namespace autoboost { +namespace interprocess { + +using autoboost::container::container_detail::version_type; +using autoboost::container::container_detail::version; + +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif // #ifndef AUTOBOOST_INTERPROCESS_CONTAINERS_VERSION_TYPE_HPP + diff --git a/contrib/autoboost/autoboost/interprocess/creation_tags.hpp b/contrib/autoboost/autoboost/interprocess/creation_tags.hpp new file mode 100644 index 000000000..d14166fff --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/creation_tags.hpp @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_CREATION_TAGS_HPP +#define AUTOBOOST_INTERPROCESS_CREATION_TAGS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +namespace autoboost { +namespace interprocess { + +//!Tag to indicate that the resource must +//!be only created +struct create_only_t {}; + +//!Tag to indicate that the resource must +//!be only opened +struct open_only_t {}; + +//!Tag to indicate that the resource must +//!be only opened for reading +struct open_read_only_t {}; + +//!Tag to indicate that the resource must +//!be only opened privately for reading +struct open_read_private_t {}; + +//!Tag to indicate that the resource must +//!be only opened for reading +struct open_copy_on_write_t {}; + +//!Tag to indicate that the resource must +//!be created. If already created, it must be opened. +struct open_or_create_t {}; + +//!Value to indicate that the resource must +//!be only created +static const create_only_t create_only = create_only_t(); + +//!Value to indicate that the resource must +//!be only opened +static const open_only_t open_only = open_only_t(); + +//!Value to indicate that the resource must +//!be only opened for reading +static const open_read_only_t open_read_only = open_read_only_t(); + +//!Value to indicate that the resource must +//!be created. If already created, it must be opened. +static const open_or_create_t open_or_create = open_or_create_t(); + +//!Value to indicate that the resource must +//!be only opened for reading +static const open_copy_on_write_t open_copy_on_write = open_copy_on_write_t(); + +namespace ipcdetail { + +enum create_enum_t +{ DoCreate, DoOpen, DoOpenOrCreate }; + +} //namespace ipcdetail { + +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_CREATION_TAGS_HPP + diff --git a/contrib/autoboost/autoboost/interprocess/detail/atomic.hpp b/contrib/autoboost/autoboost/interprocess/detail/atomic.hpp new file mode 100644 index 000000000..884120d36 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/atomic.hpp @@ -0,0 +1,597 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2006-2012 +// (C) Copyright Markus Schoepflin 2007 +// (C) Copyright Bryce Lelbach 2010 +// +// 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_ATOMIC_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_ATOMIC_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include + +namespace autoboost{ +namespace interprocess{ +namespace ipcdetail{ + +//! Atomically increment an autoboost::uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_inc32(volatile autoboost::uint32_t *mem); + +//! Atomically read an autoboost::uint32_t from memory +inline autoboost::uint32_t atomic_read32(volatile autoboost::uint32_t *mem); + +//! Atomically set an autoboost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +inline void atomic_write32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val); + +//! Compare an autoboost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with": what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +inline autoboost::uint32_t atomic_cas32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t with, autoboost::uint32_t cmp); + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +#include + +#if defined( _MSC_VER ) + extern "C" void _ReadWriteBarrier(void); + #pragma intrinsic(_ReadWriteBarrier) + #define AUTOBOOST_INTERPROCESS_READ_WRITE_BARRIER _ReadWriteBarrier() +#elif defined(__GNUC__) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 + #define AUTOBOOST_INTERPROCESS_READ_WRITE_BARRIER __sync_synchronize() + #else + #define AUTOBOOST_INTERPROCESS_READ_WRITE_BARRIER __asm__ __volatile__("" : : : "memory") + #endif +#endif + +namespace autoboost{ +namespace interprocess{ +namespace ipcdetail{ + +//! Atomically decrement an autoboost::uint32_t by 1 +//! "mem": pointer to the atomic value +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_dec32(volatile autoboost::uint32_t *mem) +{ return winapi::interlocked_decrement(reinterpret_cast(mem)) + 1; } + +//! Atomically increment an apr_uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_inc32(volatile autoboost::uint32_t *mem) +{ return winapi::interlocked_increment(reinterpret_cast(mem))-1; } + +//! Atomically read an autoboost::uint32_t from memory +inline autoboost::uint32_t atomic_read32(volatile autoboost::uint32_t *mem) +{ + const autoboost::uint32_t val = *mem; + AUTOBOOST_INTERPROCESS_READ_WRITE_BARRIER; + return val; +} + +//! Atomically set an autoboost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +inline void atomic_write32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ winapi::interlocked_exchange(reinterpret_cast(mem), val); } + +//! Compare an autoboost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with": what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +inline autoboost::uint32_t atomic_cas32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t with, autoboost::uint32_t cmp) +{ return winapi::interlocked_compare_exchange(reinterpret_cast(mem), with, cmp); } + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(_CRAYC) + +namespace autoboost { +namespace interprocess { +namespace ipcdetail{ + +//! Compare an autoboost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with" what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +inline autoboost::uint32_t atomic_cas32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t with, autoboost::uint32_t cmp) +{ + autoboost::uint32_t prev = cmp; + // This version by Mans Rullgard of Pathscale + __asm__ __volatile__ ( "lock\n\t" + "cmpxchg %2,%0" + : "+m"(*mem), "+a"(prev) + : "r"(with) + : "cc"); + + return prev; +} + +//! Atomically add 'val' to an autoboost::uint32_t +//! "mem": pointer to the object +//! "val": amount to add +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_add32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ + // int r = *pw; + // *mem += val; + // return r; + int r; + + asm volatile + ( + "lock\n\t" + "xadd %1, %0": + "+m"( *mem ), "=r"( r ): // outputs (%0, %1) + "1"( val ): // inputs (%2 == %1) + "memory", "cc" // clobbers + ); + + return r; +} + +//! Atomically increment an apr_uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_inc32(volatile autoboost::uint32_t *mem) +{ return atomic_add32(mem, 1); } + +//! Atomically decrement an autoboost::uint32_t by 1 +//! "mem": pointer to the atomic value +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_dec32(volatile autoboost::uint32_t *mem) +{ return atomic_add32(mem, (autoboost::uint32_t)-1); } + +//! Atomically read an autoboost::uint32_t from memory +inline autoboost::uint32_t atomic_read32(volatile autoboost::uint32_t *mem) +{ + const autoboost::uint32_t val = *mem; + __asm__ __volatile__ ( "" ::: "memory" ); + return val; +} + +//! Atomically set an autoboost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +inline void atomic_write32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ + __asm__ __volatile__ + ( + "xchgl %0, %1" + : "+r" (val), "+m" (*mem) + :: "memory" + ); +} + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__)) + +namespace autoboost { +namespace interprocess { +namespace ipcdetail{ + +//! Atomically add 'val' to an autoboost::uint32_t +//! "mem": pointer to the object +//! "val": amount to add +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_add32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ + autoboost::uint32_t prev, temp; + + asm volatile ("1:\n\t" + "lwarx %0,0,%2\n\t" + "add %1,%0,%3\n\t" + "stwcx. %1,0,%2\n\t" + "bne- 1b" + : "=&r" (prev), "=&r" (temp) + : "b" (mem), "r" (val) + : "cc", "memory"); + return prev; +} + +//! Compare an autoboost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with" what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +inline autoboost::uint32_t atomic_cas32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t with, autoboost::uint32_t cmp) +{ + autoboost::uint32_t prev; + + asm volatile ("1:\n\t" + "lwarx %0,0,%1\n\t" + "cmpw %0,%3\n\t" + "bne- 2f\n\t" + "stwcx. %2,0,%1\n\t" + "bne- 1b\n\t" + "2:" + : "=&r"(prev) + : "b" (mem), "r" (with), "r" (cmp) + : "cc", "memory"); + return prev; +} + +//! Atomically increment an apr_uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_inc32(volatile autoboost::uint32_t *mem) +{ return atomic_add32(mem, 1); } + +//! Atomically decrement an autoboost::uint32_t by 1 +//! "mem": pointer to the atomic value +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_dec32(volatile autoboost::uint32_t *mem) +{ return atomic_add32(mem, autoboost::uint32_t(-1u)); } + +//! Atomically read an autoboost::uint32_t from memory +inline autoboost::uint32_t atomic_read32(volatile autoboost::uint32_t *mem) +{ + const autoboost::uint32_t val = *mem; + __asm__ __volatile__ ( "" ::: "memory" ); + return val; +} + +//! Atomically set an autoboost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +inline void atomic_write32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ *mem = val; } + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#elif (defined(sun) || defined(__sun)) + +#include + +namespace autoboost{ +namespace interprocess{ +namespace ipcdetail{ + +//! Atomically add 'val' to an autoboost::uint32_t +//! "mem": pointer to the object +//! "val": amount to add +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_add32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ return atomic_add_32_nv(reinterpret_cast(mem), (int32_t)val) - val; } + +//! Compare an autoboost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with" what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +inline autoboost::uint32_t atomic_cas32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t with, autoboost::uint32_t cmp) +{ return atomic_cas_32(reinterpret_cast(mem), cmp, with); } + +//! Atomically increment an apr_uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_inc32(volatile autoboost::uint32_t *mem) +{ return atomic_add_32_nv(reinterpret_cast(mem), 1) - 1; } + +//! Atomically decrement an autoboost::uint32_t by 1 +//! "mem": pointer to the atomic value +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_dec32(volatile autoboost::uint32_t *mem) +{ return atomic_add_32_nv(reinterpret_cast(mem), (autoboost::uint32_t)-1) + 1; } + +//! Atomically read an autoboost::uint32_t from memory +inline autoboost::uint32_t atomic_read32(volatile autoboost::uint32_t *mem) +{ return *mem; } + +//! Atomically set an autoboost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +inline void atomic_write32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ *mem = val; } + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#elif defined(__osf__) && defined(__DECCXX) + +#include +#include + +namespace autoboost{ +namespace interprocess{ +namespace ipcdetail{ + +//! Atomically decrement a uint32_t by 1 +//! "mem": pointer to the atomic value +//! Returns the old value pointed to by mem +//! Acquire, memory barrier after decrement. +inline autoboost::uint32_t atomic_dec32(volatile autoboost::uint32_t *mem) +{ autoboost::uint32_t old_val = __ATOMIC_DECREMENT_LONG(mem); __MB(); return old_val; } + +//! Atomically increment a uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +//! Release, memory barrier before increment. +inline autoboost::uint32_t atomic_inc32(volatile autoboost::uint32_t *mem) +{ __MB(); return __ATOMIC_INCREMENT_LONG(mem); } + +// Rational for the implementation of the atomic read and write functions. +// +// 1. The Alpha Architecture Handbook requires that access to a byte, +// an aligned word, an aligned longword, or an aligned quadword is +// atomic. (See 'Alpha Architecture Handbook', version 4, chapter 5.2.2.) +// +// 2. The CXX User's Guide states that volatile quantities are accessed +// with single assembler instructions, and that a compilation error +// occurs when declaring a quantity as volatile which is not properly +// aligned. + +//! Atomically read an autoboost::uint32_t from memory +//! Acquire, memory barrier after load. +inline autoboost::uint32_t atomic_read32(volatile autoboost::uint32_t *mem) +{ autoboost::uint32_t old_val = *mem; __MB(); return old_val; } + +//! Atomically set an autoboost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +//! Release, memory barrier before store. +inline void atomic_write32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ __MB(); *mem = val; } + +//! Compare an autoboost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with" what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +//! Memory barrier between load and store. +inline autoboost::uint32_t atomic_cas32( + volatile autoboost::uint32_t *mem, autoboost::uint32_t with, autoboost::uint32_t cmp) +{ + // Note: + // + // Branch prediction prefers backward branches, and the Alpha Architecture + // Handbook explicitely states that the loop should not be implemented like + // it is below. (See chapter 4.2.5.) Therefore the code should probably look + // like this: + // + // return asm( + // "10: ldl_l %v0,(%a0) ;" + // " cmpeq %v0,%a2,%t0 ;" + // " beq %t0,20f ;" + // " mb ;" + // " mov %a1,%t0 ;" + // " stl_c %t0,(%a0) ;" + // " beq %t0,30f ;" + // "20: ret ;" + // "30: br 10b;", + // mem, with, cmp); + // + // But as the compiler always transforms this into the form where a backward + // branch is taken on failure, we can as well implement it in the straight + // forward form, as this is what it will end up in anyway. + + return asm( + "10: ldl_l %v0,(%a0) ;" // load prev value from mem and lock mem + " cmpeq %v0,%a2,%t0 ;" // compare with given value + " beq %t0,20f ;" // if not equal, we're done + " mb ;" // memory barrier + " mov %a1,%t0 ;" // load new value into scratch register + " stl_c %t0,(%a0) ;" // store new value to locked mem (overwriting scratch) + " beq %t0,10b ;" // store failed because lock has been stolen, retry + "20: ", + mem, with, cmp); +} + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#elif defined(__IBMCPP__) && (__IBMCPP__ >= 800) && defined(_AIX) + +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail{ + +//first define autoboost::uint32_t versions of __lwarx and __stwcx to avoid poluting +//all the functions with casts + +//! From XLC documenation : +//! This function can be used with a subsequent stwcxu call to implement a +//! read-modify-write on a specified memory location. The two functions work +//! together to ensure that if the store is successfully performed, no other +//! processor or mechanism can modify the target doubleword between the time +//! lwarxu function is executed and the time the stwcxu functio ncompletes. +//! "mem" : pointer to the object +//! Returns the value at pointed to by mem +inline autoboost::uint32_t lwarxu(volatile autoboost::uint32_t *mem) +{ + return static_cast(__lwarx(reinterpret_cast(mem))); +} + +//! "mem" : pointer to the object +//! "val" : the value to store +//! Returns true if the update of mem is successful and false if it is +//!unsuccessful +inline bool stwcxu(volatile autoboost::uint32_t* mem, autoboost::uint32_t val) +{ + return (__stwcx(reinterpret_cast(mem), static_cast(val)) != 0); +} + +//! "mem": pointer to the object +//! "val": amount to add +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_add32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ + autoboost::uint32_t oldValue; + do + { + oldValue = lwarxu(mem); + }while (!stwcxu(mem, oldValue+val)); + return oldValue; +} + +//! Atomically increment an apr_uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_inc32(volatile autoboost::uint32_t *mem) +{ return atomic_add32(mem, 1); } + +//! Atomically decrement an autoboost::uint32_t by 1 +//! "mem": pointer to the atomic value +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_dec32(volatile autoboost::uint32_t *mem) +{ return atomic_add32(mem, (autoboost::uint32_t)-1); } + +//! Atomically read an autoboost::uint32_t from memory +inline autoboost::uint32_t atomic_read32(volatile autoboost::uint32_t *mem) +{ return *mem; } + +//! Compare an autoboost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with" what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +inline autoboost::uint32_t atomic_cas32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t with, autoboost::uint32_t cmp) +{ + autoboost::uint32_t oldValue; + autoboost::uint32_t valueToStore; + do + { + oldValue = lwarxu(mem); + } while (!stwcxu(mem, (oldValue == with) ? cmp : oldValue)); + + return oldValue; +} + +//! Atomically set an autoboost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +inline void atomic_write32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ *mem = val; } + +} //namespace ipcdetail +} //namespace interprocess +} //namespace autoboost + +#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) + +namespace autoboost { +namespace interprocess { +namespace ipcdetail{ + +//! Atomically add 'val' to an autoboost::uint32_t +//! "mem": pointer to the object +//! "val": amount to add +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_add32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ return __sync_fetch_and_add(const_cast(mem), val); } + +//! Atomically increment an apr_uint32_t by 1 +//! "mem": pointer to the object +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_inc32(volatile autoboost::uint32_t *mem) +{ return atomic_add32(mem, 1); } + +//! Atomically decrement an autoboost::uint32_t by 1 +//! "mem": pointer to the atomic value +//! Returns the old value pointed to by mem +inline autoboost::uint32_t atomic_dec32(volatile autoboost::uint32_t *mem) +{ return atomic_add32(mem, (autoboost::uint32_t)-1); } + +//! Atomically read an autoboost::uint32_t from memory +inline autoboost::uint32_t atomic_read32(volatile autoboost::uint32_t *mem) +{ autoboost::uint32_t old_val = *mem; __sync_synchronize(); return old_val; } + +//! Compare an autoboost::uint32_t's value with "cmp". +//! If they are the same swap the value with "with" +//! "mem": pointer to the value +//! "with" what to swap it with +//! "cmp": the value to compare it to +//! Returns the old value of *mem +inline autoboost::uint32_t atomic_cas32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t with, autoboost::uint32_t cmp) +{ return __sync_val_compare_and_swap(const_cast(mem), cmp, with); } + +//! Atomically set an autoboost::uint32_t in memory +//! "mem": pointer to the object +//! "param": val value that the object will assume +inline void atomic_write32(volatile autoboost::uint32_t *mem, autoboost::uint32_t val) +{ __sync_synchronize(); *mem = val; } + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#else + +#error No atomic operations implemented for this platform, sorry! + +#endif + +namespace autoboost{ +namespace interprocess{ +namespace ipcdetail{ + +inline bool atomic_add_unless32 + (volatile autoboost::uint32_t *mem, autoboost::uint32_t value, autoboost::uint32_t unless_this) +{ + autoboost::uint32_t old, c(atomic_read32(mem)); + while(c != unless_this && (old = atomic_cas32(mem, c + value, c)) != c){ + c = old; + } + return c != unless_this; +} + +} //namespace ipcdetail +} //namespace interprocess +} //namespace autoboost + + +#include + +#endif //AUTOBOOST_INTERPROCESS_DETAIL_ATOMIC_HPP diff --git a/contrib/autoboost/autoboost/interprocess/detail/config_begin.hpp b/contrib/autoboost/autoboost/interprocess/detail/config_begin.hpp new file mode 100644 index 000000000..274c2b207 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/config_begin.hpp @@ -0,0 +1,44 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#ifndef AUTOBOOST_INTERPROCESS_CONFIG_INCLUDED +#define AUTOBOOST_INTERPROCESS_CONFIG_INCLUDED +#include +#endif + +#ifdef AUTOBOOST_MSVC + #pragma warning (push) + #pragma warning (disable : 4702) // unreachable code + #pragma warning (disable : 4706) // assignment within conditional expression + #pragma warning (disable : 4127) // conditional expression is constant + #pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned + #pragma warning (disable : 4284) // odd return type for operator-> + #pragma warning (disable : 4244) // possible loss of data + #pragma warning (disable : 4251) // "identifier" : class "type" needs to have dll-interface to be used by clients of class "type2" + #pragma warning (disable : 4267) // conversion from "X" to "Y", possible loss of data + #pragma warning (disable : 4275) // non DLL-interface classkey "identifier" used as base for DLL-interface classkey "identifier" + #pragma warning (disable : 4355) // "this" : used in base member initializer list + #pragma warning (disable : 4503) // "identifier" : decorated name length exceeded, name was truncated + #pragma warning (disable : 4511) // copy constructor could not be generated + #pragma warning (disable : 4512) // assignment operator could not be generated + #pragma warning (disable : 4514) // unreferenced inline removed + #pragma warning (disable : 4521) // Disable "multiple copy constructors specified" + #pragma warning (disable : 4522) // "class" : multiple assignment operators specified + #pragma warning (disable : 4675) // "method" should be declared "static" and have exactly one parameter + #pragma warning (disable : 4710) // function not inlined + #pragma warning (disable : 4711) // function selected for automatic inline expansion + #pragma warning (disable : 4786) // identifier truncated in debug info + #pragma warning (disable : 4996) // "function": was declared deprecated + #pragma warning (disable : 4197) // top-level volatile in cast is ignored + #pragma warning (disable : 4541) // 'typeid' used on polymorphic type 'autoboost::exception' + // with /GR-; unpredictable behavior may result + #pragma warning (disable : 4673) // throwing '' the following types will not be considered at the catch site + #pragma warning (disable : 4671) // the copy constructor is inaccessible + #pragma warning (disable : 4250) // inherits 'x' via dominance +#endif diff --git a/contrib/autoboost/autoboost/interprocess/detail/config_end.hpp b/contrib/autoboost/autoboost/interprocess/detail/config_end.hpp new file mode 100644 index 000000000..a5fe41691 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/config_end.hpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#if defined AUTOBOOST_MSVC + #pragma warning (pop) +#endif + diff --git a/contrib/autoboost/autoboost/interprocess/detail/config_external_begin.hpp b/contrib/autoboost/autoboost/interprocess/detail/config_external_begin.hpp new file mode 100644 index 000000000..6ed20e76e --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/config_external_begin.hpp @@ -0,0 +1,18 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2012-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#ifndef AUTOBOOST_INTERPROCESS_EXTERNAL_CONFIG_INCLUDED +#define AUTOBOOST_INTERPROCESS_EXTERNAL_CONFIG_INCLUDED +#include +#endif + +#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 406) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wshadow" +#endif diff --git a/contrib/autoboost/autoboost/interprocess/detail/config_external_end.hpp b/contrib/autoboost/autoboost/interprocess/detail/config_external_end.hpp new file mode 100644 index 000000000..214558f58 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/config_external_end.hpp @@ -0,0 +1,12 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2012-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 406) +# pragma GCC diagnostic pop +#endif diff --git a/contrib/autoboost/autoboost/interprocess/detail/intermodule_singleton_common.hpp b/contrib/autoboost/autoboost/interprocess/detail/intermodule_singleton_common.hpp new file mode 100644 index 000000000..f159fa3a7 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/intermodule_singleton_common.hpp @@ -0,0 +1,500 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2009-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP +#define AUTOBOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP + +#if defined(_MSC_VER) +#pragma once +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost{ +namespace interprocess{ +namespace ipcdetail{ + +namespace intermodule_singleton_helpers { + +inline void get_pid_creation_time_str(std::string &s) +{ + std::stringstream stream; + stream << get_current_process_id() << '_'; + stream.precision(6); + stream << std::fixed << get_current_process_creation_time(); + s = stream.str(); +} + +inline const char *get_map_base_name() +{ return "bip.gmem.map."; } + +inline void get_map_name(std::string &map_name) +{ + get_pid_creation_time_str(map_name); + map_name.insert(0, get_map_base_name()); +} + +inline std::size_t get_map_size() +{ return 65536; } + +template +struct thread_safe_global_map_dependant; + +} //namespace intermodule_singleton_helpers { + +//This class contains common code for all singleton types, so that we instantiate this +//code just once per module. This class also holds a thread soafe global map +//to be used by all instances protected with a reference count +template +class intermodule_singleton_common +{ + public: + typedef void*(singleton_constructor_t)(ThreadSafeGlobalMap &); + typedef void (singleton_destructor_t)(void *, ThreadSafeGlobalMap &); + + static const ::autoboost::uint32_t Uninitialized = 0u; + static const ::autoboost::uint32_t Initializing = 1u; + static const ::autoboost::uint32_t Initialized = 2u; + static const ::autoboost::uint32_t Broken = 3u; + static const ::autoboost::uint32_t Destroyed = 4u; + + //Initialize this_module_singleton_ptr, creates the global map if needed and also creates an unique + //opaque type in global map through a singleton_constructor_t function call, + //initializing the passed pointer to that unique instance. + // + //We have two concurrency types here. a)the global map/singleton creation must + //be safe between threads of this process but in different modules/dlls. b) + //the pointer to the singleton is per-module, so we have to protect this + //initization between threads of the same module. + // + //All static variables declared here are shared between inside a module + //so atomic operations will synchronize only threads of the same module. + static void initialize_singleton_logic + (void *&ptr, volatile autoboost::uint32_t &this_module_singleton_initialized, singleton_constructor_t constructor, bool phoenix) + { + //If current module is not initialized enter to lock free logic + if(atomic_read32(&this_module_singleton_initialized) != Initialized){ + //Now a single thread of the module will succeed in this CAS. + //trying to pass from Uninitialized to Initializing + ::autoboost::uint32_t previous_module_singleton_initialized = atomic_cas32 + (&this_module_singleton_initialized, Initializing, Uninitialized); + //If the thread succeeded the CAS (winner) it will compete with other + //winner threads from other modules to create the global map + if(previous_module_singleton_initialized == Destroyed){ + //Trying to resurrect a dead Phoenix singleton. Just try to + //mark it as uninitialized and start again + if(phoenix){ + atomic_cas32(&this_module_singleton_initialized, Uninitialized, Destroyed); + previous_module_singleton_initialized = atomic_cas32 + (&this_module_singleton_initialized, Initializing, Uninitialized); + } + //Trying to resurrect a non-Phoenix dead singleton is an error + else{ + throw interprocess_exception("Boost.Interprocess: Dead reference on non-Phoenix singleton of type"); + } + } + if(previous_module_singleton_initialized == Uninitialized){ + try{ + //Now initialize the global map, this function must solve concurrency + //issues between threads of several modules + initialize_global_map_handle(); + //Now try to create the singleton in global map. + //This function solves concurrency issues + //between threads of several modules + ThreadSafeGlobalMap *const pmap = get_map_ptr(); + void *tmp = constructor(*pmap); + //Increment the module reference count that reflects how many + //singletons this module holds, so that we can safely destroy + //module global map object when no singleton is left + atomic_inc32(&this_module_singleton_count); + //Insert a barrier before assigning the pointer to + //make sure this assignment comes after the initialization + atomic_write32(&this_module_singleton_initialized, Initializing); + //Assign the singleton address to the module-local pointer + ptr = tmp; + //Memory barrier inserted, all previous operations should complete + //before this one. Now marked as initialized + atomic_write32(&this_module_singleton_initialized, Initialized); + } + catch(...){ + //Mark singleton failed to initialize + atomic_write32(&this_module_singleton_initialized, Broken); + throw; + } + } + //If previous state was initializing, this means that another winner thread is + //trying to initialize the singleton. Just wait until completes its work. + else if(previous_module_singleton_initialized == Initializing){ + spin_wait swait; + while(1){ + previous_module_singleton_initialized = atomic_read32(&this_module_singleton_initialized); + if(previous_module_singleton_initialized >= Initialized){ + //Already initialized, or exception thrown by initializer thread + break; + } + else if(previous_module_singleton_initialized == Initializing){ + swait.yield(); + } + else{ + //This can't be happening! + AUTOBOOST_ASSERT(0); + } + } + } + else if(previous_module_singleton_initialized == Initialized){ + //Nothing to do here, the singleton is ready + } + //If previous state was greater than initialized, then memory is broken + //trying to initialize the singleton. + else{//(previous_module_singleton_initialized > Initialized) + throw interprocess_exception("autoboost::interprocess::intermodule_singleton initialization failed"); + } + } + AUTOBOOST_ASSERT(ptr != 0); + } + + static void finalize_singleton_logic(void *&ptr, volatile autoboost::uint32_t &this_module_singleton_initialized, singleton_destructor_t destructor) + { + //Protect destruction against lazy singletons not initialized in this execution + if(ptr){ + //Note: this destructor might provoke a Phoenix singleton + //resurrection. This means that this_module_singleton_count + //might change after this call. + ThreadSafeGlobalMap * const pmap = get_map_ptr(); + destructor(ptr, *pmap); + ptr = 0; + + //Memory barrier to make sure pointer is nulled. + //Mark this singleton as destroyed. + atomic_write32(&this_module_singleton_initialized, Destroyed); + + //If this is the last singleton of this module + //apply map destruction. + //Note: singletons are destroyed when the module is unloaded + //so no threads should be executing or holding references + //to this module + if(1 == atomic_dec32(&this_module_singleton_count)){ + destroy_global_map_handle(); + } + } + } + + private: + static ThreadSafeGlobalMap *get_map_ptr() + { + return static_cast(static_cast(mem_holder.map_mem)); + } + + static void initialize_global_map_handle() + { + //Obtain unique map name and size + spin_wait swait; + while(1){ + //Try to pass map state to initializing + ::autoboost::uint32_t tmp = atomic_cas32(&this_module_map_initialized, Initializing, Uninitialized); + if(tmp == Initialized || tmp == Broken){ + break; + } + else if(tmp == Destroyed){ + tmp = atomic_cas32(&this_module_map_initialized, Uninitialized, Destroyed); + continue; + } + //If some other thread is doing the work wait + else if(tmp == Initializing){ + swait.yield(); + } + else{ //(tmp == Uninitialized) + //If not initialized try it again? + try{ + //Remove old global map from the system + intermodule_singleton_helpers::thread_safe_global_map_dependant::remove_old_gmem(); + //in-place construction of the global map class + ThreadSafeGlobalMap * const pmap = get_map_ptr(); + intermodule_singleton_helpers::thread_safe_global_map_dependant + ::construct_map(static_cast(pmap)); + //Use global map's internal lock to initialize the lock file + //that will mark this gmem as "in use". + typename intermodule_singleton_helpers::thread_safe_global_map_dependant:: + lock_file_logic f(*pmap); + //If function failed (maybe a competing process has erased the shared + //memory between creation and file locking), retry with a new instance. + if(f.retry()){ + pmap->~ThreadSafeGlobalMap(); + atomic_write32(&this_module_map_initialized, Destroyed); + } + else{ + //Locking succeeded, so this global map module-instance is ready + atomic_write32(&this_module_map_initialized, Initialized); + break; + } + } + catch(...){ + // + throw; + } + } + } + } + + static void destroy_global_map_handle() + { + if(!atomic_read32(&this_module_singleton_count)){ + //This module is being unloaded, so destroy + //the global map object of this module + //and unlink the global map if it's the last + ThreadSafeGlobalMap * const pmap = get_map_ptr(); + typename intermodule_singleton_helpers::thread_safe_global_map_dependant:: + unlink_map_logic f(*pmap); + pmap->~ThreadSafeGlobalMap(); + atomic_write32(&this_module_map_initialized, Destroyed); + //Do some cleanup for other processes old gmem instances + intermodule_singleton_helpers::thread_safe_global_map_dependant::remove_old_gmem(); + } + } + + //Static data, zero-initalized without any dependencies + //this_module_singleton_count is the number of singletons used by this module + static volatile autoboost::uint32_t this_module_singleton_count; + + //this_module_map_initialized is the state of this module's map class object. + //Values: Uninitialized, Initializing, Initialized, Broken + static volatile autoboost::uint32_t this_module_map_initialized; + + //Raw memory to construct the global map manager + static union mem_holder_t + { + unsigned char map_mem [sizeof(ThreadSafeGlobalMap)]; + ::autoboost::detail::max_align aligner; + } mem_holder; +}; + +template +volatile autoboost::uint32_t intermodule_singleton_common::this_module_singleton_count; + +template +volatile autoboost::uint32_t intermodule_singleton_common::this_module_map_initialized; + +template +typename intermodule_singleton_common::mem_holder_t + intermodule_singleton_common::mem_holder; + +//A reference count to be stored in global map holding the number +//of singletons (one per module) attached to the instance pointed by +//the internal ptr. +struct ref_count_ptr +{ + ref_count_ptr(void *p, autoboost::uint32_t count) + : ptr(p), singleton_ref_count(count) + {} + void *ptr; + //This reference count serves to count the number of attached + //modules to this singleton + volatile autoboost::uint32_t singleton_ref_count; +}; + + +//Now this class is a singleton, initializing the singleton in +//the first get() function call if LazyInit is true. If false +//then the singleton will be initialized when loading the module. +template +class intermodule_singleton_impl +{ + public: + + static C& get() //Let's make inlining easy + { + if(!this_module_singleton_ptr){ + if(lifetime.dummy_function()){ //This forces lifetime instantiation, for reference counted destruction + atentry_work(); + } + } + return *static_cast(this_module_singleton_ptr); + } + + private: + + static void atentry_work() + { + intermodule_singleton_common::initialize_singleton_logic + (this_module_singleton_ptr, this_module_singleton_initialized, singleton_constructor, Phoenix); + } + + static void atexit_work() + { + intermodule_singleton_common::finalize_singleton_logic + (this_module_singleton_ptr, this_module_singleton_initialized, singleton_destructor); + } + + //These statics will be zero-initialized without any constructor call dependency + //this_module_singleton_ptr will be a module-local pointer to the singleton + static void* this_module_singleton_ptr; + + //this_module_singleton_count will be used to synchronize threads of the same module + //for access to a singleton instance, and to flag the state of the + //singleton. + static volatile autoboost::uint32_t this_module_singleton_initialized; + + //This class destructor will trigger singleton destruction + struct lifetime_type_lazy + { + bool dummy_function() + { return m_dummy == 0; } + + ~lifetime_type_lazy() + { + //if(!Phoenix){ + //atexit_work(); + //} + } + + //Dummy volatile so that the compiler can't resolve its value at compile-time + //and can't avoid lifetime_type instantiation if dummy_function() is called. + static volatile int m_dummy; + }; + + struct lifetime_type_static + : public lifetime_type_lazy + { + lifetime_type_static() + { atentry_work(); } + }; + + typedef typename if_c + ::type lifetime_type; + + static lifetime_type lifetime; + + //A functor to be executed inside global map lock that just + //searches for the singleton in map and if not present creates a new one. + //If singleton constructor throws, the exception is propagated + struct init_atomic_func + { + init_atomic_func(ThreadSafeGlobalMap &m) + : m_map(m), ret_ptr() + {} + + void operator()() + { + ref_count_ptr *rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant + ::find(m_map, typeid(C).name()); + if(!rcount){ + C *p = new C; + try{ + ref_count_ptr val(p, 0u); + rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant + ::insert(m_map, typeid(C).name(), val); + } + catch(...){ + intermodule_singleton_helpers::thread_safe_global_map_dependant + ::erase(m_map, typeid(C).name()); + delete p; + throw; + } + } + //if(Phoenix){ + std::atexit(&atexit_work); + //} + atomic_inc32(&rcount->singleton_ref_count); + ret_ptr = rcount->ptr; + } + void *data() const + { return ret_ptr; } + + private: + ThreadSafeGlobalMap &m_map; + void *ret_ptr; + }; + + //A functor to be executed inside global map lock that just + //deletes the singleton in map if the attached count reaches to zero + struct fini_atomic_func + { + fini_atomic_func(ThreadSafeGlobalMap &m) + : m_map(m) + {} + + void operator()() + { + ref_count_ptr *rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant + ::find(m_map, typeid(C).name()); + //The object must exist + AUTOBOOST_ASSERT(rcount); + AUTOBOOST_ASSERT(rcount->singleton_ref_count > 0); + //Check if last reference + if(atomic_dec32(&rcount->singleton_ref_count) == 1){ + //If last, destroy the object + AUTOBOOST_ASSERT(rcount->ptr != 0); + C *pc = static_cast(rcount->ptr); + //Now destroy map entry + bool destroyed = intermodule_singleton_helpers::thread_safe_global_map_dependant + ::erase(m_map, typeid(C).name()); + (void)destroyed; AUTOBOOST_ASSERT(destroyed == true); + delete pc; + } + } + + private: + ThreadSafeGlobalMap &m_map; + }; + + //A wrapper to execute init_atomic_func + static void *singleton_constructor(ThreadSafeGlobalMap &map) + { + init_atomic_func f(map); + intermodule_singleton_helpers::thread_safe_global_map_dependant + ::atomic_func(map, f); + return f.data(); + } + + //A wrapper to execute fini_atomic_func + static void singleton_destructor(void *p, ThreadSafeGlobalMap &map) + { (void)p; + fini_atomic_func f(map); + intermodule_singleton_helpers::thread_safe_global_map_dependant + ::atomic_func(map, f); + } +}; + +template +volatile int intermodule_singleton_impl::lifetime_type_lazy::m_dummy = 0; + +//These will be zero-initialized by the loader +template +void *intermodule_singleton_impl::this_module_singleton_ptr = 0; + +template +volatile autoboost::uint32_t intermodule_singleton_impl::this_module_singleton_initialized = 0; + +template +typename intermodule_singleton_impl::lifetime_type + intermodule_singleton_impl::lifetime; + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP diff --git a/contrib/autoboost/autoboost/interprocess/detail/min_max.hpp b/contrib/autoboost/autoboost/interprocess/detail/min_max.hpp new file mode 100644 index 000000000..14937c6eb --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/min_max.hpp @@ -0,0 +1,40 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. +// +// 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +namespace autoboost { +namespace interprocess { + +template +const T &max_value(const T &a, const T &b) +{ return a > b ? a : b; } + +template +const T &min_value(const T &a, const T &b) +{ return a < b ? a : b; } + +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DETAIL_MIN_MAX_HPP + diff --git a/contrib/autoboost/autoboost/interprocess/detail/mpl.hpp b/contrib/autoboost/autoboost/interprocess/detail/mpl.hpp new file mode 100644 index 000000000..36e2b1b17 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/mpl.hpp @@ -0,0 +1,152 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. +// +// 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_MPL_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_MPL_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +template +struct integral_constant +{ + static const T value = val; + typedef integral_constant type; +}; + +template< bool C_ > +struct bool_ : integral_constant +{ + static const bool value = C_; +}; + +typedef bool_ true_; +typedef bool_ false_; + +typedef true_ true_type; +typedef false_ false_type; + +typedef char yes_type; +struct no_type +{ + char padding[8]; +}; + +template +struct enable_if_c { + typedef T type; +}; + +template +struct enable_if_c {}; + +template +struct enable_if : public enable_if_c {}; + +template +struct disable_if : public enable_if_c {}; + +template +class is_convertible +{ + typedef char true_t; + class false_t { char dummy[2]; }; + static true_t dispatch(U); + static false_t dispatch(...); + static T trigger(); + public: + static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t); +}; + +template< + bool C + , typename T1 + , typename T2 + > +struct if_c +{ + typedef T1 type; +}; + +template< + typename T1 + , typename T2 + > +struct if_c +{ + typedef T2 type; +}; + +template< + typename T1 + , typename T2 + , typename T3 + > +struct if_ +{ + typedef typename if_c<0 != T1::value, T2, T3>::type type; +}; + + +template +struct select1st +// : public std::unary_function +{ + template + const typename Pair::first_type& operator()(const OtherPair& x) const + { return x.first; } + + const typename Pair::first_type& operator()(const typename Pair::first_type& x) const + { return x; } +}; + +// identity is an extension: it is not part of the standard. +template +struct identity +// : public std::unary_function +{ + typedef T type; + const T& operator()(const T& x) const + { return x; } +}; + +template +struct ls_zeros +{ + static const std::size_t value = (S & std::size_t(1)) ? 0 : (1u + ls_zeros<(S >> 1u)>::value); +}; + +template<> +struct ls_zeros<0> +{ + static const std::size_t value = 0; +}; + +template<> +struct ls_zeros<1> +{ + static const std::size_t value = 0; +}; + +} //namespace ipcdetail { +} //namespace interprocess { +} //namespace autoboost { + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DETAIL_MPL_HPP + diff --git a/contrib/autoboost/autoboost/interprocess/detail/os_file_functions.hpp b/contrib/autoboost/autoboost/interprocess/detail/os_file_functions.hpp new file mode 100644 index 000000000..82bc481cf --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/os_file_functions.hpp @@ -0,0 +1,734 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_OS_FILE_FUNCTIONS_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_OS_FILE_FUNCTIONS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) +# include +#else +# ifdef AUTOBOOST_HAS_UNISTD_H +# include +# include +# include +# include +# include +# include +# include +# if 0 +# include +# endif +# else +# error Unknown platform +# endif +#endif + +#include +#include + +namespace autoboost { +namespace interprocess { + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +typedef void * file_handle_t; +typedef long long offset_t; +typedef struct mapping_handle_impl_t{ + void * handle; + bool is_shm; +} mapping_handle_t; + +typedef enum { read_only = winapi::generic_read + , read_write = winapi::generic_read | winapi::generic_write + , copy_on_write + , read_private + , invalid_mode = 0xffff + } mode_t; + +typedef enum { file_begin = winapi::file_begin + , file_end = winapi::file_end + , file_current = winapi::file_current + } file_pos_t; + +typedef unsigned long map_options_t; +static const map_options_t default_map_options = map_options_t(-1); + +namespace ipcdetail{ + +inline mapping_handle_t mapping_handle_from_file_handle(file_handle_t hnd) +{ + mapping_handle_t ret; + ret.handle = hnd; + ret.is_shm = false; + return ret; +} + +inline mapping_handle_t mapping_handle_from_shm_handle(file_handle_t hnd) +{ + mapping_handle_t ret; + ret.handle = hnd; + ret.is_shm = true; + return ret; +} + +inline file_handle_t file_handle_from_mapping_handle(mapping_handle_t hnd) +{ return hnd.handle; } + +inline bool create_directory(const char *path) +{ return winapi::create_directory(path); } + +inline bool get_temporary_path(char *buffer, std::size_t buf_len, std::size_t &required_len) +{ + required_len = 0; + //std::size_t is always bigger or equal than unsigned long in Windows systems + //In case std::size_t is bigger than unsigned long + unsigned long buf = buf_len; + if(buf_len != buf){ //maybe overflowed + return false; + } + required_len = winapi::get_temp_path(buf_len, buffer); + const bool ret = !(buf_len < required_len); + if(ret && buffer[required_len-1] == '\\'){ + buffer[required_len-1] = 0; + } + return ret; +} + +inline file_handle_t create_new_file + (const char *name, mode_t mode, const permissions & perm = permissions(), bool temporary = false) +{ + unsigned long attr = temporary ? winapi::file_attribute_temporary : 0; + return winapi::create_file + ( name, (unsigned int)mode, winapi::create_new, attr + , (winapi::interprocess_security_attributes*)perm.get_permissions()); +} + +inline file_handle_t create_or_open_file + (const char *name, mode_t mode, const permissions & perm = permissions(), bool temporary = false) +{ + unsigned long attr = temporary ? winapi::file_attribute_temporary : 0; + return winapi::create_file + ( name, (unsigned int)mode, winapi::open_always, attr + , (winapi::interprocess_security_attributes*)perm.get_permissions()); +} + +inline file_handle_t open_existing_file + (const char *name, mode_t mode, bool temporary = false) +{ + unsigned long attr = temporary ? winapi::file_attribute_temporary : 0; + return winapi::create_file + (name, (unsigned int)mode, winapi::open_existing, attr, 0); +} + +inline bool delete_file(const char *name) +{ return winapi::unlink_file(name); } + +inline bool truncate_file (file_handle_t hnd, std::size_t size) +{ + offset_t filesize; + if(!winapi::get_file_size(hnd, filesize)) + return false; + + typedef autoboost::make_unsigned::type uoffset_t; + const uoffset_t max_filesize = uoffset_t((std::numeric_limits::max)()); + //Avoid unused variable warnings in 32 bit systems + if(uoffset_t(size) > max_filesize){ + winapi::set_last_error(winapi::error_file_too_large); + return false; + } + + if(offset_t(size) > filesize){ + if(!winapi::set_file_pointer_ex(hnd, filesize, 0, winapi::file_begin)){ + return false; + } + //We will write zeros in the end of the file + //since set_end_of_file does not guarantee this + for(std::size_t remaining = size - filesize, write_size = 0 + ;remaining > 0 + ;remaining -= write_size){ + const std::size_t DataSize = 512; + static char data [DataSize]; + write_size = DataSize < remaining ? DataSize : remaining; + unsigned long written; + winapi::write_file(hnd, data, (unsigned long)write_size, &written, 0); + if(written != write_size){ + return false; + } + } + } + else{ + if(!winapi::set_file_pointer_ex(hnd, size, 0, winapi::file_begin)){ + return false; + } + if(!winapi::set_end_of_file(hnd)){ + return false; + } + } + return true; +} + +inline bool get_file_size(file_handle_t hnd, offset_t &size) +{ return winapi::get_file_size(hnd, size); } + +inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos) +{ return winapi::set_file_pointer_ex(hnd, off, 0, (unsigned long) pos); } + +inline bool get_file_pointer(file_handle_t hnd, offset_t &off) +{ return winapi::set_file_pointer_ex(hnd, 0, &off, winapi::file_current); } + +inline bool write_file(file_handle_t hnd, const void *data, std::size_t numdata) +{ + unsigned long written; + return 0 != winapi::write_file(hnd, data, (unsigned long)numdata, &written, 0); +} + +inline file_handle_t invalid_file() +{ return winapi::invalid_handle_value; } + +inline bool close_file(file_handle_t hnd) +{ return 0 != winapi::close_handle(hnd); } + +inline bool acquire_file_lock(file_handle_t hnd) +{ + static winapi::interprocess_overlapped overlapped; + const unsigned long len = ((unsigned long)-1); +// winapi::interprocess_overlapped overlapped; +// std::memset(&overlapped, 0, sizeof(overlapped)); + return winapi::lock_file_ex + (hnd, winapi::lockfile_exclusive_lock, 0, len, len, &overlapped); +} + +inline bool try_acquire_file_lock(file_handle_t hnd, bool &acquired) +{ + const unsigned long len = ((unsigned long)-1); + winapi::interprocess_overlapped overlapped; + std::memset(&overlapped, 0, sizeof(overlapped)); + if(!winapi::lock_file_ex + (hnd, winapi::lockfile_exclusive_lock | winapi::lockfile_fail_immediately, + 0, len, len, &overlapped)){ + return winapi::get_last_error() == winapi::error_lock_violation ? + acquired = false, true : false; + + } + return (acquired = true); +} + +inline bool release_file_lock(file_handle_t hnd) +{ + const unsigned long len = ((unsigned long)-1); + winapi::interprocess_overlapped overlapped; + std::memset(&overlapped, 0, sizeof(overlapped)); + return winapi::unlock_file_ex(hnd, 0, len, len, &overlapped); +} + +inline bool acquire_file_lock_sharable(file_handle_t hnd) +{ + const unsigned long len = ((unsigned long)-1); + winapi::interprocess_overlapped overlapped; + std::memset(&overlapped, 0, sizeof(overlapped)); + return winapi::lock_file_ex(hnd, 0, 0, len, len, &overlapped); +} + +inline bool try_acquire_file_lock_sharable(file_handle_t hnd, bool &acquired) +{ + const unsigned long len = ((unsigned long)-1); + winapi::interprocess_overlapped overlapped; + std::memset(&overlapped, 0, sizeof(overlapped)); + if(!winapi::lock_file_ex + (hnd, winapi::lockfile_fail_immediately, 0, len, len, &overlapped)){ + return winapi::get_last_error() == winapi::error_lock_violation ? + acquired = false, true : false; + } + return (acquired = true); +} + +inline bool release_file_lock_sharable(file_handle_t hnd) +{ return release_file_lock(hnd); } + +inline bool delete_subdirectories_recursive + (const std::string &refcstrRootDirectory, const char *dont_delete_this, unsigned int count) +{ + bool bSubdirectory = false; // Flag, indicating whether + // subdirectories have been found + void * hFile; // Handle to directory + std::string strFilePath; // Filepath + std::string strPattern; // Pattern + winapi::win32_find_data FileInformation; // File information + + //Find all files and directories + strPattern = refcstrRootDirectory + "\\*.*"; + hFile = winapi::find_first_file(strPattern.c_str(), &FileInformation); + if(hFile != winapi::invalid_handle_value){ + do{ + //If it's not "." or ".." or the pointed root_level dont_delete_this erase it + if(FileInformation.cFileName[0] != '.' && + !(dont_delete_this && count == 0 && std::strcmp(dont_delete_this, FileInformation.cFileName) == 0)){ + strFilePath.erase(); + strFilePath = refcstrRootDirectory + "\\" + FileInformation.cFileName; + + //If it's a directory, go recursive + if(FileInformation.dwFileAttributes & winapi::file_attribute_directory){ + // Delete subdirectory + if(!delete_subdirectories_recursive(strFilePath, dont_delete_this, count+1)){ + winapi::find_close(hFile); + return false; + } + } + //If it's a file, just delete it + else{ + // Set file attributes + //if(::SetFileAttributes(strFilePath.c_str(), winapi::file_attribute_normal) == 0) + //return winapi::get_last_error(); + // Delete file + winapi::unlink_file(strFilePath.c_str()); + } + } + //Go to the next file + } while(winapi::find_next_file(hFile, &FileInformation) == 1); + + // Close handle + winapi::find_close(hFile); + + //See if the loop has ended with an error or just because we've traversed all the files + if(winapi::get_last_error() != winapi::error_no_more_files){ + return false; + } + else + { + //Erase empty subdirectories or original refcstrRootDirectory + if(!bSubdirectory && count) + { + // Set directory attributes + //if(::SetFileAttributes(refcstrRootDirectory.c_str(), FILE_ATTRIBUTE_NORMAL) == 0) + //return ::GetLastError(); + // Delete directory + if(winapi::remove_directory(refcstrRootDirectory.c_str()) == 0) + return false; + } + } + } + return true; +} + +//This function erases all the subdirectories of a directory except the one pointed by "dont_delete_this" +inline bool delete_subdirectories(const std::string &refcstrRootDirectory, const char *dont_delete_this) +{ + return delete_subdirectories_recursive(refcstrRootDirectory, dont_delete_this, 0u); +} + + +template +inline bool for_each_file_in_dir(const char *dir, Function f) +{ + void * hFile; // Handle to directory + winapi::win32_find_data FileInformation; // File information + + //Get base directory + std::string str(dir); + const std::size_t base_root_dir_len = str.size(); + + //Find all files and directories + str += "\\*.*"; + hFile = winapi::find_first_file(str.c_str(), &FileInformation); + if(hFile != winapi::invalid_handle_value){ + do{ //Now loop every file + str.erase(base_root_dir_len); + //If it's not "." or ".." skip it + if(FileInformation.cFileName[0] != '.'){ + str += "\\"; str += FileInformation.cFileName; + //If it's a file, apply erase logic + if(!(FileInformation.dwFileAttributes & winapi::file_attribute_directory)){ + f(str.c_str(), FileInformation.cFileName); + } + } + //Go to the next file + } while(winapi::find_next_file(hFile, &FileInformation) == 1); + + // Close handle and see if the loop has ended with an error + winapi::find_close(hFile); + if(winapi::get_last_error() != winapi::error_no_more_files){ + return false; + } + } + return true; +} + + +#else //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +typedef int file_handle_t; +typedef off_t offset_t; + +typedef struct mapping_handle_impl_t +{ + file_handle_t handle; + bool is_xsi; +} mapping_handle_t; + +typedef enum { read_only = O_RDONLY + , read_write = O_RDWR + , copy_on_write + , read_private + , invalid_mode = 0xffff + } mode_t; + +typedef enum { file_begin = SEEK_SET + , file_end = SEEK_END + , file_current = SEEK_CUR + } file_pos_t; + +typedef int map_options_t; +static const map_options_t default_map_options = map_options_t(-1); + +namespace ipcdetail{ + +inline mapping_handle_t mapping_handle_from_file_handle(file_handle_t hnd) +{ + mapping_handle_t ret; + ret.handle = hnd; + ret.is_xsi = false; + return ret; +} + +inline file_handle_t file_handle_from_mapping_handle(mapping_handle_t hnd) +{ return hnd.handle; } + +inline bool create_directory(const char *path) +{ return ::mkdir(path, 0777) == 0 && ::chmod(path, 0777) == 0; } + +inline bool get_temporary_path(char *buffer, std::size_t buf_len, std::size_t &required_len) +{ + required_len = 5u; + if(buf_len < required_len) + return false; + else{ + std::strcpy(buffer, "/tmp"); + } + return true; +} + +inline file_handle_t create_new_file + (const char *name, mode_t mode, const permissions & perm = permissions(), bool temporary = false) +{ + (void)temporary; + int ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions()); + if(ret >= 0){ + ::fchmod(ret, perm.get_permissions()); + } + return ret; +} + +inline file_handle_t create_or_open_file + (const char *name, mode_t mode, const permissions & perm = permissions(), bool temporary = false) +{ + (void)temporary; + int ret = -1; + //We need a loop to change permissions correctly using fchmod, since + //with "O_CREAT only" ::open we don't know if we've created or opened the file. + while(1){ + ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions()); + if(ret >= 0){ + ::fchmod(ret, perm.get_permissions()); + break; + } + else if(errno == EEXIST){ + if((ret = ::open(name, (int)mode)) >= 0 || errno != ENOENT){ + break; + } + } + else{ + break; + } + } + return ret; +} + +inline file_handle_t open_existing_file + (const char *name, mode_t mode, bool temporary = false) +{ + (void)temporary; + return ::open(name, (int)mode); +} + +inline bool delete_file(const char *name) +{ return ::unlink(name) == 0; } + +inline bool truncate_file (file_handle_t hnd, std::size_t size) +{ + typedef autoboost::make_unsigned::type uoff_t; + if(uoff_t((std::numeric_limits::max)()) < size){ + errno = EINVAL; + return false; + } + return 0 == ::ftruncate(hnd, off_t(size)); +} + +inline bool get_file_size(file_handle_t hnd, offset_t &size) +{ + struct stat data; + bool ret = 0 == ::fstat(hnd, &data); + if(ret){ + size = data.st_size; + } + return ret; +} + +inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos) +{ return ((off_t)(-1)) != ::lseek(hnd, off, (int)pos); } + +inline bool get_file_pointer(file_handle_t hnd, offset_t &off) +{ + off = ::lseek(hnd, 0, SEEK_CUR); + return off != ((off_t)-1); +} + +inline bool write_file(file_handle_t hnd, const void *data, std::size_t numdata) +{ return (ssize_t(numdata)) == ::write(hnd, data, numdata); } + +inline file_handle_t invalid_file() +{ return -1; } + +inline bool close_file(file_handle_t hnd) +{ return ::close(hnd) == 0; } + +inline bool acquire_file_lock(file_handle_t hnd) +{ + struct ::flock lock; + lock.l_type = F_WRLCK; + lock.l_whence = SEEK_SET; + lock.l_start = 0; + lock.l_len = 0; + return -1 != ::fcntl(hnd, F_SETLKW, &lock); +} + +inline bool try_acquire_file_lock(file_handle_t hnd, bool &acquired) +{ + struct ::flock lock; + lock.l_type = F_WRLCK; + lock.l_whence = SEEK_SET; + lock.l_start = 0; + lock.l_len = 0; + int ret = ::fcntl(hnd, F_SETLK, &lock); + if(ret == -1){ + return (errno == EAGAIN || errno == EACCES) ? + acquired = false, true : false; + } + return (acquired = true); +} + +inline bool release_file_lock(file_handle_t hnd) +{ + struct ::flock lock; + lock.l_type = F_UNLCK; + lock.l_whence = SEEK_SET; + lock.l_start = 0; + lock.l_len = 0; + return -1 != ::fcntl(hnd, F_SETLK, &lock); +} + +inline bool acquire_file_lock_sharable(file_handle_t hnd) +{ + struct ::flock lock; + lock.l_type = F_RDLCK; + lock.l_whence = SEEK_SET; + lock.l_start = 0; + lock.l_len = 0; + return -1 != ::fcntl(hnd, F_SETLKW, &lock); +} + +inline bool try_acquire_file_lock_sharable(file_handle_t hnd, bool &acquired) +{ + struct flock lock; + lock.l_type = F_RDLCK; + lock.l_whence = SEEK_SET; + lock.l_start = 0; + lock.l_len = 0; + int ret = ::fcntl(hnd, F_SETLK, &lock); + if(ret == -1){ + return (errno == EAGAIN || errno == EACCES) ? + acquired = false, true : false; + } + return (acquired = true); +} + +inline bool release_file_lock_sharable(file_handle_t hnd) +{ return release_file_lock(hnd); } + +#if 0 +inline bool acquire_file_lock(file_handle_t hnd) +{ return 0 == ::flock(hnd, LOCK_EX); } + +inline bool try_acquire_file_lock(file_handle_t hnd, bool &acquired) +{ + int ret = ::flock(hnd, LOCK_EX | LOCK_NB); + acquired = ret == 0; + return (acquired || errno == EWOULDBLOCK); +} + +inline bool release_file_lock(file_handle_t hnd) +{ return 0 == ::flock(hnd, LOCK_UN); } + +inline bool acquire_file_lock_sharable(file_handle_t hnd) +{ return 0 == ::flock(hnd, LOCK_SH); } + +inline bool try_acquire_file_lock_sharable(file_handle_t hnd, bool &acquired) +{ + int ret = ::flock(hnd, LOCK_SH | LOCK_NB); + acquired = ret == 0; + return (acquired || errno == EWOULDBLOCK); +} + +inline bool release_file_lock_sharable(file_handle_t hnd) +{ return 0 == ::flock(hnd, LOCK_UN); } +#endif + +inline bool delete_subdirectories_recursive + (const std::string &refcstrRootDirectory, const char *dont_delete_this) +{ + DIR *d = opendir(refcstrRootDirectory.c_str()); + if(!d) { + return false; + } + + struct dir_close + { + DIR *d_; + dir_close(DIR *d) : d_(d) {} + ~dir_close() { ::closedir(d_); } + } dc(d); (void)dc; + + struct ::dirent *de; + struct ::stat st; + std::string fn; + + while((de=::readdir(d))) { + if( de->d_name[0] == '.' && ( de->d_name[1] == '\0' + || (de->d_name[1] == '.' && de->d_name[2] == '\0' )) ){ + continue; + } + if(dont_delete_this && std::strcmp(dont_delete_this, de->d_name) == 0){ + continue; + } + fn = refcstrRootDirectory; + fn += '/'; + fn += de->d_name; + + if(std::remove(fn.c_str())) { + if(::stat(fn.c_str(), & st)) { + return false; + } + if(S_ISDIR(st.st_mode)) { + if(!delete_subdirectories_recursive(fn, 0) ){ + return false; + } + } else { + return false; + } + } + } + return std::remove(refcstrRootDirectory.c_str()) ? false : true; +} + +template +inline bool for_each_file_in_dir(const char *dir, Function f) +{ + std::string refcstrRootDirectory(dir); + + DIR *d = opendir(refcstrRootDirectory.c_str()); + if(!d) { + return false; + } + + struct dir_close + { + DIR *d_; + dir_close(DIR *d) : d_(d) {} + ~dir_close() { ::closedir(d_); } + } dc(d); (void)dc; + + struct ::dirent *de; + struct ::stat st; + std::string fn; + + while((de=::readdir(d))) { + if( de->d_name[0] == '.' && ( de->d_name[1] == '\0' + || (de->d_name[1] == '.' && de->d_name[2] == '\0' )) ){ + continue; + } + fn = refcstrRootDirectory; + fn += '/'; + fn += de->d_name; + + if(::stat(fn.c_str(), & st)) { + return false; + } + //If it's a file, apply erase logic + if(!S_ISDIR(st.st_mode)) { + f(fn.c_str(), de->d_name); + } + } + return true; +} + + +//This function erases all the subdirectories of a directory except the one pointed by "dont_delete_this" +inline bool delete_subdirectories(const std::string &refcstrRootDirectory, const char *dont_delete_this) +{ + return delete_subdirectories_recursive(refcstrRootDirectory, dont_delete_this ); +} + +#endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +inline bool open_or_create_directory(const char *dir_name) +{ + //If fails, check that it's because it already exists + if(!create_directory(dir_name)){ + error_info info(system_error_code()); + if(info.get_error_code() != already_exists_error){ + return false; + } + } + return true; +} + +inline std::string get_temporary_path() +{ + std::size_t required_len = 0; + get_temporary_path(0, 0, required_len); + std::string ret_str(required_len, char(0)); + get_temporary_path(&ret_str[0], ret_str.size(), required_len); + while(!ret_str.empty() && !ret_str[ret_str.size()-1]){ + ret_str.erase(ret_str.size()-1); + } + + return ret_str; +} + +} //namespace ipcdetail{ +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_DETAIL_OS_FILE_FUNCTIONS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/detail/os_thread_functions.hpp b/contrib/autoboost/autoboost/interprocess/detail/os_thread_functions.hpp new file mode 100644 index 000000000..74424609d --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/os_thread_functions.hpp @@ -0,0 +1,598 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2013. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +//Thread launching functions are adapted from boost/detail/lightweight_thread.hpp +// +// boost/detail/lightweight_thread.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2008 Peter Dimov +// +// 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 + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_OS_THREAD_FUNCTIONS_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_OS_THREAD_FUNCTIONS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include + +#if defined(AUTOBOOST_INTERPROCESS_WINDOWS) +# include +# include +#else +# include +# include +# include +# include +# ifdef AUTOBOOST_INTERPROCESS_BSD_DERIVATIVE + //Some *BSD systems (OpenBSD & NetBSD) need sys/param.h before sys/sysctl.h, whereas + //others (FreeBSD & Darwin) need sys/types.h +# include +# include +# include +# endif +//According to the article "C/C++ tip: How to measure elapsed real time for benchmarking" +# if defined(CLOCK_MONOTONIC_PRECISE) //BSD +# define AUTOBOOST_INTERPROCESS_CLOCK_MONOTONIC CLOCK_MONOTONIC_PRECISE +# elif defined(CLOCK_MONOTONIC_RAW) //Linux +# define AUTOBOOST_INTERPROCESS_CLOCK_MONOTONIC CLOCK_MONOTONIC_RAW +# elif defined(CLOCK_HIGHRES) //Solaris +# define AUTOBOOST_INTERPROCESS_CLOCK_MONOTONIC CLOCK_HIGHRES +# elif defined(CLOCK_MONOTONIC) //POSIX (AIX, BSD, Linux, Solaris) +# define AUTOBOOST_INTERPROCESS_CLOCK_MONOTONIC CLOCK_MONOTONIC +# elif !defined(CLOCK_MONOTONIC) && (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) +# include // mach_absolute_time, mach_timebase_info_data_t +# define AUTOBOOST_INTERPROCESS_MATCH_ABSOLUTE_TIME +# else +# error "No high resolution steady clock in your system, please provide a patch" +# endif +#endif + +namespace autoboost { +namespace interprocess { +namespace ipcdetail{ + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +typedef unsigned long OS_process_id_t; +typedef unsigned long OS_thread_id_t; +typedef void* OS_thread_t; +typedef OS_thread_id_t OS_systemwide_thread_id_t; + +//process +inline OS_process_id_t get_current_process_id() +{ return winapi::get_current_process_id(); } + +inline OS_process_id_t get_invalid_process_id() +{ return OS_process_id_t(0); } + +//thread +inline OS_thread_id_t get_current_thread_id() +{ return winapi::get_current_thread_id(); } + +inline OS_thread_id_t get_invalid_thread_id() +{ return OS_thread_id_t(0xffffffff); } + +inline bool equal_thread_id(OS_thread_id_t id1, OS_thread_id_t id2) +{ return id1 == id2; } + +//return the system tick in ns +inline unsigned long get_system_tick_ns() +{ + unsigned long curres; + winapi::set_timer_resolution(10000, 0, &curres); + //Windows API returns the value in hundreds of ns + return (curres - 1ul)*100ul; +} + +//return the system tick in us +inline unsigned long get_system_tick_us() +{ + unsigned long curres; + winapi::set_timer_resolution(10000, 0, &curres); + //Windows API returns the value in hundreds of ns + return (curres - 1ul)/10ul + 1ul; +} + +typedef unsigned __int64 OS_highres_count_t; + +inline unsigned long get_system_tick_in_highres_counts() +{ + __int64 freq; + unsigned long curres; + winapi::set_timer_resolution(10000, 0, &curres); + //Frequency in counts per second + if(!winapi::query_performance_frequency(&freq)){ + //Tick resolution in ms + return (curres-1ul)/10000ul + 1ul; + } + else{ + //In femtoseconds + __int64 count_fs = (1000000000000000LL - 1LL)/freq + 1LL; + __int64 tick_counts = (static_cast<__int64>(curres)*100000000LL - 1LL)/count_fs + 1LL; + return static_cast(tick_counts); + } +} + +inline OS_highres_count_t get_current_system_highres_count() +{ + __int64 count; + if(!winapi::query_performance_counter(&count)){ + count = winapi::get_tick_count(); + } + return count; +} + +inline void zero_highres_count(OS_highres_count_t &count) +{ count = 0; } + +inline bool is_highres_count_zero(const OS_highres_count_t &count) +{ return count == 0; } + +template +inline Ostream &ostream_highres_count(Ostream &ostream, const OS_highres_count_t &count) +{ + ostream << count; + return ostream; +} + +inline OS_highres_count_t system_highres_count_subtract(const OS_highres_count_t &l, const OS_highres_count_t &r) +{ return l - r; } + +inline bool system_highres_count_less(const OS_highres_count_t &l, const OS_highres_count_t &r) +{ return l < r; } + +inline bool system_highres_count_less_ul(const OS_highres_count_t &l, unsigned long r) +{ return l < static_cast(r); } + +inline void thread_sleep_tick() +{ winapi::sleep_tick(); } + +inline void thread_yield() +{ winapi::sched_yield(); } + +inline void thread_sleep(unsigned int ms) +{ winapi::sleep(ms); } + +//systemwide thread +inline OS_systemwide_thread_id_t get_current_systemwide_thread_id() +{ + return get_current_thread_id(); +} + +inline void systemwide_thread_id_copy + (const volatile OS_systemwide_thread_id_t &from, volatile OS_systemwide_thread_id_t &to) +{ + to = from; +} + +inline bool equal_systemwide_thread_id(const OS_systemwide_thread_id_t &id1, const OS_systemwide_thread_id_t &id2) +{ + return equal_thread_id(id1, id2); +} + +inline OS_systemwide_thread_id_t get_invalid_systemwide_thread_id() +{ + return get_invalid_thread_id(); +} + +inline long double get_current_process_creation_time() +{ + winapi::interprocess_filetime CreationTime, ExitTime, KernelTime, UserTime; + + winapi::get_process_times + ( winapi::get_current_process(), &CreationTime, &ExitTime, &KernelTime, &UserTime); + + typedef long double ldouble_t; + const ldouble_t resolution = (100.0l/1000000000.0l); + return CreationTime.dwHighDateTime*(ldouble_t(1u<<31u)*2.0l*resolution) + + CreationTime.dwLowDateTime*resolution; +} + +inline unsigned int get_num_cores() +{ + winapi::system_info sysinfo; + winapi::get_system_info( &sysinfo ); + //in Windows dw is long which is equal in bits to int + return static_cast(sysinfo.dwNumberOfProcessors); +} + +#else //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +typedef pthread_t OS_thread_t; +typedef pthread_t OS_thread_id_t; +typedef pid_t OS_process_id_t; + +struct OS_systemwide_thread_id_t +{ + OS_systemwide_thread_id_t() + : pid(), tid() + {} + + OS_systemwide_thread_id_t(pid_t p, pthread_t t) + : pid(p), tid(t) + {} + + OS_systemwide_thread_id_t(const OS_systemwide_thread_id_t &x) + : pid(x.pid), tid(x.tid) + {} + + OS_systemwide_thread_id_t(const volatile OS_systemwide_thread_id_t &x) + : pid(x.pid), tid(x.tid) + {} + + OS_systemwide_thread_id_t & operator=(const OS_systemwide_thread_id_t &x) + { pid = x.pid; tid = x.tid; return *this; } + + OS_systemwide_thread_id_t & operator=(const volatile OS_systemwide_thread_id_t &x) + { pid = x.pid; tid = x.tid; return *this; } + + void operator=(const OS_systemwide_thread_id_t &x) volatile + { pid = x.pid; tid = x.tid; } + + pid_t pid; + pthread_t tid; +}; + +inline void systemwide_thread_id_copy + (const volatile OS_systemwide_thread_id_t &from, volatile OS_systemwide_thread_id_t &to) +{ + to.pid = from.pid; + to.tid = from.tid; +} + +//process +inline OS_process_id_t get_current_process_id() +{ return ::getpid(); } + +inline OS_process_id_t get_invalid_process_id() +{ return pid_t(0); } + +//thread +inline OS_thread_id_t get_current_thread_id() +{ return ::pthread_self(); } + +inline OS_thread_id_t get_invalid_thread_id() +{ + static pthread_t invalid_id; + return invalid_id; +} + +inline bool equal_thread_id(OS_thread_id_t id1, OS_thread_id_t id2) +{ return 0 != pthread_equal(id1, id2); } + +inline void thread_yield() +{ ::sched_yield(); } + +#ifndef AUTOBOOST_INTERPROCESS_MATCH_ABSOLUTE_TIME +typedef struct timespec OS_highres_count_t; +#else +typedef unsigned long long OS_highres_count_t; +#endif + +inline unsigned long get_system_tick_ns() +{ + #ifdef _SC_CLK_TCK + long ticks_per_second =::sysconf(_SC_CLK_TCK); // ticks per sec + if(ticks_per_second <= 0){ //Try a typical value on error + ticks_per_second = 100; + } + return 999999999ul/static_cast(ticks_per_second)+1ul; + #else + #error "Can't obtain system tick value for your system, please provide a patch" + #endif +} + +inline unsigned long get_system_tick_in_highres_counts() +{ + #ifndef AUTOBOOST_INTERPROCESS_MATCH_ABSOLUTE_TIME + return get_system_tick_ns(); + #else + mach_timebase_info_data_t info; + mach_timebase_info(&info); + //ns + return static_cast + ( + static_cast(get_system_tick_ns()) + / (static_cast(info.numer) / info.denom) + ); + #endif +} + +//return system ticks in us +inline unsigned long get_system_tick_us() +{ + return (get_system_tick_ns()-1)/1000ul + 1ul; +} + +inline OS_highres_count_t get_current_system_highres_count() +{ + #if defined(AUTOBOOST_INTERPROCESS_CLOCK_MONOTONIC) + struct timespec count; + ::clock_gettime(AUTOBOOST_INTERPROCESS_CLOCK_MONOTONIC, &count); + return count; + #elif defined(AUTOBOOST_INTERPROCESS_MATCH_ABSOLUTE_TIME) + return ::mach_absolute_time(); + #endif +} + +#ifndef AUTOBOOST_INTERPROCESS_MATCH_ABSOLUTE_TIME + +inline void zero_highres_count(OS_highres_count_t &count) +{ count.tv_sec = 0; count.tv_nsec = 0; } + +inline bool is_highres_count_zero(const OS_highres_count_t &count) +{ return count.tv_sec == 0 && count.tv_nsec == 0; } + +template +inline Ostream &ostream_highres_count(Ostream &ostream, const OS_highres_count_t &count) +{ + ostream << count.tv_sec << "s:" << count.tv_nsec << "ns"; + return ostream; +} + +inline OS_highres_count_t system_highres_count_subtract(const OS_highres_count_t &l, const OS_highres_count_t &r) +{ + OS_highres_count_t res; + + if (l.tv_nsec < r.tv_nsec){ + res.tv_nsec = 1000000000 + l.tv_nsec - r.tv_nsec; + res.tv_sec = l.tv_sec - 1 - r.tv_sec; + } + else{ + res.tv_nsec = l.tv_nsec - r.tv_nsec; + res.tv_sec = l.tv_sec - r.tv_sec; + } + + return res; +} + +inline bool system_highres_count_less(const OS_highres_count_t &l, const OS_highres_count_t &r) +{ return l.tv_sec < r.tv_sec || (l.tv_sec == r.tv_sec && l.tv_nsec < r.tv_nsec); } + +inline bool system_highres_count_less_ul(const OS_highres_count_t &l, unsigned long r) +{ return !l.tv_sec && (static_cast(l.tv_nsec) < r); } + +#else + +inline void zero_highres_count(OS_highres_count_t &count) +{ count = 0; } + +inline bool is_highres_count_zero(const OS_highres_count_t &count) +{ return count == 0; } + +template +inline Ostream &ostream_highres_count(Ostream &ostream, const OS_highres_count_t &count) +{ + ostream << count ; + return ostream; +} + +inline OS_highres_count_t system_highres_count_subtract(const OS_highres_count_t &l, const OS_highres_count_t &r) +{ return l - r; } + +inline bool system_highres_count_less(const OS_highres_count_t &l, const OS_highres_count_t &r) +{ return l < r; } + +inline bool system_highres_count_less_ul(const OS_highres_count_t &l, unsigned long r) +{ return l < static_cast(r); } + +#endif + +inline void thread_sleep_tick() +{ + struct timespec rqt; + //Sleep for the half of the tick time + rqt.tv_sec = 0; + rqt.tv_nsec = get_system_tick_ns()/2; + ::nanosleep(&rqt, 0); +} + +inline void thread_sleep(unsigned int ms) +{ + struct timespec rqt; + rqt.tv_sec = ms/1000u; + rqt.tv_nsec = (ms%1000u)*1000000u; + ::nanosleep(&rqt, 0); +} + +//systemwide thread +inline OS_systemwide_thread_id_t get_current_systemwide_thread_id() +{ + return OS_systemwide_thread_id_t(::getpid(), ::pthread_self()); +} + +inline bool equal_systemwide_thread_id(const OS_systemwide_thread_id_t &id1, const OS_systemwide_thread_id_t &id2) +{ + return (0 != pthread_equal(id1.tid, id2.tid)) && (id1.pid == id2.pid); +} + +inline OS_systemwide_thread_id_t get_invalid_systemwide_thread_id() +{ + return OS_systemwide_thread_id_t(get_invalid_process_id(), get_invalid_thread_id()); +} + +inline long double get_current_process_creation_time() +{ return 0.0L; } + +inline unsigned int get_num_cores() +{ + #ifdef _SC_NPROCESSORS_ONLN + long cores = ::sysconf(_SC_NPROCESSORS_ONLN); + // sysconf returns -1 if the name is invalid, the option does not exist or + // does not have a definite limit. + // if sysconf returns some other negative number, we have no idea + // what is going on. Default to something safe. + if(cores <= 0){ + return 1; + } + //Check for overflow (unlikely) + else if(static_cast(cores) >= + static_cast(static_cast(-1))){ + return static_cast(-1); + } + else{ + return static_cast(cores); + } + #elif defined(AUTOBOOST_INTERPROCESS_BSD_DERIVATIVE) && defined(HW_NCPU) + int request[2] = { CTL_HW, HW_NCPU }; + int num_cores; + std::size_t result_len = sizeof(num_cores); + if ( (::sysctl (request, 2, &num_cores, &result_len, 0, 0) < 0) || (num_cores <= 0) ){ + //Return a safe value + return 1; + } + else{ + return static_cast(num_cores); + } + #endif +} + +inline int thread_create(OS_thread_t * thread, void *(*start_routine)(void*), void* arg) +{ return pthread_create(thread, 0, start_routine, arg); } + +inline void thread_join(OS_thread_t thread) +{ (void)pthread_join(thread, 0); } + +#endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +typedef char pid_str_t[sizeof(OS_process_id_t)*3+1]; + +inline void get_pid_str(pid_str_t &pid_str, OS_process_id_t pid) +{ + bufferstream bstream(pid_str, sizeof(pid_str)); + bstream << pid << std::ends; +} + +inline void get_pid_str(pid_str_t &pid_str) +{ get_pid_str(pid_str, get_current_process_id()); } + +#if defined(AUTOBOOST_INTERPROCESS_WINDOWS) + +inline int thread_create( OS_thread_t * thread, unsigned (__stdcall * start_routine) (void*), void* arg ) +{ + void* h = (void*)_beginthreadex( 0, 0, start_routine, arg, 0, 0 ); + + if( h != 0 ){ + *thread = h; + return 0; + } + else{ + return 1; + } +} + +inline void thread_join( OS_thread_t thread) +{ + winapi::wait_for_single_object( thread, winapi::infinite_time ); + winapi::close_handle( thread ); +} + +#endif + +class abstract_thread +{ + public: + virtual ~abstract_thread() {} + virtual void run() = 0; +}; + +template +class os_thread_func_ptr_deleter +{ + public: + explicit os_thread_func_ptr_deleter(T* p) + : m_p(p) + {} + + T *release() + { T *p = m_p; m_p = 0; return p; } + + T *get() const + { return m_p; } + + T *operator ->() const + { return m_p; } + + ~os_thread_func_ptr_deleter() + { delete m_p; } + + private: + T *m_p; +}; + +#if defined(AUTOBOOST_INTERPROCESS_WINDOWS) + +inline unsigned __stdcall launch_thread_routine( void * pv ) +{ + os_thread_func_ptr_deleter pt( static_cast( pv ) ); + pt->run(); + return 0; +} + +#else + +extern "C" void * launch_thread_routine( void * pv ); + +inline void * launch_thread_routine( void * pv ) +{ + os_thread_func_ptr_deleter pt( static_cast( pv ) ); + pt->run(); + return 0; +} + +#endif + +template +class launch_thread_impl + : public abstract_thread +{ + public: + explicit launch_thread_impl( F f ) + : f_( f ) + {} + + void run() + { f_(); } + + private: + F f_; +}; + +template +inline int thread_launch( OS_thread_t & pt, F f ) +{ + os_thread_func_ptr_deleter p( new launch_thread_impl( f ) ); + + int r = thread_create(&pt, launch_thread_routine, p.get()); + if( r == 0 ){ + p.release(); + } + + return r; +} + +} //namespace ipcdetail{ +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_DETAIL_OS_THREAD_FUNCTIONS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/detail/posix_time_types_wrk.hpp b/contrib/autoboost/autoboost/interprocess/detail/posix_time_types_wrk.hpp new file mode 100644 index 000000000..da7f5d064 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/posix_time_types_wrk.hpp @@ -0,0 +1,46 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_POSIX_TIMES_WRK_HPP +#define AUTOBOOST_INTERPROCESS_POSIX_TIMES_WRK_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +//workaround to avoid winsock redefines when using date-time + +#ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#define AUTOBOOST_INTERPROCESS_WIN32_LEAN_AND_MEAN +#endif //#ifndef WIN32_LEAN_AND_MEAN +#endif //#ifdef _WIN32 + +#include +#include + +namespace autoboost { +namespace interprocess { + +typedef autoboost::date_time::microsec_clock microsec_clock; + +} +} + +#ifdef _WIN32 +#ifdef AUTOBOOST_INTERPROCESS_WIN32_LEAN_AND_MEAN +#undef WIN32_LEAN_AND_MEAN +#undef AUTOBOOST_INTERPROCESS_WIN32_LEAN_AND_MEAN +#endif //#ifdef AUTOBOOST_INTERPROCESS_WIN32_LEAN_AND_MEAN +#endif //#ifdef _WIN32 + +#endif //#ifndef AUTOBOOST_INTERPROCESS_POSIX_TIMES_WRK_HPP + diff --git a/contrib/autoboost/autoboost/interprocess/detail/shared_dir_helpers.hpp b/contrib/autoboost/autoboost/interprocess/detail/shared_dir_helpers.hpp new file mode 100644 index 000000000..dac8926dd --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/shared_dir_helpers.hpp @@ -0,0 +1,195 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2007-2014. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_SHARED_DIR_HELPERS_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_SHARED_DIR_HELPERS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include + +#if defined(AUTOBOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME) && defined(AUTOBOOST_INTERPROCESS_WINDOWS) + #include +#endif + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +#if defined(AUTOBOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME) + #if defined(AUTOBOOST_INTERPROCESS_WINDOWS) + //This type will initialize the stamp + struct windows_bootstamp + { + windows_bootstamp() + { + //Throw if bootstamp not available + if(!winapi::get_last_bootup_time(stamp)){ + error_info err = system_error_code(); + throw interprocess_exception(err); + } + } + //Use std::string. Even if this will be constructed in shared memory, all + //modules/dlls are from this process so internal raw pointers to heap are always valid + std::string stamp; + }; + + inline void get_bootstamp(std::string &s, bool add = false) + { + const windows_bootstamp &bootstamp = windows_intermodule_singleton::get(); + if(add){ + s += bootstamp.stamp; + } + else{ + s = bootstamp.stamp; + } + } + #elif defined(AUTOBOOST_INTERPROCESS_HAS_BSD_KERNEL_BOOTTIME) + inline void get_bootstamp(std::string &s, bool add = false) + { + // FreeBSD specific: sysctl "kern.boottime" + int request[2] = { CTL_KERN, KERN_BOOTTIME }; + struct ::timeval result; + std::size_t result_len = sizeof result; + + if (::sysctl (request, 2, &result, &result_len, 0, 0) < 0) + return; + + char bootstamp_str[256]; + + const char Characters [] = + { '0', '1', '2', '3', '4', '5', '6', '7' + , '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + std::size_t char_counter = 0; + //32 bit values to allow 32 and 64 bit process IPC + autoboost::uint32_t fields[2] = { autoboost::uint32_t(result.tv_sec), autoboost::uint32_t(result.tv_usec) }; + for(std::size_t field = 0; field != 2; ++field){ + for(std::size_t i = 0; i != sizeof(fields[0]); ++i){ + const char *ptr = (const char *)&fields[field]; + bootstamp_str[char_counter++] = Characters[(ptr[i]&0xF0)>>4]; + bootstamp_str[char_counter++] = Characters[(ptr[i]&0x0F)]; + } + } + bootstamp_str[char_counter] = 0; + if(add){ + s += bootstamp_str; + } + else{ + s = bootstamp_str; + } + } + #else + #error "AUTOBOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME defined with no known implementation" + #endif +#endif //#if defined(AUTOBOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME) + +inline void get_shared_dir_root(std::string &dir_path) +{ + #if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + winapi::get_shared_documents_folder(dir_path); + #else + dir_path = "/tmp"; + #endif + //We always need this path, so throw on error + if(dir_path.empty()){ + error_info err = system_error_code(); + throw interprocess_exception(err); + } + //Remove final null. + dir_path += "/boost_interprocess"; +} + +inline void get_shared_dir(std::string &shared_dir) +{ + #if defined(AUTOBOOST_INTERPROCESS_SHARED_DIR_PATH) + shared_dir = AUTOBOOST_INTERPROCESS_SHARED_DIR_PATH; + #else + get_shared_dir_root(shared_dir); + #if defined(AUTOBOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME) + shared_dir += "/"; + get_bootstamp(shared_dir, true); + #endif + #endif +} + +inline void shared_filepath(const char *filename, std::string &filepath) +{ + get_shared_dir(filepath); + filepath += "/"; + filepath += filename; +} + +inline void create_shared_dir_and_clean_old(std::string &shared_dir) +{ + #if defined(AUTOBOOST_INTERPROCESS_SHARED_DIR_PATH) + shared_dir = AUTOBOOST_INTERPROCESS_SHARED_DIR_PATH; + #else + //First get the temp directory + std::string root_shared_dir; + get_shared_dir_root(root_shared_dir); + + //If fails, check that it's because already exists + if(!create_directory(root_shared_dir.c_str())){ + error_info info(system_error_code()); + if(info.get_error_code() != already_exists_error){ + throw interprocess_exception(info); + } + } + + #if defined(AUTOBOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME) + get_shared_dir(shared_dir); + + //If fails, check that it's because already exists + if(!create_directory(shared_dir.c_str())){ + error_info info(system_error_code()); + if(info.get_error_code() != already_exists_error){ + throw interprocess_exception(info); + } + } + //Now erase all old directories created in the previous boot sessions + std::string subdir = shared_dir; + subdir.erase(0, root_shared_dir.size()+1); + delete_subdirectories(root_shared_dir, subdir.c_str()); + #else + shared_dir = root_shared_dir; + #endif + #endif +} + +inline void create_shared_dir_cleaning_old_and_get_filepath(const char *filename, std::string &shared_dir) +{ + create_shared_dir_and_clean_old(shared_dir); + shared_dir += "/"; + shared_dir += filename; +} + +inline void add_leading_slash(const char *name, std::string &new_name) +{ + if(name[0] != '/'){ + new_name = '/'; + } + new_name += name; +} + +} //namespace autoboost{ +} //namespace interprocess { +} //namespace ipcdetail { + +#include + +#endif //ifndef AUTOBOOST_INTERPROCESS_DETAIL_SHARED_DIR_HELPERS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/detail/transform_iterator.hpp b/contrib/autoboost/autoboost/interprocess/detail/transform_iterator.hpp new file mode 100644 index 000000000..7b280bc4b --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/transform_iterator.hpp @@ -0,0 +1,195 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. +// (C) Copyright Gennaro Prota 2003 - 2004. +// +// 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_TRANSFORM_ITERATORS_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_TRANSFORM_ITERATORS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include + +#include +#include + +namespace autoboost { +namespace interprocess { + +template +struct operator_arrow_proxy +{ + operator_arrow_proxy(const PseudoReference &px) + : m_value(px) + {} + + PseudoReference* operator->() const { return &m_value; } + // This function is needed for MWCW and BCC, which won't call operator-> + // again automatically per 13.3.1.2 para 8 +// operator T*() const { return &m_value; } + mutable PseudoReference m_value; +}; + +template +struct operator_arrow_proxy +{ + operator_arrow_proxy(T &px) + : m_value(px) + {} + + T* operator->() const { return const_cast(&m_value); } + // This function is needed for MWCW and BCC, which won't call operator-> + // again automatically per 13.3.1.2 para 8 +// operator T*() const { return &m_value; } + T &m_value; +}; + +template +class transform_iterator + : public UnaryFunction + , public std::iterator + < typename std::iterator_traits::iterator_category + , typename ipcdetail::remove_reference::type + , typename std::iterator_traits::difference_type + , operator_arrow_proxy + , typename UnaryFunction::result_type> +{ + public: + explicit transform_iterator(const Iterator &it, const UnaryFunction &f = UnaryFunction()) + : UnaryFunction(f), m_it(it) + {} + + explicit transform_iterator() + : UnaryFunction(), m_it() + {} + + //Constructors + transform_iterator& operator++() + { increment(); return *this; } + + transform_iterator operator++(int) + { + transform_iterator result (*this); + increment(); + return result; + } + + transform_iterator& operator--() + { decrement(); return *this; } + + transform_iterator operator--(int) + { + transform_iterator result (*this); + decrement(); + return result; + } + + friend bool operator== (const transform_iterator& i, const transform_iterator& i2) + { return i.equal(i2); } + + friend bool operator!= (const transform_iterator& i, const transform_iterator& i2) + { return !(i == i2); } + + friend bool operator< (const transform_iterator& i, const transform_iterator& i2) + { return i < i2; } + + friend bool operator> (const transform_iterator& i, const transform_iterator& i2) + { return i2 < i; } + + friend bool operator<= (const transform_iterator& i, const transform_iterator& i2) + { return !(i > i2); } + + friend bool operator>= (const transform_iterator& i, const transform_iterator& i2) + { return !(i < i2); } + + friend typename std::iterator_traits::difference_type operator- (const transform_iterator& i, const transform_iterator& i2) + { return i2.distance_to(i); } + + //Arithmetic + transform_iterator& operator+=(typename std::iterator_traits::difference_type off) + { this->advance(off); return *this; } + + transform_iterator operator+(typename std::iterator_traits::difference_type off) const + { + transform_iterator other(*this); + other.advance(off); + return other; + } + + friend transform_iterator operator+(typename std::iterator_traits::difference_type off, const transform_iterator& right) + { return right + off; } + + transform_iterator& operator-=(typename std::iterator_traits::difference_type off) + { this->advance(-off); return *this; } + + transform_iterator operator-(typename std::iterator_traits::difference_type off) const + { return *this + (-off); } + + typename UnaryFunction::result_type operator*() const + { return dereference(); } + + typename UnaryFunction::result_type operator[](typename std::iterator_traits::difference_type off) const + { return UnaryFunction::operator()(m_it[off]); } + + operator_arrow_proxy + operator->() const + { return operator_arrow_proxy(dereference()); } + + Iterator & base() + { return m_it; } + + const Iterator & base() const + { return m_it; } + + private: + Iterator m_it; + + void increment() + { ++m_it; } + + void decrement() + { --m_it; } + + bool equal(const transform_iterator &other) const + { return m_it == other.m_it; } + + bool less(const transform_iterator &other) const + { return other.m_it < m_it; } + + typename UnaryFunction::result_type dereference() const + { return UnaryFunction::operator()(*m_it); } + + void advance(typename std::iterator_traits::difference_type n) + { std::advance(m_it, n); } + + typename std::iterator_traits::difference_type distance_to(const transform_iterator &other)const + { return std::distance(other.m_it, m_it); } +}; + +template +transform_iterator +make_transform_iterator(Iterator it, UnaryFunc fun) +{ + return transform_iterator(it, fun); +} + +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DETAIL_TRANSFORM_ITERATORS_HPP + diff --git a/contrib/autoboost/autoboost/interprocess/detail/type_traits.hpp b/contrib/autoboost/autoboost/interprocess/detail/type_traits.hpp new file mode 100644 index 000000000..7d285507b --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/type_traits.hpp @@ -0,0 +1,158 @@ +////////////////////////////////////////////////////////////////////////////// +// (C) Copyright John Maddock 2000. +// (C) Copyright Ion Gaztanaga 2005-2012. +// +// 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +struct nat{}; + +template +struct remove_reference +{ + typedef T type; +}; + +template +struct remove_reference +{ + typedef T type; +}; + +template +struct is_reference +{ + static const bool value = false; +}; + +template +struct is_reference +{ + static const bool value = true; +}; + +template +struct is_pointer +{ + static const bool value = false; +}; + +template +struct is_pointer +{ + static const bool value = true; +}; + +template +struct add_reference +{ + typedef T& type; +}; + +template +struct add_reference +{ + typedef T& type; +}; + +template<> +struct add_reference +{ + typedef nat &type; +}; + +template<> +struct add_reference +{ + typedef const nat &type; +}; + +template +struct add_const_reference +{ typedef const T &type; }; + +template +struct add_const_reference +{ typedef T& type; }; + +template +struct remove_const +{ + typedef T type; +}; + +template +struct remove_const +{ + typedef T type; +}; + +template +struct remove_volatile +{ + typedef T type; +}; + +template +struct remove_volatile +{ + typedef T type; +}; + +template +struct remove_const_volatile +{ + typedef typename remove_const::type>::type type; +}; + +template +struct is_same +{ + typedef char yes_type; + struct no_type + { + char padding[8]; + }; + + template + static yes_type is_same_tester(V*, V*); + static no_type is_same_tester(...); + + static T *t; + static U *u; + + static const bool value = sizeof(yes_type) == sizeof(is_same_tester(t,u)); +}; + +template +struct is_cv_same +{ + static const bool value = is_same< typename remove_const_volatile::type + , typename remove_const_volatile::type >::value; +}; + +} // namespace ipcdetail +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/detail/utilities.hpp b/contrib/autoboost/autoboost/interprocess/detail/utilities.hpp new file mode 100644 index 000000000..788ac3585 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/utilities.hpp @@ -0,0 +1,220 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. +// (C) Copyright Gennaro Prota 2003 - 2004. +// +// 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_UTILITIES_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_UTILITIES_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +template +inline T* to_raw_pointer(T* p) +{ return p; } + +template +inline typename autoboost::intrusive::pointer_traits::element_type* +to_raw_pointer(const Pointer &p) +{ return autoboost::interprocess::ipcdetail::to_raw_pointer(p.operator->()); } + +//!To avoid ADL problems with swap +template +inline void do_swap(T& x, T& y) +{ + using std::swap; + swap(x, y); +} + +//Rounds "orig_size" by excess to round_to bytes +template +inline SizeType get_rounded_size(SizeType orig_size, SizeType round_to) +{ + return ((orig_size-1)/round_to+1)*round_to; +} + +//Truncates "orig_size" to a multiple of "multiple" bytes. +template +inline SizeType get_truncated_size(SizeType orig_size, SizeType multiple) +{ + return orig_size/multiple*multiple; +} + +//Rounds "orig_size" by excess to round_to bytes. round_to must be power of two +template +inline SizeType get_rounded_size_po2(SizeType orig_size, SizeType round_to) +{ + return ((orig_size-1)&(~(round_to-1))) + round_to; +} + +//Truncates "orig_size" to a multiple of "multiple" bytes. multiple must be power of two +template +inline SizeType get_truncated_size_po2(SizeType orig_size, SizeType multiple) +{ + return (orig_size & (~(multiple-1))); +} + +template +struct ct_rounded_size +{ + AUTOBOOST_STATIC_ASSERT((RoundTo != 0)); + static const std::size_t intermediate_value = (OrigSize-1)/RoundTo+1; + AUTOBOOST_STATIC_ASSERT(intermediate_value <= std::size_t(-1)/RoundTo); + static const std::size_t value = intermediate_value*RoundTo; +}; + +// Gennaro Prota wrote this. Thanks! +template +struct ct_max_pow2_less +{ + static const std::size_t c = 2*n < p; + + static const std::size_t value = + c ? (ct_max_pow2_less< c*p, 2*c*n>::value) : n; +}; + +template <> +struct ct_max_pow2_less<0, 0> +{ + static const std::size_t value = 0; +}; + +} //namespace ipcdetail { + +//!Trait class to detect if an index is a node +//!index. This allows more efficient operations +//!when deallocating named objects. +template +struct is_node_index +{ + static const bool value = false; +}; + +//!Trait class to detect if an index is an intrusive +//!index. This will embed the derivation hook in each +//!allocation header, to provide memory for the intrusive +//!container. +template +struct is_intrusive_index +{ + static const bool value = false; +}; + +template T* +addressof(T& v) +{ + return reinterpret_cast( + &const_cast(reinterpret_cast(v))); +} + +template +struct sqrt_size_type_max +{ + static const SizeType value = (SizeType(1) << (sizeof(SizeType)*(CHAR_BIT/2)))-1; +}; + +template +inline bool multiplication_overflows(SizeType a, SizeType b) +{ + const SizeType sqrt_size_max = sqrt_size_type_max::value; + return //Fast runtime check + ( (a | b) > sqrt_size_max && + //Slow division check + b && a > SizeType(-1)/b + ); +} + +template +inline bool size_overflows(SizeType count) +{ + //Compile time-check + AUTOBOOST_STATIC_ASSERT(SztSizeOfType <= SizeType(-1)); + //Runtime check + return multiplication_overflows(SizeType(SztSizeOfType), count); +} + +template +class pointer_size_t_caster +{ + public: + AUTOBOOST_STATIC_ASSERT(sizeof(std::size_t) == sizeof(void*)); + + explicit pointer_size_t_caster(std::size_t sz) + : m_ptr(reinterpret_cast(sz)) + {} + + explicit pointer_size_t_caster(RawPointer p) + : m_ptr(p) + {} + + std::size_t size() const + { return reinterpret_cast(m_ptr); } + + RawPointer pointer() const + { return m_ptr; } + + private: + RawPointer m_ptr; +}; + + +template +inline bool sum_overflows(SizeType a, SizeType b) +{ return SizeType(-1) - a < b; } + +//Anti-exception node eraser +template +class value_eraser +{ + public: + value_eraser(Cont & cont, typename Cont::iterator it) + : m_cont(cont), m_index_it(it), m_erase(true){} + ~value_eraser() + { if(m_erase) m_cont.erase(m_index_it); } + + void release() { m_erase = false; } + + private: + Cont &m_cont; + typename Cont::iterator m_index_it; + bool m_erase; +}; + +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DETAIL_UTILITIES_HPP + diff --git a/contrib/autoboost/autoboost/interprocess/detail/win32_api.hpp b/contrib/autoboost/autoboost/interprocess/detail/win32_api.hpp new file mode 100644 index 000000000..0c8a9ef1e --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/win32_api.hpp @@ -0,0 +1,2337 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_WIN32_API_HPP +#define AUTOBOOST_INTERPROCESS_WIN32_API_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef AUTOBOOST_USE_WINDOWS_H +#include +#include +#include +#include +#endif + +#if defined(_MSC_VER) +# pragma once +# pragma comment( lib, "Advapi32.lib" ) +# pragma comment( lib, "oleaut32.lib" ) +# pragma comment( lib, "Ole32.lib" ) +# pragma comment( lib, "Psapi.lib" ) +# pragma comment( lib, "Shell32.lib" ) //SHGetSpecialFolderPathA +#endif + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) +# include +# include +#else +# error "This file can only be included in Windows OS" +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// Declaration of Windows structures or typedefs if AUTOBOOST_USE_WINDOWS_H is used +// +////////////////////////////////////////////////////////////////////////////// + +namespace autoboost { +namespace interprocess { +namespace winapi { + +//Own defines +static const unsigned long MaxPath = 260; + +#ifndef AUTOBOOST_USE_WINDOWS_H + +struct GUID_BIPC +{ + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +}; + +#if defined(_MSC_VER) +#pragma warning (push) +#pragma warning (disable : 4201) // nonstandard extension used +#endif + +struct decimal +{ + unsigned short wReserved; + union { + struct { + unsigned char scale; + unsigned char sign; + }; + unsigned short signscale; + }; + unsigned long Hi32; + union { + struct { + unsigned long Lo32; + unsigned long Mid32; + }; + unsigned __int64 Lo64; + }; +}; + +typedef unsigned short *bstr; + + +struct wchar_variant +{ + union + { + struct + { + unsigned short vt; + unsigned short wReserved1; + unsigned short wReserved2; + unsigned short wReserved3; + union + { + bstr bstrVal; + struct + { + void* pvRecord; + void* pRecInfo; + }; + }; + }; + decimal decVal; + }; +}; + +#if defined(_MSC_VER) +#pragma warning (pop) +#endif + + + + + + + + + + + + + + + + + +struct IUnknown_BIPC +{ + public: + virtual long __stdcall QueryInterface( + const GUID_BIPC &riid, // [in] + void **ppvObject) = 0; // [iid_is][out] + + virtual unsigned long __stdcall AddRef (void) = 0; + virtual unsigned long __stdcall Release(void) = 0; +}; + +struct IWbemClassObject_BIPC : public IUnknown_BIPC +{ + public: + virtual long __stdcall GetQualifierSet( + /* [out] */ void **ppQualSet) = 0; + + virtual long __stdcall Get( + /* [string][in] */ const bstr wszName, + /* [in] */ long lFlags, + /* [unique][in][out] */ wchar_variant *pVal, + /* [unique][in][out] */ long *pType, + /* [unique][in][out] */ long *plFlavor) = 0; + + virtual long __stdcall Put( + /* [string][in] */ const bstr wszName, + /* [in] */ long lFlags, + /* [in] */ wchar_variant *pVal, + /* [in] */ long Type) = 0; + + virtual long __stdcall Delete( + /* [string][in] */ const bstr wszName) = 0; + + virtual long __stdcall GetNames( + /* [string][in] */ const bstr wszQualifierName, + /* [in] */ long lFlags, + /* [in] */ wchar_variant *pQualifierVal, + /* [out] */ void * *pNames) = 0; + + virtual long __stdcall BeginEnumeration( + /* [in] */ long lEnumFlags) = 0; + + virtual long __stdcall Next( + /* [in] */ long lFlags, + /* [unique][in][out] */ bstr *strName, + /* [unique][in][out] */ wchar_variant *pVal, + /* [unique][in][out] */ long *pType, + /* [unique][in][out] */ long *plFlavor) = 0; + + virtual long __stdcall EndEnumeration( void) = 0; + + virtual long __stdcall GetPropertyQualifierSet( + /* [string][in] */ const bstr wszProperty, + /* [out] */ void **ppQualSet) = 0; + + virtual long __stdcall Clone( + /* [out] */ IWbemClassObject_BIPC **ppCopy) = 0; + + virtual long __stdcall GetObjectText( + /* [in] */ long lFlags, + /* [out] */ bstr *pstrObjectText) = 0; + + virtual long __stdcall SpawnDerivedClass( + /* [in] */ long lFlags, + /* [out] */ IWbemClassObject_BIPC **ppNewClass) = 0; + + virtual long __stdcall SpawnInstance( + /* [in] */ long lFlags, + /* [out] */ IWbemClassObject_BIPC **ppNewInstance) = 0; + + virtual long __stdcall CompareTo( + /* [in] */ long lFlags, + /* [in] */ IWbemClassObject_BIPC *pCompareTo) = 0; + + virtual long __stdcall GetPropertyOrigin( + /* [string][in] */ const bstr wszName, + /* [out] */ bstr *pstrClassName) = 0; + + virtual long __stdcall InheritsFrom( + /* [in] */ const bstr strAncestor) = 0; + + virtual long __stdcall GetMethod( + /* [string][in] */ const bstr wszName, + /* [in] */ long lFlags, + /* [out] */ IWbemClassObject_BIPC **ppInSignature, + /* [out] */ IWbemClassObject_BIPC **ppOutSignature) = 0; + + virtual long __stdcall PutMethod( + /* [string][in] */ const bstr wszName, + /* [in] */ long lFlags, + /* [in] */ IWbemClassObject_BIPC *pInSignature, + /* [in] */ IWbemClassObject_BIPC *pOutSignature) = 0; + + virtual long __stdcall DeleteMethod( + /* [string][in] */ const bstr wszName) = 0; + + virtual long __stdcall BeginMethodEnumeration( + /* [in] */ long lEnumFlags) = 0; + + virtual long __stdcall NextMethod( + /* [in] */ long lFlags, + /* [unique][in][out] */ bstr *pstrName, + /* [unique][in][out] */ IWbemClassObject_BIPC **ppInSignature, + /* [unique][in][out] */ IWbemClassObject_BIPC **ppOutSignature) = 0; + + virtual long __stdcall EndMethodEnumeration( void) = 0; + + virtual long __stdcall GetMethodQualifierSet( + /* [string][in] */ const bstr wszMethod, + /* [out] */ void **ppQualSet) = 0; + + virtual long __stdcall GetMethodOrigin( + /* [string][in] */ const bstr wszMethodName, + /* [out] */ bstr *pstrClassName) = 0; + +}; + +struct IWbemContext_BIPC : public IUnknown_BIPC +{ +public: + virtual long __stdcall Clone( + /* [out] */ IWbemContext_BIPC **ppNewCopy) = 0; + + virtual long __stdcall GetNames( + /* [in] */ long lFlags, + /* [out] */ void * *pNames) = 0; + + virtual long __stdcall BeginEnumeration( + /* [in] */ long lFlags) = 0; + + virtual long __stdcall Next( + /* [in] */ long lFlags, + /* [out] */ bstr *pstrName, + /* [out] */ wchar_variant *pValue) = 0; + + virtual long __stdcall EndEnumeration( void) = 0; + + virtual long __stdcall SetValue( + /* [string][in] */ const bstr wszName, + /* [in] */ long lFlags, + /* [in] */ wchar_variant *pValue) = 0; + + virtual long __stdcall GetValue( + /* [string][in] */ const bstr wszName, + /* [in] */ long lFlags, + /* [out] */ wchar_variant *pValue) = 0; + + virtual long __stdcall DeleteValue( + /* [string][in] */ const bstr wszName, + /* [in] */ long lFlags) = 0; + + virtual long __stdcall DeleteAll( void) = 0; + +}; + + +struct IEnumWbemClassObject_BIPC : public IUnknown_BIPC +{ +public: + virtual long __stdcall Reset( void) = 0; + + virtual long __stdcall Next( + /* [in] */ long lTimeout, + /* [in] */ unsigned long uCount, + /* [length_is][size_is][out] */ IWbemClassObject_BIPC **apObjects, + /* [out] */ unsigned long *puReturned) = 0; + + virtual long __stdcall NextAsync( + /* [in] */ unsigned long uCount, + /* [in] */ void *pSink) = 0; + + virtual long __stdcall Clone( + /* [out] */ void **ppEnum) = 0; + + virtual long __stdcall Skip( + /* [in] */ long lTimeout, + /* [in] */ unsigned long nCount) = 0; + +}; + +struct IWbemServices_BIPC : public IUnknown_BIPC +{ +public: + virtual long __stdcall OpenNamespace( + /* [in] */ const bstr strNamespace, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [unique][in][out] */ void **ppWorkingNamespace, + /* [unique][in][out] */ void **ppResult) = 0; + + virtual long __stdcall CancelAsyncCall( + /* [in] */ void *pSink) = 0; + + virtual long __stdcall QueryObjectSink( + /* [in] */ long lFlags, + /* [out] */ void **ppResponseHandler) = 0; + + virtual long __stdcall GetObject( + /* [in] */ const bstr strObjectPath, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [unique][in][out] */ void **ppObject, + /* [unique][in][out] */ void **ppCallResult) = 0; + + virtual long __stdcall GetObjectAsync( + /* [in] */ const bstr strObjectPath, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall PutClass( + /* [in] */ IWbemClassObject_BIPC *pObject, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [unique][in][out] */ void **ppCallResult) = 0; + + virtual long __stdcall PutClassAsync( + /* [in] */ IWbemClassObject_BIPC *pObject, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall DeleteClass( + /* [in] */ const bstr strClass, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [unique][in][out] */ void **ppCallResult) = 0; + + virtual long __stdcall DeleteClassAsync( + /* [in] */ const bstr strClass, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall CreateClassEnum( + /* [in] */ const bstr strSuperclass, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [out] */ void **ppEnum) = 0; + + virtual long __stdcall CreateClassEnumAsync( + /* [in] */ const bstr strSuperclass, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall PutInstance( + /* [in] */ void *pInst, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [unique][in][out] */ void **ppCallResult) = 0; + + virtual long __stdcall PutInstanceAsync( + /* [in] */ void *pInst, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall DeleteInstance( + /* [in] */ const bstr strObjectPath, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [unique][in][out] */ void **ppCallResult) = 0; + + virtual long __stdcall DeleteInstanceAsync( + /* [in] */ const bstr strObjectPath, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall CreateInstanceEnum( + /* [in] */ const bstr strFilter, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [out] */ void **ppEnum) = 0; + + virtual long __stdcall CreateInstanceEnumAsync( + /* [in] */ const bstr strFilter, + /* [in] */ long lFlags, + /* [in] */ void *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall ExecQuery( + /* [in] */ const bstr strQueryLanguage, + /* [in] */ const bstr strQuery, + /* [in] */ long lFlags, + /* [in] */ IWbemContext_BIPC *pCtx, + /* [out] */ IEnumWbemClassObject_BIPC **ppEnum) = 0; + + virtual long __stdcall ExecQueryAsync( + /* [in] */ const bstr strQueryLanguage, + /* [in] */ const bstr strQuery, + /* [in] */ long lFlags, + /* [in] */ IWbemContext_BIPC *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall ExecNotificationQuery( + /* [in] */ const bstr strQueryLanguage, + /* [in] */ const bstr strQuery, + /* [in] */ long lFlags, + /* [in] */ IWbemContext_BIPC *pCtx, + /* [out] */ void **ppEnum) = 0; + + virtual long __stdcall ExecNotificationQueryAsync( + /* [in] */ const bstr strQueryLanguage, + /* [in] */ const bstr strQuery, + /* [in] */ long lFlags, + /* [in] */ IWbemContext_BIPC *pCtx, + /* [in] */ void *pResponseHandler) = 0; + + virtual long __stdcall ExecMethod( + /* [in] */ const bstr strObjectPath, + /* [in] */ const bstr strMethodName, + /* [in] */ long lFlags, + /* [in] */ IWbemContext_BIPC *pCtx, + /* [in] */ IWbemClassObject_BIPC *pInParams, + /* [unique][in][out] */ IWbemClassObject_BIPC **ppOutParams, + /* [unique][in][out] */ void **ppCallResult) = 0; + + virtual long __stdcall ExecMethodAsync( + /* [in] */ const bstr strObjectPath, + /* [in] */ const bstr strMethodName, + /* [in] */ long lFlags, + /* [in] */ IWbemContext_BIPC *pCtx, + /* [in] */ IWbemClassObject_BIPC *pInParams, + /* [in] */ void *pResponseHandler) = 0; + +}; + +struct IWbemLocator_BIPC : public IUnknown_BIPC +{ +public: + virtual long __stdcall ConnectServer( + /* [in] */ const bstr strNetworkResource, + /* [in] */ const bstr strUser, + /* [in] */ const bstr strPassword, + /* [in] */ const bstr strLocale, + /* [in] */ long lSecurityFlags, + /* [in] */ const bstr strAuthority, + /* [in] */ void *pCtx, + /* [out] */ IWbemServices_BIPC **ppNamespace) = 0; + +}; + +struct interprocess_overlapped +{ + unsigned long *internal; + unsigned long *internal_high; + union { + struct { + unsigned long offset; + unsigned long offset_high; + }dummy; + void *pointer; + }; + + void *h_event; +}; + + +struct interprocess_filetime +{ + unsigned long dwLowDateTime; + unsigned long dwHighDateTime; +}; + +struct win32_find_data +{ + unsigned long dwFileAttributes; + interprocess_filetime ftCreationTime; + interprocess_filetime ftLastAccessTime; + interprocess_filetime ftLastWriteTime; + unsigned long nFileSizeHigh; + unsigned long nFileSizeLow; + unsigned long dwReserved0; + unsigned long dwReserved1; + char cFileName[MaxPath]; + char cAlternateFileName[14]; +}; + +struct interprocess_security_attributes +{ + unsigned long nLength; + void *lpSecurityDescriptor; + int bInheritHandle; +}; + +struct system_info { + union { + unsigned long dwOemId; // Obsolete field...do not use + struct { + unsigned short wProcessorArchitecture; + unsigned short wReserved; + } dummy; + }; + unsigned long dwPageSize; + void * lpMinimumApplicationAddress; + void * lpMaximumApplicationAddress; + unsigned long * dwActiveProcessorMask; + unsigned long dwNumberOfProcessors; + unsigned long dwProcessorType; + unsigned long dwAllocationGranularity; + unsigned short wProcessorLevel; + unsigned short wProcessorRevision; +}; + +struct interprocess_acl +{ + unsigned char AclRevision; + unsigned char Sbz1; + unsigned short AclSize; + unsigned short AceCount; + unsigned short Sbz2; +}; + +struct interprocess_security_descriptor +{ + unsigned char Revision; + unsigned char Sbz1; + unsigned short Control; + void *Owner; + void *Group; + interprocess_acl *Sacl; + interprocess_acl *Dacl; +}; + +struct interprocess_by_handle_file_information +{ + unsigned long dwFileAttributes; + interprocess_filetime ftCreationTime; + interprocess_filetime ftLastAccessTime; + interprocess_filetime ftLastWriteTime; + unsigned long dwVolumeSerialNumber; + unsigned long nFileSizeHigh; + unsigned long nFileSizeLow; + unsigned long nNumberOfLinks; + unsigned long nFileIndexHigh; + unsigned long nFileIndexLow; +}; + +struct interprocess_eventlogrecord +{ + unsigned long Length; // Length of full record + unsigned long Reserved; // Used by the service + unsigned long RecordNumber; // Absolute record number + unsigned long TimeGenerated; // Seconds since 1-1-1970 + unsigned long TimeWritten; // Seconds since 1-1-1970 + unsigned long EventID; + unsigned short EventType; + unsigned short NumStrings; + unsigned short EventCategory; + unsigned short ReservedFlags; // For use with paired events (auditing) + unsigned long ClosingRecordNumber; // For use with paired events (auditing) + unsigned long StringOffset; // Offset from beginning of record + unsigned long UserSidLength; + unsigned long UserSidOffset; + unsigned long DataLength; + unsigned long DataOffset; // Offset from beginning of record + // + // Then follow: + // + // wchar_t SourceName[] + // wchar_t Computername[] + // SID UserSid + // wchar_t Strings[] + // BYTE Data[] + // CHAR Pad[] + // unsigned long Length; + // +}; + +union large_integer +{ + __int64 QuadPart; +}; + +struct hinstance_struct { int unused; }; +typedef hinstance_struct *hmodule; + +struct hkey_struct; +typedef hkey_struct *hkey; + +#ifdef _WIN64 +typedef __int64 (__stdcall *farproc_t)(); +#else +typedef int (__stdcall *farproc_t)(); +#endif // _WIN64 + +#else //#ifndef AUTOBOOST_USE_WINDOWS_H + +typedef GUID GUID_BIPC; +typedef VARIANT wchar_variant; + +typedef IUnknown IUnknown_BIPC; + +typedef IWbemClassObject IWbemClassObject_BIPC; + +typedef IWbemContext IWbemContext_BIPC; + +typedef IEnumWbemClassObject IEnumWbemClassObject_BIPC; + +typedef IWbemServices IWbemServices_BIPC; + +typedef IWbemLocator IWbemLocator_BIPC; + +typedef OVERLAPPED interprocess_overlapped; + +typedef FILETIME interprocess_filetime; + +typedef WIN32_FIND_DATAA win32_find_data; + +typedef SECURITY_ATTRIBUTES interprocess_security_attributes; + +typedef SYSTEM_INFO system_info; + +typedef ACL interprocess_acl; + +typedef SECURITY_DESCRIPTOR interprocess_security_descriptor; + +typedef BY_HANDLE_FILE_INFORMATION interprocess_by_handle_file_information; + +typedef EVENTLOGRECORD interprocess_eventlogrecord; + +typedef LARGE_INTEGER large_integer; + +typedef HMODULE hmodule; + +typedef HKEY hkey; + +typedef BSTR bstr; + +typedef FARPROC farproc_t; + +#endif //#ifndef AUTOBOOST_USE_WINDOWS_H + +////////////////////////////////////////////////////////////////////////////// +// +// Nt native structures +// +////////////////////////////////////////////////////////////////////////////// + +struct interprocess_semaphore_basic_information +{ + unsigned int count; // current semaphore count + unsigned int limit; // max semaphore count +}; + +struct interprocess_section_basic_information +{ + void * base_address; + unsigned long section_attributes; + __int64 section_size; +}; + +struct file_rename_information_t { + int Replace; + void *RootDir; + unsigned long FileNameLength; + wchar_t FileName[1]; +}; + +struct unicode_string_t { + unsigned short Length; + unsigned short MaximumLength; + wchar_t *Buffer; +}; + +struct object_attributes_t { + unsigned long Length; + void * RootDirectory; + unicode_string_t *ObjectName; + unsigned long Attributes; + void *SecurityDescriptor; + void *SecurityQualityOfService; +}; + +struct io_status_block_t { + union { + long Status; + void *Pointer; + }; + + unsigned long *Information; +}; + +union system_timeofday_information +{ + struct data_t + { + __int64 liKeBootTime; + __int64 liKeSystemTime; + __int64 liExpTimeZoneBias; + unsigned long uCurrentTimeZoneId; + unsigned long dwReserved; + unsigned __int64 ullBootTimeBias; + unsigned __int64 ullSleepTimeBias; + } data; + unsigned char Reserved1[sizeof(data_t)]; +}; + +static const long BootstampLength = sizeof(__int64); +static const long BootAndSystemstampLength = sizeof(__int64)*2; +static const long SystemTimeOfDayInfoLength = sizeof(system_timeofday_information::data_t); + +struct object_name_information_t +{ + unicode_string_t Name; + wchar_t NameBuffer[1]; +}; + +enum file_information_class_t { + file_directory_information = 1, + file_full_directory_information, + file_both_directory_information, + file_basic_information, + file_standard_information, + file_internal_information, + file_ea_information, + file_access_information, + file_name_information, + file_rename_information, + file_link_information, + file_names_information, + file_disposition_information, + file_position_information, + file_full_ea_information, + file_mode_information, + file_alignment_information, + file_all_information, + file_allocation_information, + file_end_of_file_information, + file_alternate_name_information, + file_stream_information, + file_pipe_information, + file_pipe_local_information, + file_pipe_remote_information, + file_mailslot_query_information, + file_mailslot_set_information, + file_compression_information, + file_copy_on_write_information, + file_completion_information, + file_move_cluster_information, + file_quota_information, + file_reparse_point_information, + file_network_open_information, + file_object_id_information, + file_tracking_information, + file_ole_directory_information, + file_content_index_information, + file_inherit_content_index_information, + file_ole_information, + file_maximum_information +}; + +enum semaphore_information_class { + semaphore_basic_information = 0 +}; + + +enum system_information_class { + system_basic_information = 0, + system_performance_information = 2, + system_time_of_day_information = 3, + system_process_information = 5, + system_processor_performance_information = 8, + system_interrupt_information = 23, + system_exception_information = 33, + system_registry_quota_information = 37, + system_lookaside_information = 45 +}; + +enum object_information_class +{ + object_basic_information, + object_name_information, + object_type_information, + object_all_information, + object_data_information +}; + +enum section_information_class +{ + section_basic_information, + section_image_information +}; + +////////////////////////////////////////////////////////////////////////////// +// +// Forward declaration of winapi +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_USE_WINDOWS_H + +//Kernel32.dll + +//Some windows API declarations +extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentProcessId(); +extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(); +extern "C" __declspec(dllimport) int __stdcall GetProcessTimes + ( void *hProcess, interprocess_filetime* lpCreationTime + , interprocess_filetime *lpExitTime,interprocess_filetime *lpKernelTime + , interprocess_filetime *lpUserTime ); +extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long); +extern "C" __declspec(dllimport) unsigned long __stdcall GetTickCount(void); +extern "C" __declspec(dllimport) int __stdcall SwitchToThread(); +extern "C" __declspec(dllimport) unsigned long __stdcall GetLastError(); +extern "C" __declspec(dllimport) void __stdcall SetLastError(unsigned long); +extern "C" __declspec(dllimport) void * __stdcall GetCurrentProcess(); +extern "C" __declspec(dllimport) int __stdcall CloseHandle(void*); +extern "C" __declspec(dllimport) int __stdcall DuplicateHandle + ( void *hSourceProcessHandle, void *hSourceHandle + , void *hTargetProcessHandle, void **lpTargetHandle + , unsigned long dwDesiredAccess, int bInheritHandle + , unsigned long dwOptions); +extern "C" __declspec(dllimport) long __stdcall GetFileType(void *hFile); +extern "C" __declspec(dllimport) void *__stdcall FindFirstFileA(const char *lpFileName, win32_find_data *lpFindFileData); +extern "C" __declspec(dllimport) int __stdcall FindNextFileA(void *hFindFile, win32_find_data *lpFindFileData); +extern "C" __declspec(dllimport) int __stdcall FindClose(void *hFindFile); +//extern "C" __declspec(dllimport) void __stdcall GetSystemTimeAsFileTime(interprocess_filetime*); +//extern "C" __declspec(dllimport) int __stdcall FileTimeToLocalFileTime(const interprocess_filetime *in, const interprocess_filetime *out); +extern "C" __declspec(dllimport) void * __stdcall CreateMutexA(interprocess_security_attributes*, int, const char *); +extern "C" __declspec(dllimport) void * __stdcall OpenMutexA(unsigned long, int, const char *); +extern "C" __declspec(dllimport) unsigned long __stdcall WaitForSingleObject(void *, unsigned long); +extern "C" __declspec(dllimport) int __stdcall ReleaseMutex(void *); +extern "C" __declspec(dllimport) int __stdcall UnmapViewOfFile(void *); +extern "C" __declspec(dllimport) void * __stdcall CreateSemaphoreA(interprocess_security_attributes*, long, long, const char *); +extern "C" __declspec(dllimport) int __stdcall ReleaseSemaphore(void *, long, long *); +extern "C" __declspec(dllimport) void * __stdcall OpenSemaphoreA(unsigned long, int, const char *); +extern "C" __declspec(dllimport) void * __stdcall CreateFileMappingA (void *, interprocess_security_attributes*, unsigned long, unsigned long, unsigned long, const char *); +extern "C" __declspec(dllimport) void * __stdcall MapViewOfFileEx (void *, unsigned long, unsigned long, unsigned long, std::size_t, void*); +extern "C" __declspec(dllimport) void * __stdcall OpenFileMappingA (unsigned long, int, const char *); +extern "C" __declspec(dllimport) void * __stdcall CreateFileA (const char *, unsigned long, unsigned long, struct interprocess_security_attributes*, unsigned long, unsigned long, void *); +extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); +extern "C" __declspec(dllimport) int __stdcall FlushViewOfFile (void *, std::size_t); +extern "C" __declspec(dllimport) int __stdcall VirtualUnlock (void *, std::size_t); +extern "C" __declspec(dllimport) int __stdcall VirtualProtect (void *, std::size_t, unsigned long, unsigned long *); +extern "C" __declspec(dllimport) int __stdcall FlushFileBuffers (void *); +extern "C" __declspec(dllimport) int __stdcall GetFileSizeEx (void *, large_integer *size); +extern "C" __declspec(dllimport) unsigned long __stdcall FormatMessageA + (unsigned long dwFlags, const void *lpSource, unsigned long dwMessageId, + unsigned long dwLanguageId, char *lpBuffer, unsigned long nSize, + std::va_list *Arguments); +extern "C" __declspec(dllimport) void *__stdcall LocalFree (void *); +extern "C" __declspec(dllimport) unsigned long __stdcall GetFileAttributesA(const char *); +extern "C" __declspec(dllimport) int __stdcall CreateDirectoryA(const char *, interprocess_security_attributes*); +extern "C" __declspec(dllimport) int __stdcall RemoveDirectoryA(const char *lpPathName); +extern "C" __declspec(dllimport) int __stdcall GetTempPathA(unsigned long length, char *buffer); +extern "C" __declspec(dllimport) int __stdcall CreateDirectory(const char *, interprocess_security_attributes*); +extern "C" __declspec(dllimport) int __stdcall SetFileValidData(void *, __int64 size); +extern "C" __declspec(dllimport) int __stdcall SetEndOfFile(void *); +extern "C" __declspec(dllimport) int __stdcall SetFilePointerEx(void *, large_integer distance, large_integer *new_file_pointer, unsigned long move_method); +extern "C" __declspec(dllimport) int __stdcall LockFile (void *hnd, unsigned long offset_low, unsigned long offset_high, unsigned long size_low, unsigned long size_high); +extern "C" __declspec(dllimport) int __stdcall UnlockFile(void *hnd, unsigned long offset_low, unsigned long offset_high, unsigned long size_low, unsigned long size_high); +extern "C" __declspec(dllimport) int __stdcall LockFileEx(void *hnd, unsigned long flags, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped* overlapped); +extern "C" __declspec(dllimport) int __stdcall UnlockFileEx(void *hnd, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped* overlapped); +extern "C" __declspec(dllimport) int __stdcall WriteFile(void *hnd, const void *buffer, unsigned long bytes_to_write, unsigned long *bytes_written, interprocess_overlapped* overlapped); +extern "C" __declspec(dllimport) int __stdcall ReadFile(void *hnd, void *buffer, unsigned long bytes_to_read, unsigned long *bytes_read, interprocess_overlapped* overlapped); +extern "C" __declspec(dllimport) int __stdcall InitializeSecurityDescriptor(interprocess_security_descriptor *pSecurityDescriptor, unsigned long dwRevision); +extern "C" __declspec(dllimport) int __stdcall SetSecurityDescriptorDacl(interprocess_security_descriptor *pSecurityDescriptor, int bDaclPresent, interprocess_acl *pDacl, int bDaclDefaulted); +extern "C" __declspec(dllimport) hmodule __stdcall LoadLibraryA(const char *); +extern "C" __declspec(dllimport) int __stdcall FreeLibrary(hmodule); +extern "C" __declspec(dllimport) farproc_t __stdcall GetProcAddress(void *, const char*); +extern "C" __declspec(dllimport) hmodule __stdcall GetModuleHandleA(const char*); +extern "C" __declspec(dllimport) void *__stdcall GetFileInformationByHandle(void *, interprocess_by_handle_file_information*); + +//Advapi32.dll +extern "C" __declspec(dllimport) long __stdcall RegOpenKeyExA(hkey, const char *, unsigned long, unsigned long, hkey*); +extern "C" __declspec(dllimport) long __stdcall RegQueryValueExA(hkey, const char *, unsigned long*, unsigned long*, unsigned char *, unsigned long*); +extern "C" __declspec(dllimport) long __stdcall RegCloseKey(hkey); + +//Ole32.dll +extern "C" __declspec(dllimport) long __stdcall CoInitializeEx(void *pvReserved, unsigned long dwCoInit); +extern "C" __declspec(dllimport) long __stdcall CoInitializeSecurity( + void* pSecDesc, + long cAuthSvc, + void * asAuthSvc, + void *pReserved1, + unsigned long dwAuthnLevel, + unsigned long dwImpLevel, + void *pAuthList, + unsigned long dwCapabilities, + void *pReserved3 ); + + extern "C" __declspec(dllimport) long __stdcall CoSetProxyBlanket( + IUnknown_BIPC *pProxy, + unsigned long dwAuthnSvc, + unsigned long dwAuthzSvc, + wchar_t *pServerPrincName, + unsigned long dwAuthnLevel, + unsigned long dwImpLevel, + void *pAuthInfo, + unsigned long dwCapabilities); +extern "C" __declspec(dllimport) long __stdcall CoCreateInstance(const GUID_BIPC & rclsid, IUnknown_BIPC *pUnkOuter, + unsigned long dwClsContext, const GUID_BIPC & riid, void** ppv); +extern "C" __declspec(dllimport) void __stdcall CoUninitialize(void); + +//OleAut32.dll +extern "C" __declspec(dllimport) long __stdcall VariantClear(wchar_variant * pvarg); + +//Shell32.dll +extern "C" __declspec(dllimport) int __stdcall SHGetSpecialFolderPathA + (void* hwnd, const char *pszPath, int csidl, int fCreate); + +extern "C" __declspec(dllimport) int __stdcall SHGetFolderPathA(void *hwnd, int csidl, void *hToken, unsigned long dwFlags, const char *pszPath); + +//EventLog access functions + +extern "C" __declspec(dllimport) void* __stdcall OpenEventLogA + (const char* lpUNCServerName, const char* lpSourceName); + +extern "C" __declspec(dllimport) int __stdcall CloseEventLog(void *hEventLog); + +extern "C" __declspec(dllimport) int __stdcall ReadEventLogA + (void *hEventLog, + unsigned long dwReadFlags, + unsigned long dwRecordOffset, + void *lpBuffer, + unsigned long nNumberOfBytesToRead, + unsigned long *pnBytesRead, + unsigned long *pnMinNumberOfBytesNeeded + ); + +#endif //#ifndef AUTOBOOST_USE_WINDOWS_H + +//kernel32.dll +typedef int (__stdcall *QueryPerformanceCounter_t) (__int64 *lpPerformanceCount); +typedef int (__stdcall *QueryPerformanceFrequency_t)(__int64 *lpFrequency); + +//ntdll.dll +typedef long (__stdcall *NtDeleteFile_t)(object_attributes_t *ObjectAttributes); +typedef long (__stdcall *NtSetInformationFile_t)(void *FileHandle, io_status_block_t *IoStatusBlock, void *FileInformation, unsigned long Length, int FileInformationClass ); +typedef long (__stdcall *NtOpenFile)(void **FileHandle, unsigned long DesiredAccess, object_attributes_t *ObjectAttributes + , io_status_block_t *IoStatusBlock, unsigned long ShareAccess, unsigned long Length, unsigned long OpenOptions); +typedef long (__stdcall *NtQuerySystemInformation_t)(int, void*, unsigned long, unsigned long *); +typedef long (__stdcall *NtQueryObject_t)(void*, object_information_class, void *, unsigned long, unsigned long *); +typedef long (__stdcall *NtQuerySemaphore_t)(void*, unsigned int info_class, interprocess_semaphore_basic_information *pinfo, unsigned int info_size, unsigned int *ret_len); +typedef long (__stdcall *NtQuerySection_t)(void*, section_information_class, interprocess_section_basic_information *pinfo, unsigned long info_size, unsigned long *ret_len); +typedef long (__stdcall *NtQueryInformationFile_t)(void *,io_status_block_t *,void *, long, int); +typedef long (__stdcall *NtOpenFile_t)(void*,unsigned long ,object_attributes_t*,io_status_block_t*,unsigned long,unsigned long); +typedef long (__stdcall *NtClose_t) (void*); +typedef long (__stdcall *NtQueryTimerResolution_t) (unsigned long* LowestResolution, unsigned long* HighestResolution, unsigned long* CurrentResolution); +typedef long (__stdcall *NtSetTimerResolution_t) (unsigned long RequestedResolution, int Set, unsigned long* ActualResolution); + +} //namespace winapi { +} //namespace interprocess { +} //namespace autoboost { + +////////////////////////////////////////////////////////////////////////////// +// +// Forward declaration of constants +// +////////////////////////////////////////////////////////////////////////////// + +namespace autoboost { +namespace interprocess { +namespace winapi { + +//Some used constants +static const unsigned long infinite_time = 0xFFFFFFFF; +static const unsigned long error_already_exists = 183L; +static const unsigned long error_invalid_handle = 6L; +static const unsigned long error_sharing_violation = 32L; +static const unsigned long error_file_not_found = 2u; +static const unsigned long error_no_more_files = 18u; +static const unsigned long error_not_locked = 158L; +//Retries in CreateFile, see http://support.microsoft.com/kb/316609 +static const unsigned long error_sharing_violation_tries = 3L; +static const unsigned long error_sharing_violation_sleep_ms = 250L; +static const unsigned long error_file_too_large = 223L; +static const unsigned long error_insufficient_buffer = 122L; +static const unsigned long error_handle_eof = 38L; +static const unsigned long semaphore_all_access = (0x000F0000L)|(0x00100000L)|0x3; +static const unsigned long mutex_all_access = (0x000F0000L)|(0x00100000L)|0x0001; + +static const unsigned long page_readonly = 0x02; +static const unsigned long page_readwrite = 0x04; +static const unsigned long page_writecopy = 0x08; +static const unsigned long page_noaccess = 0x01; + +static const unsigned long standard_rights_required = 0x000F0000L; +static const unsigned long section_query = 0x0001; +static const unsigned long section_map_write = 0x0002; +static const unsigned long section_map_read = 0x0004; +static const unsigned long section_map_execute = 0x0008; +static const unsigned long section_extend_size = 0x0010; +static const unsigned long section_all_access = standard_rights_required | + section_query | + section_map_write | + section_map_read | + section_map_execute | + section_extend_size; + +static const unsigned long file_map_copy = section_query; +static const unsigned long file_map_write = section_map_write; +static const unsigned long file_map_read = section_map_read; +static const unsigned long file_map_all_access = section_all_access; +static const unsigned long delete_access = 0x00010000L; +static const unsigned long file_flag_backup_semantics = 0x02000000; +static const long file_flag_delete_on_close = 0x04000000; + +//Native API constants +static const unsigned long file_open_for_backup_intent = 0x00004000; +static const int file_share_valid_flags = 0x00000007; +static const long file_delete_on_close = 0x00001000L; +static const long obj_case_insensitive = 0x00000040L; +static const long delete_flag = 0x00010000L; + +static const unsigned long movefile_copy_allowed = 0x02; +static const unsigned long movefile_delay_until_reboot = 0x04; +static const unsigned long movefile_replace_existing = 0x01; +static const unsigned long movefile_write_through = 0x08; +static const unsigned long movefile_create_hardlink = 0x10; +static const unsigned long movefile_fail_if_not_trackable = 0x20; + +static const unsigned long file_share_read = 0x00000001; +static const unsigned long file_share_write = 0x00000002; +static const unsigned long file_share_delete = 0x00000004; + +static const unsigned long file_attribute_readonly = 0x00000001; +static const unsigned long file_attribute_hidden = 0x00000002; +static const unsigned long file_attribute_system = 0x00000004; +static const unsigned long file_attribute_directory = 0x00000010; +static const unsigned long file_attribute_archive = 0x00000020; +static const unsigned long file_attribute_device = 0x00000040; +static const unsigned long file_attribute_normal = 0x00000080; +static const unsigned long file_attribute_temporary = 0x00000100; + +static const unsigned long generic_read = 0x80000000L; +static const unsigned long generic_write = 0x40000000L; + +static const unsigned long wait_object_0 = 0; +static const unsigned long wait_abandoned = 0x00000080L; +static const unsigned long wait_timeout = 258L; +static const unsigned long wait_failed = (unsigned long)0xFFFFFFFF; + +static const unsigned long duplicate_close_source = (unsigned long)0x00000001; +static const unsigned long duplicate_same_access = (unsigned long)0x00000002; + +static const unsigned long format_message_allocate_buffer + = (unsigned long)0x00000100; +static const unsigned long format_message_ignore_inserts + = (unsigned long)0x00000200; +static const unsigned long format_message_from_string + = (unsigned long)0x00000400; +static const unsigned long format_message_from_hmodule + = (unsigned long)0x00000800; +static const unsigned long format_message_from_system + = (unsigned long)0x00001000; +static const unsigned long format_message_argument_array + = (unsigned long)0x00002000; +static const unsigned long format_message_max_width_mask + = (unsigned long)0x000000FF; +static const unsigned long lang_neutral = (unsigned long)0x00; +static const unsigned long sublang_default = (unsigned long)0x01; +static const unsigned long invalid_file_size = (unsigned long)0xFFFFFFFF; +static const unsigned long invalid_file_attributes = ((unsigned long)-1); +static void * const invalid_handle_value = ((void*)(long)(-1)); + +static const unsigned long file_type_char = 0x0002L; +static const unsigned long file_type_disk = 0x0001L; +static const unsigned long file_type_pipe = 0x0003L; +static const unsigned long file_type_remote = 0x8000L; +static const unsigned long file_type_unknown = 0x0000L; + +static const unsigned long create_new = 1; +static const unsigned long create_always = 2; +static const unsigned long open_existing = 3; +static const unsigned long open_always = 4; +static const unsigned long truncate_existing = 5; + +static const unsigned long file_begin = 0; +static const unsigned long file_current = 1; +static const unsigned long file_end = 2; + +static const unsigned long lockfile_fail_immediately = 1; +static const unsigned long lockfile_exclusive_lock = 2; +static const unsigned long error_lock_violation = 33; +static const unsigned long security_descriptor_revision = 1; + +const unsigned long max_record_buffer_size = 0x10000L; // 64K +const unsigned long max_path = 260; + +//Keys +static const hkey hkey_local_machine = (hkey)(unsigned long*)(long)(0x80000002); +static unsigned long key_query_value = 0x0001; + +//COM API +const unsigned long RPC_C_AUTHN_LEVEL_PKT_BIPC = 4; +const unsigned long RPC_C_AUTHN_DEFAULT_BIPC = 0xffffffffL; +const unsigned long RPC_C_AUTHZ_DEFAULT_BIPC = 0xffffffffL; +const unsigned long RPC_C_IMP_LEVEL_IMPERSONATE_BIPC = 3; +const signed long EOAC_NONE_BIPC = 0; +const signed long CLSCTX_INPROC_SERVER_BIPC = 0x1; +const signed long CLSCTX_LOCAL_SERVER_BIPC = 0x4; +const signed long WBEM_FLAG_RETURN_IMMEDIATELY_BIPC = 0x10; +const signed long WBEM_FLAG_RETURN_WHEN_COMPLETE_BIPC = 0x0; +const signed long WBEM_FLAG_FORWARD_ONLY_BIPC = 0x20; +const signed long WBEM_INFINITE_BIPC = 0xffffffffL; +const signed long RPC_E_TOO_LATE_BIPC = 0x80010119L; +const signed long S_OK_BIPC = 0L; +const signed long S_FALSE_BIPC = 1; +const signed long RPC_E_CHANGED_MODE_BIPC = 0x80010106L; +const unsigned long COINIT_APARTMENTTHREADED_BIPC = 0x2; +const unsigned long COINIT_MULTITHREADED_BIPC = 0x0; +const unsigned long COINIT_DISABLE_OLE1DDE_BIPC = 0x4; +const unsigned long COINIT_SPEED_OVER_MEMORY_BIPC = 0x4; + + +//If the user needs to change default COM initialization model, +//it can define AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL to one of these: +// +// COINIT_APARTMENTTHREADED_BIPC +// COINIT_MULTITHREADED_BIPC +// COINIT_DISABLE_OLE1DDE_BIPC +// COINIT_SPEED_OVER_MEMORY_BIPC +#if !defined(AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL) + #define AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL COINIT_APARTMENTTHREADED_BIPC +#elif (AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL != COINIT_APARTMENTTHREADED_BIPC) &&\ + (AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL != COINIT_MULTITHREADED_BIPC) &&\ + (AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL != COINIT_DISABLE_OLE1DDE_BIPC) &&\ + (AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL != COINIT_SPEED_OVER_MEMORY_BIPC) + #error "Wrong value for AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL macro" +#endif + +const GUID_BIPC CLSID_WbemAdministrativeLocator = + { 0xcb8555cc, 0x9128, 0x11d1, {0xad, 0x9b, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff}}; + +const GUID_BIPC IID_IUnknown = { 0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; + +static const unsigned long eventlog_sequential_read = 0x0001; +static const unsigned long eventlog_backwards_read = 0x0008; + +} //namespace winapi { +} //namespace interprocess { +} //namespace autoboost { + + +namespace autoboost { +namespace interprocess { +namespace winapi { + +inline unsigned long get_last_error() +{ return GetLastError(); } + +inline void set_last_error(unsigned long err) +{ return SetLastError(err); } + +inline unsigned long format_message + (unsigned long dwFlags, const void *lpSource, + unsigned long dwMessageId, unsigned long dwLanguageId, + char *lpBuffer, unsigned long nSize, std::va_list *Arguments) +{ + return FormatMessageA + (dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments); +} + +//And now, wrapper functions +inline void * local_free(void *hmem) +{ return LocalFree(hmem); } + +inline unsigned long make_lang_id(unsigned long p, unsigned long s) +{ return ((((unsigned short)(s)) << 10) | (unsigned short)(p)); } + +inline void sched_yield() +{ + if(!SwitchToThread()){ + Sleep(0); + } +} + +inline void sleep_tick() +{ Sleep(1); } + +inline void sleep(unsigned long ms) +{ Sleep(ms); } + +inline unsigned long get_current_thread_id() +{ return GetCurrentThreadId(); } + +inline bool get_process_times + ( void *hProcess, interprocess_filetime* lpCreationTime + , interprocess_filetime *lpExitTime, interprocess_filetime *lpKernelTime + , interprocess_filetime *lpUserTime ) +{ return 0 != GetProcessTimes(hProcess, lpCreationTime, lpExitTime, lpKernelTime, lpUserTime); } + +inline unsigned long get_current_process_id() +{ return GetCurrentProcessId(); } + +inline unsigned int close_handle(void* handle) +{ return CloseHandle(handle); } + +inline void * find_first_file(const char *lpFileName, win32_find_data *lpFindFileData) +{ return FindFirstFileA(lpFileName, lpFindFileData); } + +inline bool find_next_file(void *hFindFile, win32_find_data *lpFindFileData) +{ return FindNextFileA(hFindFile, lpFindFileData) != 0; } + +inline bool find_close(void *handle) +{ return FindClose(handle) != 0; } + +inline bool duplicate_current_process_handle + (void *hSourceHandle, void **lpTargetHandle) +{ + return 0 != DuplicateHandle + ( GetCurrentProcess(), hSourceHandle, GetCurrentProcess() + , lpTargetHandle, 0, 0 + , duplicate_same_access); +} + +inline unsigned long get_file_type(void *hFile) +{ + return GetFileType(hFile); +} + +/* +inline void get_system_time_as_file_time(interprocess_filetime *filetime) +{ GetSystemTimeAsFileTime(filetime); } + +inline bool file_time_to_local_file_time + (const interprocess_filetime *in, const interprocess_filetime *out) +{ return 0 != FileTimeToLocalFileTime(in, out); } +*/ +inline void *open_or_create_mutex(const char *name, bool initial_owner, interprocess_security_attributes *attr) +{ return CreateMutexA(attr, (int)initial_owner, name); } + +inline unsigned long wait_for_single_object(void *handle, unsigned long time) +{ return WaitForSingleObject(handle, time); } + +inline int release_mutex(void *handle) +{ return ReleaseMutex(handle); } + +inline int unmap_view_of_file(void *address) +{ return UnmapViewOfFile(address); } + +inline void *open_or_create_semaphore(const char *name, long initial_count, long maximum_count, interprocess_security_attributes *attr) +{ return CreateSemaphoreA(attr, initial_count, maximum_count, name); } + +inline void *open_semaphore(const char *name) +{ return OpenSemaphoreA(semaphore_all_access, 0, name); } + +inline int release_semaphore(void *handle, long release_count, long *prev_count) +{ return ReleaseSemaphore(handle, release_count, prev_count); } + +class interprocess_all_access_security +{ + interprocess_security_attributes sa; + interprocess_security_descriptor sd; + bool initialized; + + public: + interprocess_all_access_security() + : initialized(false) + { + if(!InitializeSecurityDescriptor(&sd, security_descriptor_revision)) + return; + if(!SetSecurityDescriptorDacl(&sd, true, 0, false)) + return; + sa.lpSecurityDescriptor = &sd; + sa.nLength = sizeof(interprocess_security_attributes); + sa.bInheritHandle = false; + initialized = false; + } + + interprocess_security_attributes *get_attributes() + { return &sa; } +}; + +inline void * create_file_mapping (void * handle, unsigned long access, unsigned __int64 file_offset, const char * name, interprocess_security_attributes *psec) +{ + const unsigned long high_size(file_offset >> 32), low_size((autoboost::uint32_t)file_offset); + return CreateFileMappingA (handle, psec, access, high_size, low_size, name); +} + +inline void * open_file_mapping (unsigned long access, const char *name) +{ return OpenFileMappingA (access, 0, name); } + +inline void *map_view_of_file_ex(void *handle, unsigned long file_access, unsigned __int64 offset, std::size_t numbytes, void *base_addr) +{ + const unsigned long offset_low = (unsigned long)(offset & ((unsigned __int64)0xFFFFFFFF)); + const unsigned long offset_high = offset >> 32; + return MapViewOfFileEx(handle, file_access, offset_high, offset_low, numbytes, base_addr); +} + +inline void *create_file(const char *name, unsigned long access, unsigned long creation_flags, unsigned long attributes, interprocess_security_attributes *psec) +{ + for (unsigned int attempt(0); attempt < error_sharing_violation_tries; ++attempt){ + void * const handle = CreateFileA(name, access, + file_share_read | file_share_write | file_share_delete, + psec, creation_flags, attributes, 0); + bool const invalid(invalid_handle_value == handle); + if (!invalid){ + return handle; + } + if (error_sharing_violation != get_last_error()){ + return handle; + } + sleep(error_sharing_violation_sleep_ms); + } + return invalid_handle_value; +} + +inline void get_system_info(system_info *info) +{ GetSystemInfo(info); } + +inline bool flush_view_of_file(void *base_addr, std::size_t numbytes) +{ return 0 != FlushViewOfFile(base_addr, numbytes); } + +inline bool virtual_unlock(void *base_addr, std::size_t numbytes) +{ return 0 != VirtualUnlock(base_addr, numbytes); } + +inline bool virtual_protect(void *base_addr, std::size_t numbytes, unsigned long flNewProtect, unsigned long &lpflOldProtect) +{ return 0 != VirtualProtect(base_addr, numbytes, flNewProtect, &lpflOldProtect); } + +inline bool flush_file_buffers(void *handle) +{ return 0 != FlushFileBuffers(handle); } + +inline bool get_file_size(void *handle, __int64 &size) +{ return 0 != GetFileSizeEx(handle, (large_integer*)&size); } + +inline bool create_directory(const char *name) +{ + interprocess_all_access_security sec; + return 0 != CreateDirectoryA(name, sec.get_attributes()); +} + +inline bool remove_directory(const char *lpPathName) +{ return 0 != RemoveDirectoryA(lpPathName); } + +inline unsigned long get_temp_path(unsigned long length, char *buffer) +{ return GetTempPathA(length, buffer); } + +inline int set_end_of_file(void *handle) +{ return 0 != SetEndOfFile(handle); } + +inline bool set_file_pointer_ex(void *handle, __int64 distance, __int64 *new_file_pointer, unsigned long move_method) +{ + large_integer d; d.QuadPart = distance; + return 0 != SetFilePointerEx(handle, d, (large_integer*)new_file_pointer, move_method); +} + +inline bool lock_file_ex(void *hnd, unsigned long flags, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped *overlapped) +{ return 0 != LockFileEx(hnd, flags, reserved, size_low, size_high, overlapped); } + +inline bool unlock_file_ex(void *hnd, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped *overlapped) +{ return 0 != UnlockFileEx(hnd, reserved, size_low, size_high, overlapped); } + +inline bool write_file(void *hnd, const void *buffer, unsigned long bytes_to_write, unsigned long *bytes_written, interprocess_overlapped* overlapped) +{ return 0 != WriteFile(hnd, buffer, bytes_to_write, bytes_written, overlapped); } + +inline bool read_file(void *hnd, void *buffer, unsigned long bytes_to_read, unsigned long *bytes_read, interprocess_overlapped* overlapped) +{ return 0 != ReadFile(hnd, buffer, bytes_to_read, bytes_read, overlapped); } + +inline bool get_file_information_by_handle(void *hnd, interprocess_by_handle_file_information *info) +{ return 0 != GetFileInformationByHandle(hnd, info); } + +inline long interlocked_increment(long volatile *addr) +{ return AUTOBOOST_INTERLOCKED_INCREMENT(addr); } + +inline long interlocked_decrement(long volatile *addr) +{ return AUTOBOOST_INTERLOCKED_DECREMENT(addr); } + +inline long interlocked_compare_exchange(long volatile *addr, long val1, long val2) +{ return AUTOBOOST_INTERLOCKED_COMPARE_EXCHANGE(addr, val1, val2); } + +inline long interlocked_exchange_add(long volatile* addend, long value) +{ return AUTOBOOST_INTERLOCKED_EXCHANGE_ADD(const_cast(addend), value); } + +inline long interlocked_exchange(long volatile* addend, long value) +{ return AUTOBOOST_INTERLOCKED_EXCHANGE(const_cast(addend), value); } + +//Forward functions +inline hmodule load_library(const char *name) +{ return LoadLibraryA(name); } + +inline bool free_library(hmodule module) +{ return 0 != FreeLibrary(module); } + +inline farproc_t get_proc_address(hmodule module, const char *name) +{ return GetProcAddress(module, name); } + +inline void *get_current_process() +{ return GetCurrentProcess(); } + +inline hmodule get_module_handle(const char *name) +{ return GetModuleHandleA(name); } + +inline long reg_open_key_ex(hkey hKey, const char *lpSubKey, unsigned long ulOptions, unsigned long samDesired, hkey *phkResult) +{ return RegOpenKeyExA(hKey, lpSubKey, ulOptions, samDesired, phkResult); } + +inline long reg_query_value_ex(hkey hKey, const char *lpValueName, unsigned long*lpReserved, unsigned long*lpType, unsigned char *lpData, unsigned long*lpcbData) +{ return RegQueryValueExA(hKey, lpValueName, lpReserved, lpType, lpData, lpcbData); } + +inline long reg_close_key(hkey hKey) +{ return RegCloseKey(hKey); } + +inline void initialize_object_attributes +( object_attributes_t *pobject_attr, unicode_string_t *name + , unsigned long attr, void *rootdir, void *security_descr) + +{ + pobject_attr->Length = sizeof(object_attributes_t); + pobject_attr->RootDirectory = rootdir; + pobject_attr->Attributes = attr; + pobject_attr->ObjectName = name; + pobject_attr->SecurityDescriptor = security_descr; + pobject_attr->SecurityQualityOfService = 0; +} + +inline void rtl_init_empty_unicode_string(unicode_string_t *ucStr, wchar_t *buf, unsigned short bufSize) +{ + ucStr->Buffer = buf; + ucStr->Length = 0; + ucStr->MaximumLength = bufSize; +} + +//A class that locates and caches loaded DLL function addresses. +template +struct function_address_holder +{ + enum { NtSetInformationFile + , NtQuerySystemInformation + , NtQueryObject + , NtQuerySemaphore + , NtQuerySection + , NtOpenFile + , NtClose + , NtQueryTimerResolution + , NtSetTimerResolution + , QueryPerformanceCounter + , QueryPerformanceFrequency + , NumFunction + }; + enum { NtDll_dll, Kernel32_dll, NumModule }; + + private: + static const char *FunctionNames[NumFunction]; + static const char *ModuleNames[NumModule]; + static farproc_t FunctionAddresses[NumFunction]; + static unsigned int FunctionModules[NumFunction]; + static volatile long FunctionStates[NumFunction]; + static hmodule ModuleAddresses[NumModule]; + static volatile long ModuleStates[NumModule]; + + static hmodule get_module_from_id(unsigned int id) + { + AUTOBOOST_ASSERT(id < (unsigned int)NumModule); + hmodule addr = get_module_handle(ModuleNames[id]); + AUTOBOOST_ASSERT(addr); + return addr; + } + + static hmodule get_module(const unsigned int id) + { + AUTOBOOST_ASSERT(id < (unsigned int)NumModule); + for(unsigned i = 0; ModuleStates[id] < 2; ++i){ + if(interlocked_compare_exchange(&ModuleStates[id], 1, 0) == 0){ + ModuleAddresses[id] = get_module_from_id(id); + interlocked_increment(&ModuleStates[id]); + break; + } + else if(i & 1){ + sched_yield(); + } + else{ + sleep_tick(); + } + } + return ModuleAddresses[id]; + } + + static farproc_t get_address_from_dll(const unsigned int id) + { + AUTOBOOST_ASSERT(id < (unsigned int)NumFunction); + farproc_t addr = get_proc_address(get_module(FunctionModules[id]), FunctionNames[id]); + AUTOBOOST_ASSERT(addr); + return addr; + } + + public: + static farproc_t get(const unsigned int id) + { + AUTOBOOST_ASSERT(id < (unsigned int)NumFunction); + for(unsigned i = 0; FunctionStates[id] < 2; ++i){ + if(interlocked_compare_exchange(&FunctionStates[id], 1, 0) == 0){ + FunctionAddresses[id] = get_address_from_dll(id); + interlocked_increment(&FunctionStates[id]); + break; + } + else if(i & 1){ + sched_yield(); + } + else{ + sleep_tick(); + } + } + return FunctionAddresses[id]; + } +}; + +template +const char *function_address_holder::FunctionNames[function_address_holder::NumFunction] = +{ + "NtSetInformationFile", + "NtQuerySystemInformation", + "NtQueryObject", + "NtQuerySemaphore", + "NtQuerySection", + "NtOpenFile", + "NtClose", + "NtQueryTimerResolution", + "NtSetTimerResolution", + "QueryPerformanceCounter", + "QueryPerformanceFrequency" +}; + +template +unsigned int function_address_holder::FunctionModules[function_address_holder::NumFunction] = +{ + NtDll_dll, + NtDll_dll, + NtDll_dll, + NtDll_dll, + NtDll_dll, + NtDll_dll, + NtDll_dll, + NtDll_dll, + NtDll_dll, + Kernel32_dll, + Kernel32_dll +}; + +template +const char *function_address_holder::ModuleNames[function_address_holder::NumModule] = +{ + "ntdll.dll", + "kernel32.dll" +}; + + +template +farproc_t function_address_holder::FunctionAddresses[function_address_holder::NumFunction]; + +template +volatile long function_address_holder::FunctionStates[function_address_holder::NumFunction]; + +template +hmodule function_address_holder::ModuleAddresses[function_address_holder::NumModule]; + +template +volatile long function_address_holder::ModuleStates[function_address_holder::NumModule]; + + +struct dll_func + : public function_address_holder<0> +{}; + +//Complex winapi based functions... +struct library_unloader +{ + hmodule lib_; + library_unloader(hmodule module) : lib_(module){} + ~library_unloader(){ free_library(lib_); } +}; + + +inline bool get_system_time_of_day_information(system_timeofday_information &info) +{ + NtQuerySystemInformation_t pNtQuerySystemInformation = (NtQuerySystemInformation_t) + dll_func::get(dll_func::NtQuerySystemInformation); + unsigned long res; + long status = pNtQuerySystemInformation(system_time_of_day_information, &info, sizeof(info), &res); + if(status){ + return false; + } + return true; +} + +inline bool get_boot_time(unsigned char (&bootstamp) [BootstampLength]) +{ + system_timeofday_information info; + bool ret = get_system_time_of_day_information(info); + if(!ret){ + return false; + } + std::memcpy(&bootstamp[0], &info.Reserved1, sizeof(bootstamp)); + return true; +} + +inline bool get_boot_and_system_time(unsigned char (&bootsystemstamp) [BootAndSystemstampLength]) +{ + system_timeofday_information info; + bool ret = get_system_time_of_day_information(info); + if(!ret){ + return false; + } + std::memcpy(&bootsystemstamp[0], &info.Reserved1, sizeof(bootsystemstamp)); + return true; +} + +inline bool get_boot_time_str(char *bootstamp_str, std::size_t &s) + //will write BootstampLength chars +{ + if(s < (BootstampLength*2)) + return false; + system_timeofday_information info; + bool ret = get_system_time_of_day_information(info); + if(!ret){ + return false; + } + const char Characters [] = + { '0', '1', '2', '3', '4', '5', '6', '7' + , '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + std::size_t char_counter = 0; + for(std::size_t i = 0; i != static_cast(BootstampLength); ++i){ + bootstamp_str[char_counter++] = Characters[(info.Reserved1[i]&0xF0)>>4]; + bootstamp_str[char_counter++] = Characters[(info.Reserved1[i]&0x0F)]; + } + s = BootstampLength*2; + return true; +} + +//Writes the hexadecimal value of the buffer, in the wide character string. +//str must be twice length +inline void buffer_to_wide_str(const void *buf, std::size_t length, wchar_t *str) +{ + const wchar_t Characters [] = + { L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7' + , L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F' }; + std::size_t char_counter = 0; + const char *chbuf = static_cast(buf); + for(std::size_t i = 0; i != length; ++i){ + str[char_counter++] = Characters[(chbuf[i]&0xF0)>>4]; + str[char_counter++] = Characters[(chbuf[i]&0x0F)]; + } +} + +inline bool get_boot_and_system_time_wstr(wchar_t *bootsystemstamp, std::size_t &s) + //will write BootAndSystemstampLength chars +{ + if(s < (BootAndSystemstampLength*2)) + return false; + system_timeofday_information info; + bool ret = get_system_time_of_day_information(info); + if(!ret){ + return false; + } + + buffer_to_wide_str(&info.Reserved1[0], BootAndSystemstampLength, bootsystemstamp); + s = BootAndSystemstampLength*2; + return true; +} + +class handle_closer +{ + void *handle_; + handle_closer(const handle_closer &); + handle_closer& operator=(const handle_closer &); + public: + explicit handle_closer(void *handle) : handle_(handle){} + ~handle_closer() + { close_handle(handle_); } +}; + +class eventlog_handle_closer +{ + void *handle_; + eventlog_handle_closer(const handle_closer &); + eventlog_handle_closer& operator=(const eventlog_handle_closer &); + public: + explicit eventlog_handle_closer(void *handle) : handle_(handle){} + ~eventlog_handle_closer() + { CloseEventLog(handle_); } +}; + +union ntquery_mem_t +{ + object_name_information_t name; + struct ren_t + { + file_rename_information_t info; + wchar_t buf[1]; + } ren; +}; + +class nt_query_mem_deleter +{ + static const std::size_t rename_offset = offsetof(ntquery_mem_t, ren.info.FileName) - + offsetof(ntquery_mem_t, name.Name.Buffer); + // Timestamp process id atomic count + static const std::size_t rename_suffix = + (SystemTimeOfDayInfoLength + sizeof(unsigned long) + sizeof(autoboost::uint32_t))*2; + + public: + nt_query_mem_deleter(std::size_t object_name_information_size) + : m_size(object_name_information_size + rename_offset + rename_suffix) + , m_buf(new char [m_size]) + {} + + ~nt_query_mem_deleter() + { + delete[]m_buf; + } + + void realloc_mem(std::size_t num_bytes) + { + num_bytes += rename_suffix + rename_offset; + char *buf = m_buf; + m_buf = new char[num_bytes]; + delete[]buf; + m_size = num_bytes; + } + + ntquery_mem_t *query_mem() const + { return static_cast(static_cast(m_buf)); } + + unsigned long object_name_information_size() const + { + return static_cast(m_size - rename_offset - SystemTimeOfDayInfoLength*2); + } + + std::size_t file_rename_information_size() const + { return static_cast(m_size); } + + private: + std::size_t m_size; + char *m_buf; +}; + +class c_heap_deleter +{ + public: + c_heap_deleter(std::size_t size) + : m_buf(::malloc(size)) + {} + + ~c_heap_deleter() + { + if(m_buf) ::free(m_buf); + } + + void realloc_mem(std::size_t num_bytes) + { + void *buf = ::realloc(m_buf, num_bytes); + if(!buf){ + free(m_buf); + m_buf = 0; + } + } + + void *get() const + { return m_buf; } + + private: + void *m_buf; +}; + +inline bool unlink_file(const char *filename) +{ + //Don't try to optimize doing a DeleteFile first + //as there are interactions with permissions and + //in-use files. + // + //if(!delete_file(filename)){ + // (...) + // + + //This functions tries to emulate UNIX unlink semantics in windows. + // + //- Open the file and mark the handle as delete-on-close + //- Rename the file to an arbitrary name based on a random number + //- Close the handle. If there are no file users, it will be deleted. + // Otherwise it will be used by already connected handles but the + // file name can't be used to open this file again + try{ + NtSetInformationFile_t pNtSetInformationFile = + (NtSetInformationFile_t)dll_func::get(dll_func::NtSetInformationFile); + + NtQueryObject_t pNtQueryObject = (NtQueryObject_t)dll_func::get(dll_func::NtQueryObject); + + //First step: Obtain a handle to the file using Win32 rules. This resolves relative paths + void *fh = create_file(filename, generic_read | delete_access, open_existing, 0, 0); + if(fh == invalid_handle_value){ + return false; + } + + handle_closer h_closer(fh); + { + //Obtain name length + unsigned long size; + const std::size_t initial_string_mem = 512u; + + nt_query_mem_deleter nt_query_mem(sizeof(ntquery_mem_t)+initial_string_mem); + //Obtain file name with guessed length + if(pNtQueryObject(fh, object_name_information, nt_query_mem.query_mem(), nt_query_mem.object_name_information_size(), &size)){ + //Obtain file name with exact length buffer + nt_query_mem.realloc_mem(size); + if(pNtQueryObject(fh, object_name_information, nt_query_mem.query_mem(), nt_query_mem.object_name_information_size(), &size)){ + return false; + } + } + ntquery_mem_t *pmem = nt_query_mem.query_mem(); + file_rename_information_t *pfri = &pmem->ren.info; + const std::size_t RenMaxNumChars = + (((char*)(pmem) + nt_query_mem.file_rename_information_size()) - (char*)&pmem->ren.info.FileName[0])/sizeof(wchar_t); + + //Copy filename to the rename member + std::memmove(pmem->ren.info.FileName, pmem->name.Name.Buffer, pmem->name.Name.Length); + std::size_t filename_string_length = pmem->name.Name.Length/sizeof(wchar_t); + + //Search '\\' character to replace from it + for(std::size_t i = filename_string_length; i != 0; --filename_string_length){ + if(pmem->ren.info.FileName[--i] == L'\\') + break; + } + + //Add random number + std::size_t s = RenMaxNumChars - filename_string_length; + if(!get_boot_and_system_time_wstr(&pfri->FileName[filename_string_length], s)){ + return false; + } + filename_string_length += s; + + //Sometimes the precission of the timestamp is not enough and we need to add another random number. + //The process id (to exclude concurrent processes) and an atomic count (to exclude concurrent threads). + //should be enough + const unsigned long pid = get_current_process_id(); + buffer_to_wide_str(&pid, sizeof(pid), &pfri->FileName[filename_string_length]); + filename_string_length += sizeof(pid)*2; + + static volatile autoboost::uint32_t u32_count = 0; + interlocked_decrement(reinterpret_cast(&u32_count)); + buffer_to_wide_str(const_cast(&u32_count), sizeof(autoboost::uint32_t), &pfri->FileName[filename_string_length]); + filename_string_length += sizeof(autoboost::uint32_t)*2; + + //Fill rename information (FileNameLength is in bytes) + pfri->FileNameLength = static_cast(sizeof(wchar_t)*(filename_string_length)); + pfri->Replace = 1; + pfri->RootDir = 0; + + //Cange the name of the in-use file... + io_status_block_t io; + if(0 != pNtSetInformationFile(fh, &io, pfri, nt_query_mem.file_rename_information_size(), file_rename_information)){ + return false; + } + } + //...and mark it as delete-on-close + { + //Don't use pNtSetInformationFile with file_disposition_information as it can return STATUS_CANNOT_DELETE + //if the file is still mapped. Reopen it with NtOpenFile and file_delete_on_close + NtOpenFile_t pNtOpenFile = (NtOpenFile_t)dll_func::get(dll_func::NtOpenFile); + NtClose_t pNtClose = (NtClose_t)dll_func::get(dll_func::NtClose); + const wchar_t empty_str [] = L""; + unicode_string_t ustring = { sizeof(empty_str) - sizeof (wchar_t) //length in bytes without null + , sizeof(empty_str) //total size in bytes of memory allocated for Buffer. + , const_cast(empty_str) + }; + object_attributes_t object_attr; + initialize_object_attributes(&object_attr, &ustring, 0, fh, 0); + void* fh2 = 0; + io_status_block_t io; + pNtOpenFile( &fh2, delete_flag, &object_attr, &io + , file_share_read | file_share_write | file_share_delete, file_delete_on_close); + pNtClose(fh2); + //Even if NtOpenFile fails, the file was renamed and the original no longer exists, so return a success status + return true; + } + } + catch(...){ + return false; + } + return true; +} + +struct reg_closer +{ + hkey key_; + reg_closer(hkey key) : key_(key){} + ~reg_closer(){ reg_close_key(key_); } +}; + +inline void get_shared_documents_folder(std::string &s) +{ + #if 1 //Original registry search code + s.clear(); + hkey key; + if (reg_open_key_ex( hkey_local_machine + , "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" + , 0 + , key_query_value + , &key) == 0){ + reg_closer key_closer(key); + + //Obtain the value + unsigned long size; + unsigned long type; + const char *const reg_value = "Common AppData"; + //long err = (*pRegQueryValue)( key, reg_value, 0, &type, 0, &size); + long err = reg_query_value_ex( key, reg_value, 0, &type, 0, &size); + if(!err){ + //Size includes terminating NULL + s.resize(size); + //err = (*pRegQueryValue)( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size); + err = reg_query_value_ex( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size); + if(!err) + s.erase(s.end()-1); + (void)err; + } + } + #else //registry alternative: SHGetSpecialFolderPathA + const int BIPC_CSIDL_COMMON_APPDATA = 0x0023; // All Users\Application Data + const int BIPC_CSIDL_FLAG_CREATE = 0x8000; // new for Win2K, or this in to force creation of folder + const int BIPC_SHGFP_TYPE_CURRENT = 0; // current value for user, verify it exists + + s.clear(); + char szPath[max_path]; + if(0 == SHGetFolderPathA(0, BIPC_CSIDL_COMMON_APPDATA | BIPC_CSIDL_FLAG_CREATE, 0, BIPC_SHGFP_TYPE_CURRENT, szPath)){ + s = szPath; + } + + #endif +} + +inline void get_registry_value(const char *folder, const char *value_key, std::vector &s) +{ + s.clear(); + hkey key; + if (reg_open_key_ex( hkey_local_machine + , folder + , 0 + , key_query_value + , &key) == 0){ + reg_closer key_closer(key); + + //Obtain the value + unsigned long size; + unsigned long type; + const char *const reg_value = value_key; + //long err = (*pRegQueryValue)( key, reg_value, 0, &type, 0, &size); + long err = reg_query_value_ex( key, reg_value, 0, &type, 0, &size); + if(!err){ + //Size includes terminating NULL + s.resize(size); + //err = (*pRegQueryValue)( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size); + err = reg_query_value_ex( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size); + if(!err) + s.erase(s.end()-1); + (void)err; + } + } +} + +struct co_uninitializer +{ + co_uninitializer(bool b_uninitialize) + : m_b_uninitialize(b_uninitialize) + {} + + ~co_uninitializer() + { + if(m_b_uninitialize){ + CoUninitialize(); + } + } + + private: + const bool m_b_uninitialize; +}; + +template +struct com_releaser +{ + Object *&object_; + com_releaser(Object *&object) : object_(object) {} + ~com_releaser() { object_->Release(); object_ = 0; } +}; + +inline bool get_wmi_class_attribute( std::wstring& strValue, const wchar_t *wmi_class, const wchar_t *wmi_class_var) +{ + //See example http://msdn.microsoft.com/en-us/library/aa390423%28v=VS.85%29.aspx + // + //See AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL definition if you need to change the + //default value of this macro in your application + long co_init_ret = CoInitializeEx(0, AUTOBOOST_INTERPROCESS_WINDOWS_COINIT_MODEL); + if(co_init_ret != S_OK_BIPC && co_init_ret != S_FALSE_BIPC && co_init_ret != RPC_E_CHANGED_MODE_BIPC) + return false; + co_uninitializer co_initialize_end(co_init_ret != RPC_E_CHANGED_MODE_BIPC); + (void)co_initialize_end; + + bool bRet = false; + long sec_init_ret = CoInitializeSecurity + ( 0 //pVoid + ,-1 //cAuthSvc + , 0 //asAuthSvc + , 0 //pReserved1 + , RPC_C_AUTHN_LEVEL_PKT_BIPC //dwAuthnLevel + , RPC_C_IMP_LEVEL_IMPERSONATE_BIPC //dwImpLevel + , 0 //pAuthList + , EOAC_NONE_BIPC //dwCapabilities + , 0 //pReserved3 + ); + if( 0 == sec_init_ret || RPC_E_TOO_LATE_BIPC == sec_init_ret) + { + IWbemLocator_BIPC * pIWbemLocator = 0; + const wchar_t * bstrNamespace = L"root\\cimv2"; + + if( 0 != CoCreateInstance( + CLSID_WbemAdministrativeLocator, + 0, + CLSCTX_INPROC_SERVER_BIPC | CLSCTX_LOCAL_SERVER_BIPC, + IID_IUnknown, (void **)&pIWbemLocator)){ + return false; + } + + com_releaser IWbemLocator_releaser(pIWbemLocator); + + IWbemServices_BIPC *pWbemServices = 0; + + if( 0 != pIWbemLocator->ConnectServer( + (bstr)bstrNamespace, // Namespace + 0, // Userid + 0, // PW + 0, // Locale + 0, // flags + 0, // Authority + 0, // Context + &pWbemServices + ) + ){ + return false; + } + + if( S_OK_BIPC != CoSetProxyBlanket( + pWbemServices, + RPC_C_AUTHN_DEFAULT_BIPC, + RPC_C_AUTHZ_DEFAULT_BIPC, + 0, + RPC_C_AUTHN_LEVEL_PKT_BIPC, + RPC_C_IMP_LEVEL_IMPERSONATE_BIPC, + 0, + EOAC_NONE_BIPC + ) + ){ + return false; + } + + com_releaser IWbemServices_releaser(pWbemServices); + + strValue.clear(); + strValue += L"Select "; + strValue += wmi_class_var; + strValue += L" from "; + strValue += wmi_class; + + IEnumWbemClassObject_BIPC * pEnumObject = 0; + + if ( 0 != pWbemServices->ExecQuery( + (bstr)L"WQL", + (bstr)strValue.c_str(), + //WBEM_FLAG_RETURN_IMMEDIATELY_BIPC, + WBEM_FLAG_RETURN_WHEN_COMPLETE_BIPC | WBEM_FLAG_FORWARD_ONLY_BIPC, + 0, + &pEnumObject + ) + ){ + return false; + } + + com_releaser IEnumWbemClassObject_releaser(pEnumObject); + + //WBEM_FLAG_FORWARD_ONLY_BIPC incompatible with Reset + //if ( 0 != pEnumObject->Reset() ){ + //return false; + //} + + wchar_variant vwchar; + unsigned long uCount = 1, uReturned; + IWbemClassObject_BIPC * pClassObject = 0; + while( 0 == pEnumObject->Next( WBEM_INFINITE_BIPC, uCount, &pClassObject, &uReturned ) ) + { + com_releaser IWbemClassObject_releaser(pClassObject); + if ( 0 == pClassObject->Get( (bstr)L"LastBootUpTime", 0, &vwchar, 0, 0 ) ){ + bRet = true; + strValue = (wchar_t*)vwchar.bstrVal; + VariantClear(&vwchar ); + break; + } + } + } + return bRet; +} + +#ifdef AUTOBOOST_INTERPROCESS_BOOTSTAMP_IS_LASTBOOTUPTIME + +//Obtains the bootup time from WMI LastBootUpTime. +//This time seems to change with hibernation and clock synchronization so avoid it. +inline bool get_last_bootup_time( std::wstring& strValue ) +{ + bool ret = get_wmi_class_attribute(strValue, L"Win32_OperatingSystem", L"LastBootUpTime"); + std::size_t timezone = strValue.find(L'+'); + if(timezone != std::wstring::npos){ + strValue.erase(timezone); + } + timezone = strValue.find(L'-'); + if(timezone != std::wstring::npos){ + strValue.erase(timezone); + } + return ret; +} + +inline bool get_last_bootup_time( std::string& str ) +{ + std::wstring wstr; + bool ret = get_last_bootup_time(wstr); + str.resize(wstr.size()); + for(std::size_t i = 0, max = str.size(); i != max; ++i){ + str[i] = '0' + (wstr[i]-L'0'); + } + return ret; +} + +#else + +// Loop through the buffer and obtain the contents of the +// requested record in the buffer. +inline bool find_record_in_buffer( const void* pBuffer, unsigned long dwBytesRead, const char *provider_name + , unsigned int id_to_find, interprocess_eventlogrecord *&pevent_log_record) +{ + const unsigned char * pRecord = static_cast(pBuffer); + const unsigned char * pEndOfRecords = pRecord + dwBytesRead; + + while (pRecord < pEndOfRecords){ + interprocess_eventlogrecord *pTypedRecord = (interprocess_eventlogrecord*)pRecord; + // Check provider, written at the end of the fixed-part of the record + if (0 == std::strcmp(provider_name, (char*)(pRecord + sizeof(interprocess_eventlogrecord)))) + { + // Check event id + if(id_to_find == (pTypedRecord->EventID & 0xFFFF)){ + pevent_log_record = pTypedRecord; + return true; + } + } + + pRecord += pTypedRecord->Length; + } + pevent_log_record = 0; + return false; +} + +//Obtains the bootup time from the System Event Log, +//event ID == 6005 (event log started). +//Adapted from http://msdn.microsoft.com/en-us/library/windows/desktop/bb427356.aspx +inline bool get_last_bootup_time(std::string &stamp) +{ + const char *source_name = "System"; + const char *provider_name = "EventLog"; + const unsigned short event_id = 6005u; + + unsigned long status = 0; + unsigned long dwBytesToRead = 0; + unsigned long dwBytesRead = 0; + unsigned long dwMinimumBytesToRead = 0; + + // The source name (provider) must exist as a subkey of Application. + void *hEventLog = OpenEventLogA(0, source_name); + if (hEventLog){ + eventlog_handle_closer hnd_closer(hEventLog); (void)hnd_closer; + // Allocate an initial block of memory used to read event records. The number + // of records read into the buffer will vary depending on the size of each event. + // The size of each event will vary based on the size of the user-defined + // data included with each event, the number and length of insertion + // strings, and other data appended to the end of the event record. + dwBytesToRead = max_record_buffer_size; + c_heap_deleter heap_deleter(dwBytesToRead); + + // Read blocks of records until you reach the end of the log or an + // error occurs. The records are read from newest to oldest. If the buffer + // is not big enough to hold a complete event record, reallocate the buffer. + if (heap_deleter.get() != 0){ + while (0 == status){ + if (!ReadEventLogA(hEventLog, + eventlog_sequential_read | eventlog_backwards_read, + 0, + heap_deleter.get(), + dwBytesToRead, + &dwBytesRead, + &dwMinimumBytesToRead)) { + status = get_last_error(); + if (error_insufficient_buffer == status) { + status = 0; + dwBytesToRead = dwMinimumBytesToRead; + heap_deleter.realloc_mem(dwMinimumBytesToRead); + if (!heap_deleter.get()){ + return false; + } + } + else{ //Not found or EOF + return false; + } + } + else + { + interprocess_eventlogrecord *pTypedRecord; + // Print the contents of each record in the buffer. + if(find_record_in_buffer(heap_deleter.get(), dwBytesRead, provider_name, event_id, pTypedRecord)){ + char stamp_str[sizeof(unsigned long)*3+1]; + std::sprintf(&stamp_str[0], "%u", ((unsigned int)pTypedRecord->TimeGenerated)); + stamp = stamp_str; + break; + } + } + } + } + } + return true; +} + +#endif + +inline bool is_directory(const char *path) +{ + unsigned long attrib = GetFileAttributesA(path); + + return (attrib != invalid_file_attributes && + (attrib & file_attribute_directory)); +} + +inline bool get_file_mapping_size(void *file_mapping_hnd, __int64 &size) +{ + NtQuerySection_t pNtQuerySection = + (NtQuerySection_t)dll_func::get(dll_func::NtQuerySection); + //Obtain file name + interprocess_section_basic_information info; + unsigned long ntstatus = + pNtQuerySection(file_mapping_hnd, section_basic_information, &info, sizeof(info), 0); + size = info.section_size; + return !ntstatus; +} + +inline bool get_semaphore_info(void *handle, long &count, long &limit) +{ + winapi::interprocess_semaphore_basic_information info; + winapi::NtQuerySemaphore_t pNtQuerySemaphore = + (winapi::NtQuerySemaphore_t)dll_func::get(winapi::dll_func::NtQuerySemaphore); + unsigned int ret_len; + long status = pNtQuerySemaphore(handle, winapi::semaphore_basic_information, &info, sizeof(info), &ret_len); + count = info.count; + limit = info.limit; + return !status; +} + +inline bool query_timer_resolution(unsigned long *lowres, unsigned long *highres, unsigned long *curres) +{ + winapi::NtQueryTimerResolution_t pNtQueryTimerResolution = + (winapi::NtQueryTimerResolution_t)dll_func::get(winapi::dll_func::NtQueryTimerResolution); + return !pNtQueryTimerResolution(lowres, highres, curres); +} + +inline bool set_timer_resolution(unsigned long RequestedResolution, int Set, unsigned long* ActualResolution) +{ + winapi::NtSetTimerResolution_t pNtSetTimerResolution = + (winapi::NtSetTimerResolution_t)dll_func::get(winapi::dll_func::NtSetTimerResolution); + return !pNtSetTimerResolution(RequestedResolution, Set, ActualResolution); +} + +inline bool query_performance_counter(__int64 *lpPerformanceCount) +{ + QueryPerformanceCounter_t pQueryPerformanceCounter = (QueryPerformanceCounter_t) + dll_func::get(dll_func::QueryPerformanceCounter); + return 0 != pQueryPerformanceCounter(lpPerformanceCount); +} + +inline bool query_performance_frequency(__int64 *lpFrequency) +{ + QueryPerformanceCounter_t pQueryPerformanceFrequency = (QueryPerformanceFrequency_t) + dll_func::get(dll_func::QueryPerformanceFrequency); + return 0 != pQueryPerformanceFrequency(lpFrequency); +} + +inline unsigned long get_tick_count() +{ return GetTickCount(); } + +} //namespace winapi +} //namespace interprocess +} //namespace autoboost + +#include + +#endif //#ifdef AUTOBOOST_INTERPROCESS_WIN32_API_HPP diff --git a/contrib/autoboost/autoboost/interprocess/detail/windows_intermodule_singleton.hpp b/contrib/autoboost/autoboost/interprocess/detail/windows_intermodule_singleton.hpp new file mode 100644 index 000000000..cc8657aa2 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/windows_intermodule_singleton.hpp @@ -0,0 +1,310 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2009-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_WINDOWS_INTERMODULE_SINGLETON_HPP +#define AUTOBOOST_INTERPROCESS_WINDOWS_INTERMODULE_SINGLETON_HPP + +#if defined(_MSC_VER) +#pragma once +#endif + +#include +#include +#include + +#if !defined(AUTOBOOST_INTERPROCESS_WINDOWS) + #error "This header can't be included from non-windows operating systems" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost{ +namespace interprocess{ +namespace ipcdetail{ + +namespace intermodule_singleton_helpers { + +//This global map will be implemented using 3 sync primitives: +// +//1) A named mutex that will implement global mutual exclusion between +// threads from different modules/dlls +// +//2) A semaphore that will act as a global counter for modules attached to the global map +// so that the global map can be destroyed when the last module is detached. +// +//3) A semaphore that will be hacked to hold the address of a heap-allocated map in the +// max and current semaphore count. +class windows_semaphore_based_map +{ + typedef autoboost::container::map map_type; + + public: + windows_semaphore_based_map() + { + map_type *m = new map_type; + autoboost::uint32_t initial_count = 0; + autoboost::uint32_t max_count = 0; + + //Windows user address space sizes: + //32 bit windows: [32 bit processes] 2GB or 3GB (31/32 bits) + //64 bit windows: [32 bit processes] 2GB or 4GB (31/32 bits) + // [64 bit processes] 2GB or 8TB (31/43 bits) + // + //Windows semaphores use 'long' parameters (32 bits in LLP64 data model) and + //those values can't be negative, so we have 31 bits to store something + //in max_count and initial count parameters. + //Also, max count must be bigger than 0 and bigger or equal than initial count. + if(sizeof(void*) == sizeof(autoboost::uint32_t)){ + //This means that for 32 bit processes, a semaphore count (31 usable bits) is + //enough to store 4 byte aligned memory (4GB -> 32 bits - 2 bits = 30 bits). + //The max count will hold the pointer value and current semaphore count + //will be zero. + // + //Relying in UB with a cast through union, but all known windows compilers + //accept this (C11 also accepts this). + union caster_union + { + void *addr; + autoboost::uint32_t addr_uint32; + } caster; + caster.addr = m; + //memory is at least 4 byte aligned in windows + AUTOBOOST_ASSERT((caster.addr_uint32 & autoboost::uint32_t(3)) == 0); + max_count = caster.addr_uint32 >> 2; + } + else if(sizeof(void*) == sizeof(autoboost::uint64_t)){ + //Relying in UB with a cast through union, but all known windows compilers + //accept this (C11 accepts this). + union caster_union + { + void *addr; + autoboost::uint64_t addr_uint64; + } caster; + caster.addr = m; + //We'll encode the address using 30 bits in each 32 bit high and low parts. + //High part will be the sem max count, low part will be the sem initial count. + //(restrictions: max count > 0, initial count >= 0 and max count >= initial count): + // + // - Low part will be shifted two times (4 byte alignment) so that top + // two bits are cleared (the top one for sign, the next one to + // assure low part value is always less than the high part value. + // - The top bit of the high part will be cleared and the next bit will be 1 + // (so high part is always bigger than low part due to the quasi-top bit). + // + // This means that the addresses we can store must be 4 byte aligned + // and less than 1 ExbiBytes ( 2^60 bytes, ~1 ExaByte). User-level address space in Windows 64 + // is much less than this (8TB, 2^43 bytes): "1 EByte (or it was 640K?) ought to be enough for anybody" ;-). + caster.addr = m; + AUTOBOOST_ASSERT((caster.addr_uint64 & autoboost::uint64_t(3)) == 0); + max_count = autoboost::uint32_t(caster.addr_uint64 >> 32); + initial_count = autoboost::uint32_t(caster.addr_uint64); + initial_count = initial_count/4; + //Make sure top two bits are zero + AUTOBOOST_ASSERT((max_count & autoboost::uint32_t(0xC0000000)) == 0); + //Set quasi-top bit + max_count |= autoboost::uint32_t(0x40000000); + } + bool created = false; + const permissions & perm = permissions(); + std::string pid_creation_time, name; + get_pid_creation_time_str(pid_creation_time); + name = "bipc_gmap_sem_lock_"; + name += pid_creation_time; + bool success = m_mtx_lock.open_or_create(name.c_str(), perm); + name = "bipc_gmap_sem_count_"; + name += pid_creation_time; + scoped_lock lck(m_mtx_lock); + { + success = success && m_sem_count.open_or_create + ( name.c_str(), static_cast(0), winapi_semaphore_wrapper::MaxCount, perm, created); + name = "bipc_gmap_sem_map_"; + name += pid_creation_time; + success = success && m_sem_map.open_or_create + (name.c_str(), initial_count, max_count, perm, created); + if(!success){ + delete m; + //winapi_xxx wrappers do the cleanup... + throw int(0); + } + if(!created){ + delete m; + } + else{ + AUTOBOOST_ASSERT(&get_map_unlocked() == m); + } + m_sem_count.post(); + } + } + + map_type &get_map_unlocked() + { + if(sizeof(void*) == sizeof(autoboost::uint32_t)){ + union caster_union + { + void *addr; + autoboost::uint32_t addr_uint32; + } caster; + caster.addr = 0; + caster.addr_uint32 = m_sem_map.limit(); + caster.addr_uint32 = caster.addr_uint32 << 2; + return *static_cast(caster.addr); + } + else{ + union caster_union + { + void *addr; + autoboost::uint64_t addr_uint64; + } caster; + autoboost::uint32_t max_count(m_sem_map.limit()), initial_count(m_sem_map.value()); + //Clear quasi-top bit + max_count &= autoboost::uint32_t(0xBFFFFFFF); + caster.addr_uint64 = max_count; + caster.addr_uint64 = caster.addr_uint64 << 32; + caster.addr_uint64 |= autoboost::uint64_t(initial_count) << 2; + return *static_cast(caster.addr); + } + } + + ref_count_ptr *find(const char *name) + { + scoped_lock lck(m_mtx_lock); + map_type &map = this->get_map_unlocked(); + map_type::iterator it = map.find(autoboost::container::string(name)); + if(it != map.end()){ + return &it->second; + } + else{ + return 0; + } + } + + ref_count_ptr * insert(const char *name, const ref_count_ptr &ref) + { + scoped_lock lck(m_mtx_lock); + map_type &map = this->get_map_unlocked(); + map_type::iterator it = map.insert(map_type::value_type(autoboost::container::string(name), ref)).first; + return &it->second; + } + + bool erase(const char *name) + { + scoped_lock lck(m_mtx_lock); + map_type &map = this->get_map_unlocked(); + return map.erase(autoboost::container::string(name)) != 0; + } + + template + void atomic_func(F &f) + { + scoped_lock lck(m_mtx_lock); + f(); + } + + ~windows_semaphore_based_map() + { + scoped_lock lck(m_mtx_lock); + m_sem_count.wait(); + if(0 == m_sem_count.value()){ + map_type &map = this->get_map_unlocked(); + AUTOBOOST_ASSERT(map.empty()); + delete ↦ + } + //First close sems to protect this with the external mutex + m_sem_map.close(); + m_sem_count.close(); + //Once scoped_lock unlocks the mutex, the destructor will close the handle... + } + + private: + winapi_mutex_wrapper m_mtx_lock; + winapi_semaphore_wrapper m_sem_map; + winapi_semaphore_wrapper m_sem_count; +}; + +template<> +struct thread_safe_global_map_dependant +{ + static void apply_gmem_erase_logic(const char *, const char *){} + + static bool remove_old_gmem() + { return true; } + + struct lock_file_logic + { + lock_file_logic(windows_semaphore_based_map &) + : retry_with_new_map(false) + {} + + void operator()(void){} + bool retry() const { return retry_with_new_map; } + private: + const bool retry_with_new_map; + }; + + static void construct_map(void *addr) + { + ::new (addr)windows_semaphore_based_map; + } + + struct unlink_map_logic + { + unlink_map_logic(windows_semaphore_based_map &) + {} + void operator()(){} + }; + + static ref_count_ptr *find(windows_semaphore_based_map &map, const char *name) + { + return map.find(name); + } + + static ref_count_ptr * insert(windows_semaphore_based_map &map, const char *name, const ref_count_ptr &ref) + { + return map.insert(name, ref); + } + + static bool erase(windows_semaphore_based_map &map, const char *name) + { + return map.erase(name); + } + + template + static void atomic_func(windows_semaphore_based_map &map, F &f) + { + map.atomic_func(f); + } +}; + +} //namespace intermodule_singleton_helpers { + +template +class windows_intermodule_singleton + : public intermodule_singleton_impl + < C + , LazyInit + , Phoenix + , intermodule_singleton_helpers::windows_semaphore_based_map + > +{}; + +} //namespace ipcdetail{ +} //namespace interprocess{ +} //namespace autoboost{ + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_WINDOWS_INTERMODULE_SINGLETON_HPP diff --git a/contrib/autoboost/autoboost/interprocess/detail/workaround.hpp b/contrib/autoboost/autoboost/interprocess/detail/workaround.hpp new file mode 100644 index 000000000..4296e32f4 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/detail/workaround.hpp @@ -0,0 +1,202 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include + +#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) + #define AUTOBOOST_INTERPROCESS_WINDOWS + #define AUTOBOOST_INTERPROCESS_FORCE_GENERIC_EMULATION + #define AUTOBOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME + //Define this to connect with shared memory created with versions < 1.54 + //#define AUTOBOOST_INTERPROCESS_BOOTSTAMP_IS_LASTBOOTUPTIME +#else + #include + + #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED - 0) > 0) + //Cygwin defines _POSIX_THREAD_PROCESS_SHARED but does not implement it. + #if defined(__CYGWIN__) + #define AUTOBOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED + //Mac Os X < Lion (10.7) might define _POSIX_THREAD_PROCESS_SHARED but there is no real support. + #elif defined(__APPLE__) + #include "TargetConditionals.h" + //Check we're on Mac OS target + #if defined(TARGET_OS_MAC) + #include "AvailabilityMacros.h" + //If minimum target for this compilation is older than Mac Os Lion, then we are out of luck + #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + #define AUTOBOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED + #endif + #endif + #endif + + //If buggy _POSIX_THREAD_PROCESS_SHARED is detected avoid using it + #if defined(AUTOBOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED) + #undef AUTOBOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED + #else + #define AUTOBOOST_INTERPROCESS_POSIX_PROCESS_SHARED + #endif + #endif + + #if defined(_POSIX_BARRIERS) && ((_POSIX_BARRIERS - 0) > 0) + #define AUTOBOOST_INTERPROCESS_POSIX_BARRIERS + #endif + + #if defined(_POSIX_SEMAPHORES) && ((_POSIX_SEMAPHORES - 0) > 0) + #define AUTOBOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES + #if defined(__CYGWIN__) + #define AUTOBOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK + #endif + //Some platforms have a limited (name length) named semaphore support + #elif (defined(__FreeBSD__) && (__FreeBSD__ >= 4)) || defined(__APPLE__) + #define AUTOBOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES + #endif + + #if (defined (_V6_ILP32_OFFBIG) &&(_V6_ILP32_OFFBIG - 0 > 0)) ||\ + (defined (_V6_LP64_OFF64) &&(_V6_LP64_OFF64 - 0 > 0)) ||\ + (defined (_V6_LPBIG_OFFBIG) &&(_V6_LPBIG_OFFBIG - 0 > 0)) ||\ + (defined (_XBS5_ILP32_OFFBIG)&&(_XBS5_ILP32_OFFBIG - 0 > 0)) ||\ + (defined (_XBS5_LP64_OFF64) &&(_XBS5_LP64_OFF64 - 0 > 0)) ||\ + (defined (_XBS5_LPBIG_OFFBIG)&&(_XBS5_LPBIG_OFFBIG - 0 > 0)) ||\ + (defined (_FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64))||\ + (defined (_FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64)) + #define AUTOBOOST_INTERPROCESS_UNIX_64_BIT_OR_BIGGER_OFF_T + #endif + + //Check for XSI shared memory objects. They are available in nearly all UNIX platforms + #if !defined(__QNXNTO__) && !defined(__ANDROID__) + #define AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS + #endif + + #if defined(_POSIX_SHARED_MEMORY_OBJECTS) && ((_POSIX_SHARED_MEMORY_OBJECTS - 0) > 0) + #define AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS + #else + //VMS and MACOS don't define it but they have shm_open/close interface + #if defined(__vms) + #if __CRTL_VER >= 70200000 + #define AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS + #endif + //Mac OS has some non-conformant features like names limited to SHM_NAME_MAX + #elif defined (__APPLE__) + //#define AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS + //#define AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS_NO_GROW + #endif + #endif + + //Now check if we have only XSI shared memory + #if defined(AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) &&\ + !defined(AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS) + //#define AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS_ONLY + #endif + + #if defined(_POSIX_TIMEOUTS) && ((_POSIX_TIMEOUTS - 0) > 0) + #define AUTOBOOST_INTERPROCESS_POSIX_TIMEOUTS + #endif + + #ifdef AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS + //Some systems have filesystem-based resources, so the + //portable "/shmname" format does not work due to permission issues + //For those systems we need to form a path to a temporary directory: + // hp-ux tru64 vms freebsd + #if defined(__hpux) || defined(__osf__) || defined(__vms) || (defined(__FreeBSD__) && (__FreeBSD__ < 7)) + #define AUTOBOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY + //Some systems have "jailed" environments where shm usage is restricted at runtime + //and temporary file file based shm is possible in those executions. + #elif defined(__FreeBSD__) + #define AUTOBOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY + #endif + #endif + + #ifdef AUTOBOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES + #if defined(__osf__) || defined(__vms) + #define AUTOBOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES + #endif + #endif + + #if defined(_POSIX_VERSION) && defined(_XOPEN_VERSION) && \ + (((_POSIX_VERSION + 0)>= 200112L || (_XOPEN_VERSION + 0)>= 500)) + #define AUTOBOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES + #endif + + #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) + #define AUTOBOOST_INTERPROCESS_BSD_DERIVATIVE + //Some *BSD systems (OpenBSD & NetBSD) need sys/param.h before sys/sysctl.h, whereas + //others (FreeBSD & Darwin) need sys/types.h + #include + #include + #include + #if defined(CTL_KERN) && defined (KERN_BOOTTIME) + //#define AUTOBOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME + #endif + #endif +#endif //!defined(AUTOBOOST_INTERPROCESS_WINDOWS) + +#if !defined(AUTOBOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + #define AUTOBOOST_INTERPROCESS_PERFECT_FORWARDING +#endif + +//Now declare some Boost.Interprocess features depending on the implementation +#if defined(AUTOBOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES) && !defined(AUTOBOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK) + #define AUTOBOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES + #define AUTOBOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES +#endif + +// Timeout duration use if AUTOBOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING is set +#ifndef AUTOBOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS + #define AUTOBOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS 10000 +#endif + +//Other switches +//AUTOBOOST_INTERPROCESS_MSG_QUEUE_USES_CIRC_INDEX +//message queue uses a circular queue as index instead of an array (better performance) +//Boost version < 1.52 uses an array, so undef this if you want to communicate +//with processes compiled with those versions. +#define AUTOBOOST_INTERPROCESS_MSG_QUEUE_CIRCULAR_INDEX + +//Inline attributes +#if defined(_MSC_VER) + #define AUTOBOOST_INTERPROCESS_ALWAYS_INLINE __forceinline +#elif defined (__GNUC__) + #define AUTOBOOST_INTERPROCESS_ALWAYS_INLINE __attribute__((__always_inline__)) +#else + #define AUTOBOOST_INTERPROCESS_ALWAYS_INLINE inline +#endif + +#if defined(_MSC_VER) + #define AUTOBOOST_INTERPROCESS_NEVER_INLINE __declspec(noinline) +#elif defined (__GNUC__) + #define AUTOBOOST_INTERPROCESS_NEVER_INLINE __attribute__((__noinline__)) +#endif + +//Macros for documentation purposes. For code, expands to the argument +#define AUTOBOOST_INTERPROCESS_IMPDEF(TYPE) TYPE +#define AUTOBOOST_INTERPROCESS_SEEDOC(TYPE) TYPE + +#if defined(AUTOBOOST_NO_CXX11_NOEXCEPT) + #if defined(AUTOBOOST_MSVC) + #define AUTOBOOST_INTERPROCESS_NOEXCEPT throw() + #else + #define AUTOBOOST_INTERPROCESS_NOEXCEPT + #endif + #define AUTOBOOST_INTERPROCESS_NOEXCEPT_IF(x) +#else + #define AUTOBOOST_INTERPROCESS_NOEXCEPT noexcept + #define AUTOBOOST_INTERPROCESS_NOEXCEPT_IF(x) noexcept(x) +#endif + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP diff --git a/contrib/autoboost/autoboost/interprocess/errors.hpp b/contrib/autoboost/autoboost/interprocess/errors.hpp new file mode 100644 index 000000000..9b5f971b7 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/errors.hpp @@ -0,0 +1,237 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +// Parts of this code are taken from autoboost::filesystem library +// +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2002 Beman Dawes +// Copyright (C) 2001 Dietmar Kuehl +// Use, modification, and distribution is subject to 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 library home page at http://www.boost.org/libs/filesystem +// +////////////////////////////////////////////////////////////////////////////// + + +#ifndef AUTOBOOST_INTERPROCESS_ERRORS_HPP +#define AUTOBOOST_INTERPROCESS_ERRORS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) +# include +#else +# ifdef AUTOBOOST_HAS_UNISTD_H +# include //Errors +# include //strerror +# else //ifdef AUTOBOOST_HAS_UNISTD_H +# error Unknown platform +# endif //ifdef AUTOBOOST_HAS_UNISTD_H +#endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +//!\file +//!Describes the error numbering of interprocess classes + +namespace autoboost { +namespace interprocess { +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) +inline int system_error_code() // artifact of POSIX and WINDOWS error reporting +{ + #if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + return winapi::get_last_error(); + #else + return errno; // GCC 3.1 won't accept ::errno + #endif +} + + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) +inline void fill_system_message(int sys_err_code, std::string &str) +{ + void *lpMsgBuf; + winapi::format_message( + winapi::format_message_allocate_buffer | + winapi::format_message_from_system | + winapi::format_message_ignore_inserts, + 0, + sys_err_code, + winapi::make_lang_id(winapi::lang_neutral, winapi::sublang_default), // Default language + reinterpret_cast(&lpMsgBuf), + 0, + 0 + ); + str += static_cast(lpMsgBuf); + winapi::local_free( lpMsgBuf ); // free the buffer + while ( str.size() + && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') ) + str.erase( str.size()-1 ); +} +# else +inline void fill_system_message( int system_error, std::string &str) +{ str = std::strerror(system_error); } +# endif +#endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + +enum error_code_t +{ + no_error = 0, + system_error, // system generated error; if possible, is translated + // to one of the more specific errors below. + other_error, // library generated error + security_error, // includes access rights, permissions failures + read_only_error, + io_error, + path_error, + not_found_error, +// not_directory_error, + busy_error, // implies trying again might succeed + already_exists_error, + not_empty_error, + is_directory_error, + out_of_space_error, + out_of_memory_error, + out_of_resource_error, + lock_error, + sem_error, + mode_error, + size_error, + corrupted_error, + not_such_file_or_directory, + invalid_argument, + timeout_when_locking_error, + timeout_when_waiting_error, + owner_dead_error +}; + +typedef int native_error_t; + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) +struct ec_xlate +{ + native_error_t sys_ec; + error_code_t ec; +}; + +static const ec_xlate ec_table[] = +{ + #if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + { /*ERROR_ACCESS_DENIED*/5L, security_error }, + { /*ERROR_INVALID_ACCESS*/12L, security_error }, + { /*ERROR_SHARING_VIOLATION*/32L, security_error }, + { /*ERROR_LOCK_VIOLATION*/33L, security_error }, + { /*ERROR_LOCKED*/212L, security_error }, + { /*ERROR_NOACCESS*/998L, security_error }, + { /*ERROR_WRITE_PROTECT*/19L, read_only_error }, + { /*ERROR_NOT_READY*/21L, io_error }, + { /*ERROR_SEEK*/25L, io_error }, + { /*ERROR_READ_FAULT*/30L, io_error }, + { /*ERROR_WRITE_FAULT*/29L, io_error }, + { /*ERROR_CANTOPEN*/1011L, io_error }, + { /*ERROR_CANTREAD*/1012L, io_error }, + { /*ERROR_CANTWRITE*/1013L, io_error }, + { /*ERROR_DIRECTORY*/267L, path_error }, + { /*ERROR_INVALID_NAME*/123L, path_error }, + { /*ERROR_FILE_NOT_FOUND*/2L, not_found_error }, + { /*ERROR_PATH_NOT_FOUND*/3L, not_found_error }, + { /*ERROR_DEV_NOT_EXIST*/55L, not_found_error }, + { /*ERROR_DEVICE_IN_USE*/2404L, busy_error }, + { /*ERROR_OPEN_FILES*/2401L, busy_error }, + { /*ERROR_BUSY_DRIVE*/142L, busy_error }, + { /*ERROR_BUSY*/170L, busy_error }, + { /*ERROR_FILE_EXISTS*/80L, already_exists_error }, + { /*ERROR_ALREADY_EXISTS*/183L, already_exists_error }, + { /*ERROR_DIR_NOT_EMPTY*/145L, not_empty_error }, + { /*ERROR_HANDLE_DISK_FULL*/39L, out_of_space_error }, + { /*ERROR_DISK_FULL*/112L, out_of_space_error }, + { /*ERROR_OUTOFMEMORY*/14L, out_of_memory_error }, + { /*ERROR_NOT_ENOUGH_MEMORY*/8L, out_of_memory_error }, + { /*ERROR_TOO_MANY_OPEN_FILES*/4L, out_of_resource_error }, + { /*ERROR_INVALID_ADDRESS*/487L, busy_error } + #else //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + { EACCES, security_error }, + { EROFS, read_only_error }, + { EIO, io_error }, + { ENAMETOOLONG, path_error }, + { ENOENT, not_found_error }, + // { ENOTDIR, not_directory_error }, + { EAGAIN, busy_error }, + { EBUSY, busy_error }, + { ETXTBSY, busy_error }, + { EEXIST, already_exists_error }, + { ENOTEMPTY, not_empty_error }, + { EISDIR, is_directory_error }, + { ENOSPC, out_of_space_error }, + { ENOMEM, out_of_memory_error }, + { EMFILE, out_of_resource_error }, + { ENOENT, not_such_file_or_directory }, + { EINVAL, invalid_argument } + #endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) +}; + +inline error_code_t lookup_error(native_error_t err) +{ + const ec_xlate *cur = &ec_table[0], + *end = cur + sizeof(ec_table)/sizeof(ec_xlate); + for (;cur != end; ++cur ){ + if ( err == cur->sys_ec ) return cur->ec; + } + return system_error; // general system error code +} + +struct error_info +{ + error_info(error_code_t ec = other_error ) + : m_nat(0), m_ec(ec) + {} + + error_info(native_error_t sys_err_code) + : m_nat(sys_err_code), m_ec(lookup_error(sys_err_code)) + {} + + error_info & operator =(error_code_t ec) + { + m_nat = 0; + m_ec = ec; + return *this; + } + + error_info & operator =(native_error_t sys_err_code) + { + m_nat = sys_err_code; + m_ec = lookup_error(sys_err_code); + return *this; + } + + native_error_t get_native_error()const + { return m_nat; } + + error_code_t get_error_code()const + { return m_ec; } + + private: + native_error_t m_nat; + error_code_t m_ec; +}; +#endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + +} // namespace interprocess { +} // namespace autoboost + +#include + +#endif // AUTOBOOST_INTERPROCESS_ERRORS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/exceptions.hpp b/contrib/autoboost/autoboost/interprocess/exceptions.hpp new file mode 100644 index 000000000..155f3b02d --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/exceptions.hpp @@ -0,0 +1,150 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_EXCEPTIONS_HPP +#define AUTOBOOST_INTERPROCESS_EXCEPTIONS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include + +//!\file +//!Describes exceptions thrown by interprocess classes + +namespace autoboost { + +namespace interprocess { + +//!This class is the base class of all exceptions +//!thrown by autoboost::interprocess +class interprocess_exception : public std::exception +{ + public: + interprocess_exception(const char *err/*error_code_t ec = other_error*/) + : m_err(other_error) + { +// try { m_str = "autoboost::interprocess_exception::library_error"; } + try { m_str = err; } + catch (...) {} + } +/* + interprocess_exception(native_error_t sys_err_code) + : m_err(sys_err_code) + { + try { fill_system_message(m_err.get_native_error(), m_str); } + catch (...) {} + }*/ + + interprocess_exception(const error_info &err_info, const char *str = 0) + : m_err(err_info) + { + try{ + if(m_err.get_native_error() != 0){ + fill_system_message(m_err.get_native_error(), m_str); + } + else if(str){ + m_str = str; + } + else{ + m_str = "autoboost::interprocess_exception::library_error"; + } + } + catch(...){} + } + + virtual ~interprocess_exception() throw(){} + + virtual const char * what() const throw() + { return m_str.c_str(); } + + native_error_t get_native_error()const { return m_err.get_native_error(); } + + // Note: a value of other_error implies a library (rather than system) error + error_code_t get_error_code() const { return m_err.get_error_code(); } + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + error_info m_err; + std::string m_str; + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED +}; + +//!This is the exception thrown by shared interprocess_mutex family when a deadlock situation +//!is detected or when using a interprocess_condition the interprocess_mutex is not locked +class lock_exception : public interprocess_exception +{ + public: + lock_exception() + : interprocess_exception(lock_error) + {} + + virtual const char* what() const throw() + { return "autoboost::interprocess::lock_exception"; } +}; + +//!This is the exception thrown by named interprocess_semaphore when a deadlock situation +//!is detected or when an error is detected in the post/wait operation +/* +class sem_exception : public interprocess_exception +{ + public: + sem_exception() + : interprocess_exception(lock_error) + {} + + virtual const char* what() const throw() + { return "autoboost::interprocess::sem_exception"; } +}; +*/ +//!This is the exception thrown by synchronization objects when there is +//!an error in a wait() function +/* +class wait_exception : public interprocess_exception +{ + public: + virtual const char* what() const throw() + { return "autoboost::interprocess::wait_exception"; } +}; +*/ + +//!This exception is thrown when a named object is created +//!in "open_only" mode and the resource was not already created +/* +class not_previously_created : public interprocess_exception +{ + public: + virtual const char* what() const throw() + { return "autoboost::interprocess::not_previously_created"; } +}; +*/ + +//!This exception is thrown when a memory request can't be +//!fulfilled. +class bad_alloc : public interprocess_exception +{ + public: + bad_alloc() : interprocess_exception("::autoboost::interprocess::bad_alloc"){} + virtual const char* what() const throw() + { return "autoboost::interprocess::bad_alloc"; } +}; + +} // namespace interprocess { + +} // namespace autoboost + +#include + +#endif // AUTOBOOST_INTERPROCESS_EXCEPTIONS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/interprocess_fwd.hpp b/contrib/autoboost/autoboost/interprocess/interprocess_fwd.hpp new file mode 100644 index 000000000..5cb546483 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/interprocess_fwd.hpp @@ -0,0 +1,513 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_FWD_HPP +#define AUTOBOOST_INTERPROCESS_FWD_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +//! \file +//! This header file forward declares the basic interprocess types: +//! - autoboost::interprocess::offset_ptr; +//! - autoboost::interprocess::permissions; +//! - autoboost::interprocess::mapped_region; +//! - autoboost::interprocess::file_mapping; +//! - autoboost::interprocess::shared_memory_object; +//! - autoboost::interprocess::windows_shared_memory; +//! - autoboost::interprocess::xsi_shared_memory; +//! +//! The following synchronization mechanisms and locks: +//! - autoboost::interprocess::null_mutex; +//! - autoboost::interprocess::interprocess_mutex; +//! - autoboost::interprocess::interprocess_recursive_mutex; +//! - autoboost::interprocess::interprocess_semaphore; +//! - autoboost::interprocess::named_mutex; +//! - autoboost::interprocess::named_recursive_mutex; +//! - autoboost::interprocess::named_semaphore; +//! - autoboost::interprocess::interprocess_sharable_mutex; +//! - autoboost::interprocess::interprocess_condition; +//! - autoboost::interprocess::scoped_lock; +//! - autoboost::interprocess::sharable_lock; +//! - autoboost::interprocess::upgradable_lock; +//! +//! The following mutex families: +//! - autoboost::interprocess::mutex_family; +//! - autoboost::interprocess::null_mutex_family; +//! +//! The following allocators: +//! - autoboost::interprocess::allocator; +//! - autoboost::interprocess::node_allocator; +//! - autoboost::interprocess::private_node_allocator; +//! - autoboost::interprocess::cached_node_allocator; +//! - autoboost::interprocess::adaptive_pool; +//! - autoboost::interprocess::private_adaptive_pool; +//! - autoboost::interprocess::cached_adaptive_pool; +//! +//! The following allocation algorithms: +//! - autoboost::interprocess::simple_seq_fit; +//! - autoboost::interprocess::rbtree_best_fit; +//! +//! The following index types: +//! - autoboost::interprocess::flat_map_index; +//! - autoboost::interprocess::iset_index; +//! - autoboost::interprocess::iunordered_set_index; +//! - autoboost::interprocess::map_index; +//! - autoboost::interprocess::null_index; +//! - autoboost::interprocess::unordered_map_index; +//! +//! The following managed memory types: +//! - autoboost::interprocess::segment_manager; +//! - autoboost::interprocess::basic_managed_external_buffer +//! - autoboost::interprocess::managed_external_buffer +//! - autoboost::interprocess::wmanaged_external_buffer +//! - autoboost::interprocess::basic_managed_shared_memory +//! - autoboost::interprocess::managed_shared_memory +//! - autoboost::interprocess::wmanaged_shared_memory +//! - autoboost::interprocess::basic_managed_windows_shared_memory +//! - autoboost::interprocess::managed_windows_shared_memory +//! - autoboost::interprocess::wmanaged_windows_shared_memory +//! - autoboost::interprocess::basic_managed_xsi_shared_memory +//! - autoboost::interprocess::managed_xsi_shared_memory +//! - autoboost::interprocess::wmanaged_xsi_shared_memory +//! - autoboost::interprocess::fixed_managed_shared_memory +//! - autoboost::interprocess::wfixed_managed_shared_memory +//! - autoboost::interprocess::basic_managed_heap_memory +//! - autoboost::interprocess::managed_heap_memory +//! - autoboost::interprocess::wmanaged_heap_memory +//! - autoboost::interprocess::basic_managed_mapped_file +//! - autoboost::interprocess::managed_mapped_file +//! - autoboost::interprocess::wmanaged_mapped_file +//! +//! The following exception types: +//! - autoboost::interprocess::interprocess_exception +//! - autoboost::interprocess::lock_exception +//! - autoboost::interprocess::bad_alloc +//! +//! The following stream types: +//! - autoboost::interprocess::basic_bufferbuf +//! - autoboost::interprocess::basic_ibufferstream +//! - autoboost::interprocess::basic_obufferstream +//! - autoboost::interprocess::basic_bufferstream +//! - autoboost::interprocess::basic_vectorbuf +//! - autoboost::interprocess::basic_ivectorstream +//! - autoboost::interprocess::basic_ovectorstream +//! - autoboost::interprocess::basic_vectorstream +//! +//! The following smart pointer types: +//! - autoboost::interprocess::scoped_ptr +//! - autoboost::interprocess::intrusive_ptr +//! - autoboost::interprocess::shared_ptr +//! - autoboost::interprocess::weak_ptr +//! +//! The following interprocess communication types: +//! - autoboost::interprocess::message_queue_t; +//! - autoboost::interprocess::message_queue; + +#include +#include + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +#include + +////////////////////////////////////////////////////////////////////////////// +// Standard predeclarations +////////////////////////////////////////////////////////////////////////////// + +namespace autoboost{ +namespace intrusive{ +}} + +namespace autoboost{ +namespace interprocess{ +namespace bi = autoboost::intrusive; +}} + +#include +#include +#include +#include +#include + +namespace autoboost { namespace interprocess { + +////////////////////////////////////////////////////////////////////////////// +// permissions +////////////////////////////////////////////////////////////////////////////// + +class permissions; + +////////////////////////////////////////////////////////////////////////////// +// shared_memory +////////////////////////////////////////////////////////////////////////////// + +class shared_memory_object; + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) +class windows_shared_memory; +#endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +#if defined(AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) +class xsi_shared_memory; +#endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +////////////////////////////////////////////////////////////////////////////// +// file mapping / mapped region +////////////////////////////////////////////////////////////////////////////// + +class file_mapping; +class mapped_region; + +////////////////////////////////////////////////////////////////////////////// +// Mutexes +////////////////////////////////////////////////////////////////////////////// + +class null_mutex; + +class interprocess_mutex; +class interprocess_recursive_mutex; + +class named_mutex; +class named_recursive_mutex; + +class interprocess_semaphore; +class named_semaphore; + +////////////////////////////////////////////////////////////////////////////// +// Mutex families +////////////////////////////////////////////////////////////////////////////// + +struct mutex_family; +struct null_mutex_family; + +////////////////////////////////////////////////////////////////////////////// +// Other synchronization classes +////////////////////////////////////////////////////////////////////////////// + +class interprocess_sharable_mutex; +class interprocess_condition; + +////////////////////////////////////////////////////////////////////////////// +// Locks +////////////////////////////////////////////////////////////////////////////// + +template +class scoped_lock; + +template +class sharable_lock; + +template +class upgradable_lock; + +////////////////////////////////////////////////////////////////////////////// +// STL compatible allocators +////////////////////////////////////////////////////////////////////////////// + +template +class allocator; + +template +class node_allocator; + +template +class private_node_allocator; + +template +class cached_node_allocator; + +template +class adaptive_pool; + +template +class private_adaptive_pool; + +template +class cached_adaptive_pool; + + +////////////////////////////////////////////////////////////////////////////// +// offset_ptr +////////////////////////////////////////////////////////////////////////////// + +static const std::size_t offset_type_alignment = 0; + +template +class offset_ptr; + +////////////////////////////////////////////////////////////////////////////// +// Memory allocation algorithms +////////////////////////////////////////////////////////////////////////////// + +//Single segment memory allocation algorithms +template > +class simple_seq_fit; + +template, std::size_t MemAlignment = 0> +class rbtree_best_fit; + +////////////////////////////////////////////////////////////////////////////// +// Index Types +////////////////////////////////////////////////////////////////////////////// + +template class flat_map_index; +template class iset_index; +template class iunordered_set_index; +template class map_index; +template class null_index; +template class unordered_map_index; + +////////////////////////////////////////////////////////////////////////////// +// Segment manager +////////////////////////////////////////////////////////////////////////////// + +template class IndexType> +class segment_manager; + +////////////////////////////////////////////////////////////////////////////// +// External buffer managed memory classes +////////////////////////////////////////////////////////////////////////////// + +template class IndexType> +class basic_managed_external_buffer; + +typedef basic_managed_external_buffer + + ,iset_index> +managed_external_buffer; + +typedef basic_managed_external_buffer + + ,iset_index> +wmanaged_external_buffer; + +////////////////////////////////////////////////////////////////////////////// +// managed memory classes +////////////////////////////////////////////////////////////////////////////// + +template class IndexType> +class basic_managed_shared_memory; + +typedef basic_managed_shared_memory + + ,iset_index> +managed_shared_memory; + +typedef basic_managed_shared_memory + + ,iset_index> +wmanaged_shared_memory; + + +////////////////////////////////////////////////////////////////////////////// +// Windows shared memory managed memory classes +////////////////////////////////////////////////////////////////////////////// + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +template class IndexType> +class basic_managed_windows_shared_memory; + +typedef basic_managed_windows_shared_memory + + ,iset_index> +managed_windows_shared_memory; + +typedef basic_managed_windows_shared_memory + + ,iset_index> +wmanaged_windows_shared_memory; + +#endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +#if defined(AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) + +template class IndexType> +class basic_managed_xsi_shared_memory; + +typedef basic_managed_xsi_shared_memory + + ,iset_index> +managed_xsi_shared_memory; + +typedef basic_managed_xsi_shared_memory + + ,iset_index> +wmanaged_xsi_shared_memory; + +#endif //#if defined(AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) + +////////////////////////////////////////////////////////////////////////////// +// Fixed address shared memory +////////////////////////////////////////////////////////////////////////////// + +typedef basic_managed_shared_memory + + ,iset_index> +fixed_managed_shared_memory; + +typedef basic_managed_shared_memory + + ,iset_index> +wfixed_managed_shared_memory; + +////////////////////////////////////////////////////////////////////////////// +// Heap memory managed memory classes +////////////////////////////////////////////////////////////////////////////// + +template + class IndexType> +class basic_managed_heap_memory; + +typedef basic_managed_heap_memory + + ,iset_index> +managed_heap_memory; + +typedef basic_managed_heap_memory + + ,iset_index> +wmanaged_heap_memory; + +////////////////////////////////////////////////////////////////////////////// +// Mapped file managed memory classes +////////////////////////////////////////////////////////////////////////////// + +template + class IndexType> +class basic_managed_mapped_file; + +typedef basic_managed_mapped_file + + ,iset_index> +managed_mapped_file; + +typedef basic_managed_mapped_file + + ,iset_index> +wmanaged_mapped_file; + +////////////////////////////////////////////////////////////////////////////// +// Exceptions +////////////////////////////////////////////////////////////////////////////// + +class interprocess_exception; +class lock_exception; +class bad_alloc; + +////////////////////////////////////////////////////////////////////////////// +// Bufferstream +////////////////////////////////////////////////////////////////////////////// + +//bufferstream +template > +class basic_bufferbuf; + +template > +class basic_ibufferstream; + +template > +class basic_obufferstream; + +template > +class basic_bufferstream; + +////////////////////////////////////////////////////////////////////////////// +// Vectorstream +////////////////////////////////////////////////////////////////////////////// + +template > +class basic_vectorbuf; + +template > +class basic_ivectorstream; + +template > +class basic_ovectorstream; + +template > +class basic_vectorstream; + +////////////////////////////////////////////////////////////////////////////// +// Smart pointers +////////////////////////////////////////////////////////////////////////////// + +template +class scoped_ptr; + +template +class intrusive_ptr; + +template +class shared_ptr; + +template +class weak_ptr; + +////////////////////////////////////////////////////////////////////////////// +// IPC +////////////////////////////////////////////////////////////////////////////// + +template +class message_queue_t; + +typedef message_queue_t > message_queue; + +}} //namespace autoboost { namespace interprocess { + +#endif //#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +#include + +#endif //#ifndef AUTOBOOST_INTERPROCESS_FWD_HPP diff --git a/contrib/autoboost/autoboost/interprocess/mapped_region.hpp b/contrib/autoboost/autoboost/interprocess/mapped_region.hpp new file mode 100644 index 000000000..85bffdd08 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/mapped_region.hpp @@ -0,0 +1,914 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_MAPPED_REGION_HPP +#define AUTOBOOST_INTERPROCESS_MAPPED_REGION_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +//Some Unixes use caddr_t instead of void * in madvise +// SunOS Tru64 HP-UX AIX +#if defined(sun) || defined(__sun) || defined(__osf__) || defined(__osf) || defined(_hpux) || defined(hpux) || defined(_AIX) +#define AUTOBOOST_INTERPROCESS_MADVISE_USES_CADDR_T +#include +#endif + +//A lot of UNIXes have destructive semantics for MADV_DONTNEED, so +//we need to be careful to allow it. +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) +#define AUTOBOOST_INTERPROCESS_MADV_DONTNEED_HAS_NONDESTRUCTIVE_SEMANTICS +#endif + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) +# include +# include +#else +# ifdef AUTOBOOST_HAS_UNISTD_H +# include +# include //mmap +# include +# include +# include +# if defined(AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) +# include //System V shared memory... +# endif +# include +# else +# error Unknown platform +# endif + +#endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +//!\file +//!Describes mapped region class + +namespace autoboost { +namespace interprocess { + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +//Solaris declares madvise only in some configurations but defines MADV_XXX, a bit confusing. +//Predeclare it here to avoid any compilation error +#if (defined(sun) || defined(__sun)) && defined(MADV_NORMAL) +extern "C" int madvise(caddr_t, size_t, int); +#endif + +namespace ipcdetail{ class interprocess_tester; } +namespace ipcdetail{ class raw_mapped_region_creator; } + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + +//!The mapped_region class represents a portion or region created from a +//!memory_mappable object. +//! +//!The OS can map a region bigger than the requested one, as region must +//!be multiple of the page size, but mapped_region will always refer to +//!the region specified by the user. +class mapped_region +{ + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + //Non-copyable + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(mapped_region) + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + public: + + //!Creates a mapping region of the mapped memory "mapping", starting in + //!offset "offset", and the mapping's size will be "size". The mapping + //!can be opened for read only, read-write or copy-on-write. + //! + //!If an address is specified, both the offset and the address must be + //!multiples of the page size. + //! + //!The map is created using "default_map_options". This flag is OS + //!dependant and it should not be changed unless the user needs to + //!specify special options. + //! + //!In Windows systems "map_options" is a DWORD value passed as + //!"dwDesiredAccess" to "MapViewOfFileEx". If "default_map_options" is passed + //!it's initialized to zero. "map_options" is XORed with FILE_MAP_[COPY|READ|WRITE]. + //! + //!In UNIX systems and POSIX mappings "map_options" is an int value passed as "flags" + //!to "mmap". If "default_map_options" is specified it's initialized to MAP_NOSYNC + //!if that option exists and to zero otherwise. "map_options" XORed with MAP_PRIVATE or MAP_SHARED. + //! + //!In UNIX systems and XSI mappings "map_options" is an int value passed as "shmflg" + //!to "shmat". If "default_map_options" is specified it's initialized to zero. + //!"map_options" is XORed with SHM_RDONLY if needed. + //! + //!The OS could allocate more pages than size/page_size(), but get_address() + //!will always return the address passed in this function (if not null) and + //!get_size() will return the specified size. + template + mapped_region(const MemoryMappable& mapping + ,mode_t mode + ,offset_t offset = 0 + ,std::size_t size = 0 + ,const void *address = 0 + ,map_options_t map_options = default_map_options); + + //!Default constructor. Address will be 0 (nullptr). + //!Size will be 0. + //!Does not throw + mapped_region(); + + //!Move constructor. *this will be constructed taking ownership of "other"'s + //!region and "other" will be left in default constructor state. + mapped_region(AUTOBOOST_RV_REF(mapped_region) other) + #if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + : m_base(0), m_size(0) + , m_page_offset(0) + , m_mode(read_only) + , m_file_or_mapping_hnd(ipcdetail::invalid_file()) + #else + : m_base(0), m_size(0), m_page_offset(0), m_mode(read_only), m_is_xsi(false) + #endif + { this->swap(other); } + + //!Destroys the mapped region. + //!Does not throw + ~mapped_region(); + + //!Move assignment. If *this owns a memory mapped region, it will be + //!destroyed and it will take ownership of "other"'s memory mapped region. + mapped_region &operator=(AUTOBOOST_RV_REF(mapped_region) other) + { + mapped_region tmp(autoboost::move(other)); + this->swap(tmp); + return *this; + } + + //!Swaps the mapped_region with another + //!mapped region + void swap(mapped_region &other); + + //!Returns the size of the mapping. Never throws. + std::size_t get_size() const; + + //!Returns the base address of the mapping. + //!Never throws. + void* get_address() const; + + //!Returns the mode of the mapping used to construct the mapped region. + //!Never throws. + mode_t get_mode() const; + + //!Flushes to the disk a byte range within the mapped memory. + //!If 'async' is true, the function will return before flushing operation is completed + //!If 'async' is false, function will return once data has been written into the underlying + //!device (i.e., in mapped files OS cached information is written to disk). + //!Never throws. Returns false if operation could not be performed. + bool flush(std::size_t mapping_offset = 0, std::size_t numbytes = 0, bool async = true); + + //!Shrinks current mapped region. If after shrinking there is no longer need for a previously + //!mapped memory page, accessing that page can trigger a segmentation fault. + //!Depending on the OS, this operation might fail (XSI shared memory), it can decommit storage + //!and free a portion of the virtual address space (e.g.POSIX) or this + //!function can release some physical memory wihout freeing any virtual address space(Windows). + //!Returns true on success. Never throws. + bool shrink_by(std::size_t bytes, bool from_back = true); + + //!This enum specifies region usage behaviors that an application can specify + //!to the mapped region implementation. + enum advice_types{ + //!Specifies that the application has no advice to give on its behavior with respect to + //!the region. It is the default characteristic if no advice is given for a range of memory. + advice_normal, + //!Specifies that the application expects to access the region sequentially from + //!lower addresses to higher addresses. The implementation can lower the priority of + //!preceding pages within the region once a page have been accessed. + advice_sequential, + //!Specifies that the application expects to access the region in a random order, + //!and prefetching is likely not advantageous. + advice_random, + //!Specifies that the application expects to access the region in the near future. + //!The implementation can prefetch pages of the region. + advice_willneed, + //!Specifies that the application expects that it will not access the region in the near future. + //!The implementation can unload pages within the range to save system resources. + advice_dontneed + }; + + //!Advises the implementation on the expected behavior of the application with respect to the data + //!in the region. The implementation may use this information to optimize handling of the region data. + //!This function has no effect on the semantics of access to memory in the region, although it may affect + //!the performance of access. + //!If the advise type is not known to the implementation, the function returns false. True otherwise. + bool advise(advice_types advise); + + //!Returns the size of the page. This size is the minimum memory that + //!will be used by the system when mapping a memory mappable source and + //!will restrict the address and the offset to map. + static std::size_t get_page_size(); + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + //!Closes a previously opened memory mapping. Never throws + void priv_close(); + + void* priv_map_address() const; + std::size_t priv_map_size() const; + bool priv_flush_param_check(std::size_t mapping_offset, void *&addr, std::size_t &numbytes) const; + bool priv_shrink_param_check(std::size_t bytes, bool from_back, void *&shrink_page_start, std::size_t &shrink_page_bytes); + static void priv_size_from_mapping_size + (offset_t mapping_size, offset_t offset, offset_t page_offset, std::size_t &size); + static offset_t priv_page_offset_addr_fixup(offset_t page_offset, const void *&addr); + + template + struct page_size_holder + { + static const std::size_t PageSize; + static std::size_t get_page_size(); + }; + + void* m_base; + std::size_t m_size; + std::size_t m_page_offset; + mode_t m_mode; + #if defined(AUTOBOOST_INTERPROCESS_WINDOWS) + file_handle_t m_file_or_mapping_hnd; + #else + bool m_is_xsi; + #endif + + friend class ipcdetail::interprocess_tester; + friend class ipcdetail::raw_mapped_region_creator; + void dont_close_on_destruction(); + #if defined(AUTOBOOST_INTERPROCESS_WINDOWS) && !defined(AUTOBOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) + template + static void destroy_syncs_in_range(const void *addr, std::size_t size); + #endif + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED +}; + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +inline void swap(mapped_region &x, mapped_region &y) +{ x.swap(y); } + +inline mapped_region::~mapped_region() +{ this->priv_close(); } + +inline std::size_t mapped_region::get_size() const +{ return m_size; } + +inline mode_t mapped_region::get_mode() const +{ return m_mode; } + +inline void* mapped_region::get_address() const +{ return m_base; } + +inline void* mapped_region::priv_map_address() const +{ return static_cast(m_base) - m_page_offset; } + +inline std::size_t mapped_region::priv_map_size() const +{ return m_size + m_page_offset; } + +inline bool mapped_region::priv_flush_param_check + (std::size_t mapping_offset, void *&addr, std::size_t &numbytes) const +{ + //Check some errors + if(m_base == 0) + return false; + + if(mapping_offset >= m_size || (mapping_offset + numbytes) > m_size){ + return false; + } + + //Update flush size if the user does not provide it + if(numbytes == 0){ + numbytes = m_size - mapping_offset; + } + addr = (char*)this->priv_map_address() + mapping_offset; + numbytes += m_page_offset; + return true; +} + +inline bool mapped_region::priv_shrink_param_check + (std::size_t bytes, bool from_back, void *&shrink_page_start, std::size_t &shrink_page_bytes) +{ + //Check some errors + if(m_base == 0 || bytes > m_size){ + return false; + } + else if(bytes == m_size){ + this->priv_close(); + return true; + } + else{ + const std::size_t page_size = mapped_region::get_page_size(); + if(from_back){ + const std::size_t new_pages = (m_size + m_page_offset - bytes - 1)/page_size + 1; + shrink_page_start = static_cast(this->priv_map_address()) + new_pages*page_size; + shrink_page_bytes = m_page_offset + m_size - new_pages*page_size; + m_size -= bytes; + } + else{ + shrink_page_start = this->priv_map_address(); + m_page_offset += bytes; + shrink_page_bytes = (m_page_offset/page_size)*page_size; + m_page_offset = m_page_offset % page_size; + m_size -= bytes; + m_base = static_cast(m_base) + bytes; + AUTOBOOST_ASSERT(shrink_page_bytes%page_size == 0); + } + return true; + } +} + +inline void mapped_region::priv_size_from_mapping_size + (offset_t mapping_size, offset_t offset, offset_t page_offset, std::size_t &size) +{ + //Check if mapping size fits in the user address space + //as offset_t is the maximum file size and its signed. + if(mapping_size < offset || + autoboost::uintmax_t(mapping_size - (offset - page_offset)) > + autoboost::uintmax_t(std::size_t(-1))){ + error_info err(size_error); + throw interprocess_exception(err); + } + size = static_cast(mapping_size - (offset - page_offset)); +} + +inline offset_t mapped_region::priv_page_offset_addr_fixup(offset_t offset, const void *&address) +{ + //We can't map any offset so we have to obtain system's + //memory granularity + const std::size_t page_size = mapped_region::get_page_size(); + + //We calculate the difference between demanded and valid offset + //(always less than a page in std::size_t, thus, representable by std::size_t) + const std::size_t page_offset = + static_cast(offset - (offset / page_size) * page_size); + //Update the mapping address + if(address){ + address = static_cast(address) - page_offset; + } + return page_offset; +} + +#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +inline mapped_region::mapped_region() + : m_base(0), m_size(0), m_page_offset(0), m_mode(read_only) + , m_file_or_mapping_hnd(ipcdetail::invalid_file()) +{} + +template +inline std::size_t mapped_region::page_size_holder::get_page_size() +{ + winapi::system_info info; + winapi::get_system_info(&info); + return std::size_t(info.dwAllocationGranularity); +} + +template +inline mapped_region::mapped_region + (const MemoryMappable &mapping + ,mode_t mode + ,offset_t offset + ,std::size_t size + ,const void *address + ,map_options_t map_options) + : m_base(0), m_size(0), m_page_offset(0), m_mode(mode) + , m_file_or_mapping_hnd(ipcdetail::invalid_file()) +{ + mapping_handle_t mhandle = mapping.get_mapping_handle(); + { + file_handle_t native_mapping_handle = 0; + + //Set accesses + //For "create_file_mapping" + unsigned long protection = 0; + //For "mapviewoffile" + unsigned long map_access = map_options == default_map_options ? 0 : map_options; + + switch(mode) + { + case read_only: + case read_private: + protection |= winapi::page_readonly; + map_access |= winapi::file_map_read; + break; + case read_write: + protection |= winapi::page_readwrite; + map_access |= winapi::file_map_write; + break; + case copy_on_write: + protection |= winapi::page_writecopy; + map_access |= winapi::file_map_copy; + break; + default: + { + error_info err(mode_error); + throw interprocess_exception(err); + } + break; + } + + //For file mapping (including emulated shared memory through temporary files), + //the device is a file handle so we need to obtain file's size and call create_file_mapping + //to obtain the mapping handle. + //For files we don't need the file mapping after mapping the memory, as the file is there + //so we'll program the handle close + void * handle_to_close = winapi::invalid_handle_value; + if(!mhandle.is_shm){ + //Create mapping handle + native_mapping_handle = winapi::create_file_mapping + ( ipcdetail::file_handle_from_mapping_handle(mapping.get_mapping_handle()) + , protection, 0, 0, 0); + + //Check if all is correct + if(!native_mapping_handle){ + error_info err = winapi::get_last_error(); + throw interprocess_exception(err); + } + handle_to_close = native_mapping_handle; + } + else{ + //For windows_shared_memory the device handle is already a mapping handle + //and we need to maintain it + native_mapping_handle = mhandle.handle; + } + //RAII handle close on scope exit + const winapi::handle_closer close_handle(handle_to_close); + (void)close_handle; + + const offset_t page_offset = priv_page_offset_addr_fixup(offset, address); + + //Obtain mapping size if user provides 0 size + if(size == 0){ + offset_t mapping_size; + if(!winapi::get_file_mapping_size(native_mapping_handle, mapping_size)){ + error_info err = winapi::get_last_error(); + throw interprocess_exception(err); + } + //This can throw + priv_size_from_mapping_size(mapping_size, offset, page_offset, size); + } + + //Map with new offsets and size + void *base = winapi::map_view_of_file_ex + (native_mapping_handle, + map_access, + offset - page_offset, + static_cast(page_offset + size), + const_cast(address)); + //Check error + if(!base){ + error_info err = winapi::get_last_error(); + throw interprocess_exception(err); + } + + //Calculate new base for the user + m_base = static_cast(base) + page_offset; + m_page_offset = page_offset; + m_size = size; + } + //Windows shared memory needs the duplication of the handle if we want to + //make mapped_region independent from the mappable device + // + //For mapped files, we duplicate the file handle to be able to FlushFileBuffers + if(!winapi::duplicate_current_process_handle(mhandle.handle, &m_file_or_mapping_hnd)){ + error_info err = winapi::get_last_error(); + this->priv_close(); + throw interprocess_exception(err); + } +} + +inline bool mapped_region::flush(std::size_t mapping_offset, std::size_t numbytes, bool async) +{ + void *addr; + if(!this->priv_flush_param_check(mapping_offset, addr, numbytes)){ + return false; + } + //Flush it all + if(!winapi::flush_view_of_file(addr, numbytes)){ + return false; + } + //m_file_or_mapping_hnd can be a file handle or a mapping handle. + //so flushing file buffers has only sense for files... + else if(!async && m_file_or_mapping_hnd != winapi::invalid_handle_value && + winapi::get_file_type(m_file_or_mapping_hnd) == winapi::file_type_disk){ + return winapi::flush_file_buffers(m_file_or_mapping_hnd); + } + return true; +} + +inline bool mapped_region::shrink_by(std::size_t bytes, bool from_back) +{ + void *shrink_page_start; + std::size_t shrink_page_bytes; + if(!this->priv_shrink_param_check(bytes, from_back, shrink_page_start, shrink_page_bytes)){ + return false; + } + else if(shrink_page_bytes){ + //In Windows, we can't decommit the storage or release the virtual address space, + //the best we can do is try to remove some memory from the process working set. + //With a bit of luck we can free some physical memory. + unsigned long old_protect_ignored; + bool b_ret = winapi::virtual_unlock(shrink_page_start, shrink_page_bytes) + || (winapi::get_last_error() == winapi::error_not_locked); + (void)old_protect_ignored; + //Change page protection to forbid any further access + b_ret = b_ret && winapi::virtual_protect + (shrink_page_start, shrink_page_bytes, winapi::page_noaccess, old_protect_ignored); + return b_ret; + } + else{ + return true; + } +} + +inline bool mapped_region::advise(advice_types) +{ + //Windows has no madvise/posix_madvise equivalent + return false; +} + +inline void mapped_region::priv_close() +{ + if(m_base){ + void *addr = this->priv_map_address(); + #if !defined(AUTOBOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) + mapped_region::destroy_syncs_in_range<0>(addr, m_size); + #endif + winapi::unmap_view_of_file(addr); + m_base = 0; + } + if(m_file_or_mapping_hnd != ipcdetail::invalid_file()){ + winapi::close_handle(m_file_or_mapping_hnd); + m_file_or_mapping_hnd = ipcdetail::invalid_file(); + } +} + +inline void mapped_region::dont_close_on_destruction() +{} + +#else //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +inline mapped_region::mapped_region() + : m_base(0), m_size(0), m_page_offset(0), m_mode(read_only), m_is_xsi(false) +{} + +template +inline std::size_t mapped_region::page_size_holder::get_page_size() +{ return std::size_t(sysconf(_SC_PAGESIZE)); } + +template +inline mapped_region::mapped_region + ( const MemoryMappable &mapping + , mode_t mode + , offset_t offset + , std::size_t size + , const void *address + , map_options_t map_options) + : m_base(0), m_size(0), m_page_offset(0), m_mode(mode), m_is_xsi(false) +{ + mapping_handle_t map_hnd = mapping.get_mapping_handle(); + + //Some systems dont' support XSI shared memory + #ifdef AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS + if(map_hnd.is_xsi){ + //Get the size + ::shmid_ds xsi_ds; + int ret = ::shmctl(map_hnd.handle, IPC_STAT, &xsi_ds); + if(ret == -1){ + error_info err(system_error_code()); + throw interprocess_exception(err); + } + //Compare sizess + if(size == 0){ + size = (std::size_t)xsi_ds.shm_segsz; + } + else if(size != (std::size_t)xsi_ds.shm_segsz){ + error_info err(size_error); + throw interprocess_exception(err); + } + //Calculate flag + int flag = map_options == default_map_options ? 0 : map_options; + if(m_mode == read_only){ + flag |= SHM_RDONLY; + } + else if(m_mode != read_write){ + error_info err(mode_error); + throw interprocess_exception(err); + } + //Attach memory + void *base = ::shmat(map_hnd.handle, (void*)address, flag); + if(base == (void*)-1){ + error_info err(system_error_code()); + throw interprocess_exception(err); + } + //Update members + m_base = base; + m_size = size; + m_mode = mode; + m_page_offset = 0; + m_is_xsi = true; + return; + } + #endif //ifdef AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS + + //We calculate the difference between demanded and valid offset + const offset_t page_offset = priv_page_offset_addr_fixup(offset, address); + + if(size == 0){ + struct ::stat buf; + if(0 != fstat(map_hnd.handle, &buf)){ + error_info err(system_error_code()); + throw interprocess_exception(err); + } + //This can throw + priv_size_from_mapping_size(buf.st_size, offset, page_offset, size); + } + + #ifdef MAP_NOSYNC + #define AUTOBOOST_INTERPROCESS_MAP_NOSYNC MAP_NOSYNC + #else + #define AUTOBOOST_INTERPROCESS_MAP_NOSYNC 0 + #endif //MAP_NOSYNC + + //Create new mapping + int prot = 0; + int flags = map_options == default_map_options ? AUTOBOOST_INTERPROCESS_MAP_NOSYNC : map_options; + + #undef AUTOBOOST_INTERPROCESS_MAP_NOSYNC + + switch(mode) + { + case read_only: + prot |= PROT_READ; + flags |= MAP_SHARED; + break; + + case read_private: + prot |= (PROT_READ); + flags |= MAP_PRIVATE; + break; + + case read_write: + prot |= (PROT_WRITE | PROT_READ); + flags |= MAP_SHARED; + break; + + case copy_on_write: + prot |= (PROT_WRITE | PROT_READ); + flags |= MAP_PRIVATE; + break; + + default: + { + error_info err(mode_error); + throw interprocess_exception(err); + } + break; + } + + //Map it to the address space + void* base = mmap ( const_cast(address) + , static_cast(page_offset + size) + , prot + , flags + , mapping.get_mapping_handle().handle + , offset - page_offset); + + //Check if mapping was successful + if(base == MAP_FAILED){ + error_info err = system_error_code(); + throw interprocess_exception(err); + } + + //Calculate new base for the user + m_base = static_cast(base) + page_offset; + m_page_offset = page_offset; + m_size = size; + + //Check for fixed mapping error + if(address && (base != address)){ + error_info err(busy_error); + this->priv_close(); + throw interprocess_exception(err); + } +} + +inline bool mapped_region::shrink_by(std::size_t bytes, bool from_back) +{ + void *shrink_page_start = 0; + std::size_t shrink_page_bytes = 0; + if(m_is_xsi || !this->priv_shrink_param_check(bytes, from_back, shrink_page_start, shrink_page_bytes)){ + return false; + } + else if(shrink_page_bytes){ + //In UNIX we can decommit and free virtual address space. + return 0 == munmap(shrink_page_start, shrink_page_bytes); + } + else{ + return true; + } +} + +inline bool mapped_region::flush(std::size_t mapping_offset, std::size_t numbytes, bool async) +{ + void *addr; + if(m_is_xsi || !this->priv_flush_param_check(mapping_offset, addr, numbytes)){ + return false; + } + //Flush it all + return msync(addr, numbytes, async ? MS_ASYNC : MS_SYNC) == 0; +} + +inline bool mapped_region::advise(advice_types advice) +{ + int unix_advice = 0; + //Modes; 0: none, 2: posix, 1: madvise + const unsigned int mode_none = 0; + const unsigned int mode_padv = 1; + const unsigned int mode_madv = 2; + // Suppress "unused variable" warnings + (void)mode_padv; + (void)mode_madv; + unsigned int mode = mode_none; + //Choose advice either from POSIX (preferred) or native Unix + switch(advice){ + case advice_normal: + #if defined(POSIX_MADV_NORMAL) + unix_advice = POSIX_MADV_NORMAL; + mode = mode_padv; + #elif defined(MADV_NORMAL) + unix_advice = MADV_NORMAL; + mode = mode_madv; + #endif + break; + case advice_sequential: + #if defined(POSIX_MADV_SEQUENTIAL) + unix_advice = POSIX_MADV_SEQUENTIAL; + mode = mode_padv; + #elif defined(MADV_SEQUENTIAL) + unix_advice = MADV_SEQUENTIAL; + mode = mode_madv; + #endif + break; + case advice_random: + #if defined(POSIX_MADV_RANDOM) + unix_advice = POSIX_MADV_RANDOM; + mode = mode_padv; + #elif defined(MADV_RANDOM) + unix_advice = MADV_RANDOM; + mode = mode_madv; + #endif + break; + case advice_willneed: + #if defined(POSIX_MADV_WILLNEED) + unix_advice = POSIX_MADV_WILLNEED; + mode = mode_padv; + #elif defined(MADV_WILLNEED) + unix_advice = MADV_WILLNEED; + mode = mode_madv; + #endif + break; + case advice_dontneed: + #if defined(POSIX_MADV_DONTNEED) + unix_advice = POSIX_MADV_DONTNEED; + mode = mode_padv; + #elif defined(MADV_DONTNEED) && defined(AUTOBOOST_INTERPROCESS_MADV_DONTNEED_HAS_NONDESTRUCTIVE_SEMANTICS) + unix_advice = MADV_DONTNEED; + mode = mode_madv; + #endif + break; + default: + return false; + } + switch(mode){ + #if defined(POSIX_MADV_NORMAL) + case mode_padv: + return 0 == posix_madvise(this->priv_map_address(), this->priv_map_size(), unix_advice); + #endif + #if defined(MADV_NORMAL) + case mode_madv: + return 0 == madvise( + #if defined(AUTOBOOST_INTERPROCESS_MADVISE_USES_CADDR_T) + (caddr_t) + #endif + this->priv_map_address(), this->priv_map_size(), unix_advice); + #endif + default: + return false; + + } +} + +inline void mapped_region::priv_close() +{ + if(m_base != 0){ + #ifdef AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS + if(m_is_xsi){ + int ret = ::shmdt(m_base); + AUTOBOOST_ASSERT(ret == 0); + (void)ret; + return; + } + #endif //#ifdef AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS + munmap(this->priv_map_address(), this->priv_map_size()); + m_base = 0; + } +} + +inline void mapped_region::dont_close_on_destruction() +{ m_base = 0; } + +#endif //#if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + +template +const std::size_t mapped_region::page_size_holder::PageSize + = mapped_region::page_size_holder::get_page_size(); + +inline std::size_t mapped_region::get_page_size() +{ + if(!page_size_holder<0>::PageSize) + return page_size_holder<0>::get_page_size(); + else + return page_size_holder<0>::PageSize; +} + +inline void mapped_region::swap(mapped_region &other) +{ + ipcdetail::do_swap(this->m_base, other.m_base); + ipcdetail::do_swap(this->m_size, other.m_size); + ipcdetail::do_swap(this->m_page_offset, other.m_page_offset); + ipcdetail::do_swap(this->m_mode, other.m_mode); + #if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + ipcdetail::do_swap(this->m_file_or_mapping_hnd, other.m_file_or_mapping_hnd); + #else + ipcdetail::do_swap(this->m_is_xsi, other.m_is_xsi); + #endif +} + +//!No-op functor +struct null_mapped_region_function +{ + bool operator()(void *, std::size_t , bool) const + { return true; } + + std::size_t get_min_size() const + { return 0; } +}; + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_MAPPED_REGION_HPP + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +#ifndef AUTOBOOST_INTERPROCESS_MAPPED_REGION_EXT_HPP +#define AUTOBOOST_INTERPROCESS_MAPPED_REGION_EXT_HPP + +#if defined(AUTOBOOST_INTERPROCESS_WINDOWS) && !defined(AUTOBOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) +# include +# include + +namespace autoboost { +namespace interprocess { + +template +inline void mapped_region::destroy_syncs_in_range(const void *addr, std::size_t size) +{ + ipcdetail::sync_handles &handles = + ipcdetail::windows_intermodule_singleton::get(); + handles.destroy_syncs_in_range(addr, size); +} + +} //namespace interprocess { +} //namespace autoboost { + +#endif //defined(AUTOBOOST_INTERPROCESS_WINDOWS) && !defined(AUTOBOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) + +#endif //#ifdef AUTOBOOST_INTERPROCESS_MAPPED_REGION_EXT_HPP + +#endif //#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + diff --git a/contrib/autoboost/autoboost/interprocess/permissions.hpp b/contrib/autoboost/autoboost/interprocess/permissions.hpp new file mode 100644 index 000000000..893e7d1d4 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/permissions.hpp @@ -0,0 +1,128 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_PERMISSIONS_HPP +#define AUTOBOOST_INTERPROCESS_PERMISSIONS_HPP + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include + +#if defined(AUTOBOOST_INTERPROCESS_WINDOWS) + +#include + +#endif + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + +//!\file +//!Describes permissions class + +namespace autoboost { +namespace interprocess { + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +#if defined(AUTOBOOST_INTERPROCESS_WINDOWS) + +namespace ipcdetail { + +template +struct unrestricted_permissions_holder +{ + static winapi::interprocess_all_access_security unrestricted; +}; + +template +winapi::interprocess_all_access_security unrestricted_permissions_holder::unrestricted; + +} //namespace ipcdetail { + +#endif //defined AUTOBOOST_INTERPROCESS_WINDOWS + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + +//!The permissions class represents permissions to be set to shared memory or +//!files, that can be constructed form usual permission representations: +//!a SECURITY_ATTRIBUTES pointer in windows or ORed rwx chmod integer in UNIX. +class permissions +{ + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + + #if defined(AUTOBOOST_INTERPROCESS_WINDOWS) + typedef void* os_permissions_type; + #else + typedef int os_permissions_type; + #endif + os_permissions_type m_perm; + + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + public: + //!Constructs a permissions object from a user provided os-dependent + //!permissions. + permissions(os_permissions_type type) + : m_perm(type) + {} + + //!Constructs a default permissions object: + //!A null security attributes pointer for windows or 0644 + //!for UNIX. + permissions() + { set_default(); } + + //!Sets permissions to default values: + //!A null security attributes pointer for windows or 0644 + //!for UNIX. + void set_default() + { + #if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + m_perm = 0; + #else + m_perm = 0644; + #endif + } + + //!Sets permissions to unrestricted access: + //!A null DACL for windows or 0666 for UNIX. + void set_unrestricted() + { + #if defined (AUTOBOOST_INTERPROCESS_WINDOWS) + m_perm = &ipcdetail::unrestricted_permissions_holder<0>::unrestricted; + #else + m_perm = 0666; + #endif + } + + //!Sets permissions from a user provided os-dependent + //!permissions. + void set_permissions(os_permissions_type perm) + { m_perm = perm; } + + //!Returns stored os-dependent + //!permissions + os_permissions_type get_permissions() const + { return m_perm; } +}; + +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_PERMISSIONS_HPP + diff --git a/contrib/autoboost/autoboost/interprocess/shared_memory_object.hpp b/contrib/autoboost/autoboost/interprocess/shared_memory_object.hpp new file mode 100644 index 000000000..e5ac8b647 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/shared_memory_object.hpp @@ -0,0 +1,434 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_SHARED_MEMORY_OBJECT_HPP +#define AUTOBOOST_INTERPROCESS_SHARED_MEMORY_OBJECT_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(AUTOBOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS_ONLY) +# include //System V shared memory... +#elif defined(AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS) +# include //O_CREAT, O_*... +# include //shm_xxx +# include //ftruncate, close +# include //mode_t, S_IRWXG, S_IRWXO, S_IRWXU, +# if defined(AUTOBOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY) +# if defined(__FreeBSD__) +# include +# endif +# endif +#else +// +#endif + +//!\file +//!Describes a shared memory object management class. + +namespace autoboost { +namespace interprocess { + +//!A class that wraps a shared memory mapping that can be used to +//!create mapped regions from the mapped files +class shared_memory_object +{ + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + //Non-copyable and non-assignable + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(shared_memory_object) + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + public: + //!Default constructor. Represents an empty shared_memory_object. + shared_memory_object(); + + //!Creates a shared memory object with name "name" and mode "mode", with the access mode "mode" + //!If the file previously exists, throws an error.*/ + shared_memory_object(create_only_t, const char *name, mode_t mode, const permissions &perm = permissions()) + { this->priv_open_or_create(ipcdetail::DoCreate, name, mode, perm); } + + //!Tries to create a shared memory object with name "name" and mode "mode", with the + //!access mode "mode". If the file previously exists, it tries to open it with mode "mode". + //!Otherwise throws an error. + shared_memory_object(open_or_create_t, const char *name, mode_t mode, const permissions &perm = permissions()) + { this->priv_open_or_create(ipcdetail::DoOpenOrCreate, name, mode, perm); } + + //!Tries to open a shared memory object with name "name", with the access mode "mode". + //!If the file does not previously exist, it throws an error. + shared_memory_object(open_only_t, const char *name, mode_t mode) + { this->priv_open_or_create(ipcdetail::DoOpen, name, mode, permissions()); } + + //!Moves the ownership of "moved"'s shared memory object to *this. + //!After the call, "moved" does not represent any shared memory object. + //!Does not throw + shared_memory_object(AUTOBOOST_RV_REF(shared_memory_object) moved) + : m_handle(file_handle_t(ipcdetail::invalid_file())) + , m_mode(read_only) + { this->swap(moved); } + + //!Moves the ownership of "moved"'s shared memory to *this. + //!After the call, "moved" does not represent any shared memory. + //!Does not throw + shared_memory_object &operator=(AUTOBOOST_RV_REF(shared_memory_object) moved) + { + shared_memory_object tmp(autoboost::move(moved)); + this->swap(tmp); + return *this; + } + + //!Swaps the shared_memory_objects. Does not throw + void swap(shared_memory_object &moved); + + //!Erases a shared memory object from the system. + //!Returns false on error. Never throws + static bool remove(const char *name); + + //!Sets the size of the shared memory mapping + void truncate(offset_t length); + + //!Destroys *this and indicates that the calling process is finished using + //!the resource. All mapped regions are still + //!valid after destruction. The destructor function will deallocate + //!any system resources allocated by the system for use by this process for + //!this resource. The resource can still be opened again calling + //!the open constructor overload. To erase the resource from the system + //!use remove(). + ~shared_memory_object(); + + //!Returns the name of the shared memory object. + const char *get_name() const; + + //!Returns true if the size of the shared memory object + //!can be obtained and writes the size in the passed reference + bool get_size(offset_t &size) const; + + //!Returns access mode + mode_t get_mode() const; + + //!Returns mapping handle. Never throws. + mapping_handle_t get_mapping_handle() const; + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + + //!Closes a previously opened file mapping. Never throws. + void priv_close(); + + //!Opens or creates a shared memory object. + bool priv_open_or_create(ipcdetail::create_enum_t type, const char *filename, mode_t mode, const permissions &perm); + + file_handle_t m_handle; + mode_t m_mode; + std::string m_filename; + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED +}; + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +inline shared_memory_object::shared_memory_object() + : m_handle(file_handle_t(ipcdetail::invalid_file())) + , m_mode(read_only) +{} + +inline shared_memory_object::~shared_memory_object() +{ this->priv_close(); } + + +inline const char *shared_memory_object::get_name() const +{ return m_filename.c_str(); } + +inline bool shared_memory_object::get_size(offset_t &size) const +{ return ipcdetail::get_file_size((file_handle_t)m_handle, size); } + +inline void shared_memory_object::swap(shared_memory_object &other) +{ + std::swap(m_handle, other.m_handle); + std::swap(m_mode, other.m_mode); + m_filename.swap(other.m_filename); +} + +inline mapping_handle_t shared_memory_object::get_mapping_handle() const +{ + return ipcdetail::mapping_handle_from_file_handle(m_handle); +} + +inline mode_t shared_memory_object::get_mode() const +{ return m_mode; } + +#if !defined(AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS) + +inline bool shared_memory_object::priv_open_or_create + (ipcdetail::create_enum_t type, const char *filename, mode_t mode, const permissions &perm) +{ + m_filename = filename; + std::string shmfile; + ipcdetail::create_shared_dir_cleaning_old_and_get_filepath(filename, shmfile); + + //Set accesses + if (mode != read_write && mode != read_only){ + error_info err = other_error; + throw interprocess_exception(err); + } + + switch(type){ + case ipcdetail::DoOpen: + m_handle = ipcdetail::open_existing_file(shmfile.c_str(), mode, true); + break; + case ipcdetail::DoCreate: + m_handle = ipcdetail::create_new_file(shmfile.c_str(), mode, perm, true); + break; + case ipcdetail::DoOpenOrCreate: + m_handle = ipcdetail::create_or_open_file(shmfile.c_str(), mode, perm, true); + break; + default: + { + error_info err = other_error; + throw interprocess_exception(err); + } + } + + //Check for error + if(m_handle == ipcdetail::invalid_file()){ + error_info err = system_error_code(); + this->priv_close(); + throw interprocess_exception(err); + } + + m_mode = mode; + return true; +} + +inline bool shared_memory_object::remove(const char *filename) +{ + try{ + //Make sure a temporary path is created for shared memory + std::string shmfile; + ipcdetail::shared_filepath(filename, shmfile); + return ipcdetail::delete_file(shmfile.c_str()); + } + catch(...){ + return false; + } +} + +inline void shared_memory_object::truncate(offset_t length) +{ + if(!ipcdetail::truncate_file(m_handle, length)){ + error_info err = system_error_code(); + throw interprocess_exception(err); + } +} + +inline void shared_memory_object::priv_close() +{ + if(m_handle != ipcdetail::invalid_file()){ + ipcdetail::close_file(m_handle); + m_handle = ipcdetail::invalid_file(); + } +} + +#else //!defined(AUTOBOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS) + +namespace shared_memory_object_detail { + +#ifdef AUTOBOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY + +#if defined(__FreeBSD__) + +inline bool use_filesystem_based_posix() +{ + int jailed = 0; + std::size_t len = sizeof(jailed); + ::sysctlbyname("security.jail.jailed", &jailed, &len, NULL, 0); + return jailed != 0; +} + +#else +#error "Not supported platform for AUTOBOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY" +#endif + +#endif + +} //shared_memory_object_detail + +inline bool shared_memory_object::priv_open_or_create + (ipcdetail::create_enum_t type, + const char *filename, + mode_t mode, const permissions &perm) +{ + #if defined(AUTOBOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY) + const bool add_leading_slash = false; + #elif defined(AUTOBOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY) + const bool add_leading_slash = !shared_memory_object_detail::use_filesystem_based_posix(); + #else + const bool add_leading_slash = true; + #endif + if(add_leading_slash){ + ipcdetail::add_leading_slash(filename, m_filename); + } + else{ + ipcdetail::create_shared_dir_cleaning_old_and_get_filepath(filename, m_filename); + } + + //Create new mapping + int oflag = 0; + if(mode == read_only){ + oflag |= O_RDONLY; + } + else if(mode == read_write){ + oflag |= O_RDWR; + } + else{ + error_info err(mode_error); + throw interprocess_exception(err); + } + int unix_perm = perm.get_permissions(); + + switch(type){ + case ipcdetail::DoOpen: + { + //No oflag addition + m_handle = shm_open(m_filename.c_str(), oflag, unix_perm); + } + break; + case ipcdetail::DoCreate: + { + oflag |= (O_CREAT | O_EXCL); + m_handle = shm_open(m_filename.c_str(), oflag, unix_perm); + if(m_handle >= 0){ + ::fchmod(m_handle, unix_perm); + } + } + break; + case ipcdetail::DoOpenOrCreate: + { + //We need a create/open loop to change permissions correctly using fchmod, since + //with "O_CREAT" only we don't know if we've created or opened the shm. + while(1){ + //Try to create shared memory + m_handle = shm_open(m_filename.c_str(), oflag | (O_CREAT | O_EXCL), unix_perm); + //If successful change real permissions + if(m_handle >= 0){ + ::fchmod(m_handle, unix_perm); + } + //If already exists, try to open + else if(errno == EEXIST){ + m_handle = shm_open(m_filename.c_str(), oflag, unix_perm); + //If open fails and errno tells the file does not exist + //(shm was removed between creation and opening tries), just retry + if(m_handle < 0 && errno == ENOENT){ + continue; + } + } + //Exit retries + break; + } + } + break; + default: + { + error_info err = other_error; + throw interprocess_exception(err); + } + } + + //Check for error + if(m_handle < 0){ + error_info err = errno; + this->priv_close(); + throw interprocess_exception(err); + } + + m_filename = filename; + m_mode = mode; + return true; +} + +inline bool shared_memory_object::remove(const char *filename) +{ + try{ + std::string filepath; + #if defined(AUTOBOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY) + const bool add_leading_slash = false; + #elif defined(AUTOBOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY) + const bool add_leading_slash = !shared_memory_object_detail::use_filesystem_based_posix(); + #else + const bool add_leading_slash = true; + #endif + if(add_leading_slash){ + ipcdetail::add_leading_slash(filename, filepath); + } + else{ + ipcdetail::shared_filepath(filename, filepath); + } + return 0 == shm_unlink(filepath.c_str()); + } + catch(...){ + return false; + } +} + +inline void shared_memory_object::truncate(offset_t length) +{ + if(0 != ftruncate(m_handle, length)){ + error_info err(system_error_code()); + throw interprocess_exception(err); + } +} + +inline void shared_memory_object::priv_close() +{ + if(m_handle != -1){ + ::close(m_handle); + m_handle = -1; + } +} + +#endif + +//!A class that stores the name of a shared memory +//!and calls shared_memory_object::remove(name) in its destructor +//!Useful to remove temporary shared memory objects in the presence +//!of exceptions +class remove_shared_memory_on_destroy +{ + const char * m_name; + public: + remove_shared_memory_on_destroy(const char *name) + : m_name(name) + {} + + ~remove_shared_memory_on_destroy() + { shared_memory_object::remove(m_name); } +}; + +#endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_SHARED_MEMORY_OBJECT_HPP diff --git a/contrib/autoboost/autoboost/interprocess/streams/bufferstream.hpp b/contrib/autoboost/autoboost/interprocess/streams/bufferstream.hpp new file mode 100644 index 000000000..affb6cd92 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/streams/bufferstream.hpp @@ -0,0 +1,487 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// +// +// This file comes from SGI's sstream file. Modified by Ion Gaztanaga 2005-2012. +// Changed internal SGI string to a buffer. Added efficient +// internal buffer get/set/swap functions, so that we can obtain/establish the +// internal buffer without any reallocation or copy. Kill those temporaries! +/////////////////////////////////////////////////////////////////////////////// +/* + * Copyright (c) 1998 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +//!\file +//!This file defines basic_bufferbuf, basic_ibufferstream, +//!basic_obufferstream, and basic_bufferstream classes. These classes +//!represent streamsbufs and streams whose sources or destinations +//!are fixed size character buffers. + +#ifndef AUTOBOOST_INTERPROCESS_BUFFERSTREAM_HPP +#define AUTOBOOST_INTERPROCESS_BUFFERSTREAM_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include +#include // char traits +#include // ptrdiff_t +#include +#include + +namespace autoboost { namespace interprocess { + +//!A streambuf class that controls the transmission of elements to and from +//!a basic_xbufferstream. The elements are transmitted from a to a fixed +//!size buffer +template +class basic_bufferbuf + : public std::basic_streambuf +{ + public: + typedef CharT char_type; + typedef typename CharTraits::int_type int_type; + typedef typename CharTraits::pos_type pos_type; + typedef typename CharTraits::off_type off_type; + typedef CharTraits traits_type; + typedef std::basic_streambuf base_t; + + public: + //!Constructor. + //!Does not throw. + explicit basic_bufferbuf(std::ios_base::openmode mode + = std::ios_base::in | std::ios_base::out) + : base_t(), m_mode(mode), m_buffer(0), m_length(0) + {} + + //!Constructor. Assigns formatting buffer. + //!Does not throw. + explicit basic_bufferbuf(CharT *buf, std::size_t length, + std::ios_base::openmode mode + = std::ios_base::in | std::ios_base::out) + : base_t(), m_mode(mode), m_buffer(buf), m_length(length) + { this->set_pointers(); } + + virtual ~basic_bufferbuf(){} + + public: + //!Returns the pointer and size of the internal buffer. + //!Does not throw. + std::pair buffer() const + { return std::pair(m_buffer, m_length); } + + //!Sets the underlying buffer to a new value + //!Does not throw. + void buffer(CharT *buf, std::size_t length) + { m_buffer = buf; m_length = length; this->set_pointers(); } + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + void set_pointers() + { + // The initial read position is the beginning of the buffer. + if(m_mode & std::ios_base::in) + this->setg(m_buffer, m_buffer, m_buffer + m_length); + + // The initial write position is the beginning of the buffer. + if(m_mode & std::ios_base::out) + this->setp(m_buffer, m_buffer + m_length); + } + + protected: + virtual int_type underflow() + { + // Precondition: gptr() >= egptr(). Returns a character, if available. + return this->gptr() != this->egptr() ? + CharTraits::to_int_type(*this->gptr()) : CharTraits::eof(); + } + + virtual int_type pbackfail(int_type c = CharTraits::eof()) + { + if(this->gptr() != this->eback()) { + if(!CharTraits::eq_int_type(c, CharTraits::eof())) { + if(CharTraits::eq(CharTraits::to_char_type(c), this->gptr()[-1])) { + this->gbump(-1); + return c; + } + else if(m_mode & std::ios_base::out) { + this->gbump(-1); + *this->gptr() = c; + return c; + } + else + return CharTraits::eof(); + } + else { + this->gbump(-1); + return CharTraits::not_eof(c); + } + } + else + return CharTraits::eof(); + } + + virtual int_type overflow(int_type c = CharTraits::eof()) + { + if(m_mode & std::ios_base::out) { + if(!CharTraits::eq_int_type(c, CharTraits::eof())) { +// if(!(m_mode & std::ios_base::in)) { +// if(this->pptr() != this->epptr()) { +// *this->pptr() = CharTraits::to_char_type(c); +// this->pbump(1); +// return c; +// } +// else +// return CharTraits::eof(); +// } +// else { + if(this->pptr() == this->epptr()) { + //We can't append to a static buffer + return CharTraits::eof(); + } + else { + *this->pptr() = CharTraits::to_char_type(c); + this->pbump(1); + return c; + } +// } + } + else // c is EOF, so we don't have to do anything + return CharTraits::not_eof(c); + } + else // Overflow always fails if it's read-only. + return CharTraits::eof(); + } + + virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, + std::ios_base::openmode mode + = std::ios_base::in | std::ios_base::out) + { + bool in = false; + bool out = false; + + const std::ios_base::openmode inout = + std::ios_base::in | std::ios_base::out; + + if((mode & inout) == inout) { + if(dir == std::ios_base::beg || dir == std::ios_base::end) + in = out = true; + } + else if(mode & std::ios_base::in) + in = true; + else if(mode & std::ios_base::out) + out = true; + + if(!in && !out) + return pos_type(off_type(-1)); + else if((in && (!(m_mode & std::ios_base::in) || this->gptr() == 0)) || + (out && (!(m_mode & std::ios_base::out) || this->pptr() == 0))) + return pos_type(off_type(-1)); + + std::streamoff newoff; + switch(dir) { + case std::ios_base::beg: + newoff = 0; + break; + case std::ios_base::end: + newoff = static_cast(m_length); + break; + case std::ios_base::cur: + newoff = in ? static_cast(this->gptr() - this->eback()) + : static_cast(this->pptr() - this->pbase()); + break; + default: + return pos_type(off_type(-1)); + } + + off += newoff; + + if(in) { + std::ptrdiff_t n = this->egptr() - this->eback(); + + if(off < 0 || off > n) + return pos_type(off_type(-1)); + else + this->setg(this->eback(), this->eback() + off, this->eback() + n); + } + + if(out) { + std::ptrdiff_t n = this->epptr() - this->pbase(); + + if(off < 0 || off > n) + return pos_type(off_type(-1)); + else { + this->setp(this->pbase(), this->pbase() + n); + this->pbump(off); + } + } + + return pos_type(off); + } + + virtual pos_type seekpos(pos_type pos, std::ios_base::openmode mode + = std::ios_base::in | std::ios_base::out) + { return seekoff(pos - pos_type(off_type(0)), std::ios_base::beg, mode); } + + private: + std::ios_base::openmode m_mode; + CharT * m_buffer; + std::size_t m_length; + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED +}; + +//!A basic_istream class that uses a fixed size character buffer +//!as its formatting buffer. +template +class basic_ibufferstream : + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private basic_bufferbuf, + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + public std::basic_istream +{ + public: // Typedefs + typedef typename std::basic_ios + ::char_type char_type; + typedef typename std::basic_ios::int_type int_type; + typedef typename std::basic_ios::pos_type pos_type; + typedef typename std::basic_ios::off_type off_type; + typedef typename std::basic_ios::traits_type traits_type; + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + typedef basic_bufferbuf bufferbuf_t; + typedef std::basic_ios basic_ios_t; + typedef std::basic_istream base_t; + bufferbuf_t & get_buf() { return *this; } + const bufferbuf_t & get_buf() const{ return *this; } + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + public: + //!Constructor. + //!Does not throw. + basic_ibufferstream(std::ios_base::openmode mode = std::ios_base::in) + : //basic_ios_t() is called first (lefting it uninitialized) as it's a + //virtual base of basic_istream. The class will be initialized when + //basic_istream is constructed calling basic_ios_t::init(). + //As bufferbuf_t's constructor does not throw there is no risk of + //calling the basic_ios_t's destructor without calling basic_ios_t::init() + bufferbuf_t(mode | std::ios_base::in) + , base_t(&get_buf()) + {} + + //!Constructor. Assigns formatting buffer. + //!Does not throw. + basic_ibufferstream(const CharT *buf, std::size_t length, + std::ios_base::openmode mode = std::ios_base::in) + : //basic_ios_t() is called first (lefting it uninitialized) as it's a + //virtual base of basic_istream. The class will be initialized when + //basic_istream is constructed calling basic_ios_t::init(). + //As bufferbuf_t's constructor does not throw there is no risk of + //calling the basic_ios_t's destructor without calling basic_ios_t::init() + bufferbuf_t(const_cast(buf), length, mode | std::ios_base::in) + , base_t(&get_buf()) + {} + + ~basic_ibufferstream(){}; + + public: + //!Returns the address of the stored + //!stream buffer. + basic_bufferbuf* rdbuf() const + { return const_cast*>(&get_buf()); } + + //!Returns the pointer and size of the internal buffer. + //!Does not throw. + std::pair buffer() const + { return get_buf().buffer(); } + + //!Sets the underlying buffer to a new value. Resets + //!stream position. Does not throw. + void buffer(const CharT *buf, std::size_t length) + { get_buf().buffer(const_cast(buf), length); } +}; + +//!A basic_ostream class that uses a fixed size character buffer +//!as its formatting buffer. +template +class basic_obufferstream : + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private basic_bufferbuf, + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + public std::basic_ostream +{ + public: + typedef typename std::basic_ios + ::char_type char_type; + typedef typename std::basic_ios::int_type int_type; + typedef typename std::basic_ios::pos_type pos_type; + typedef typename std::basic_ios::off_type off_type; + typedef typename std::basic_ios::traits_type traits_type; + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + typedef basic_bufferbuf bufferbuf_t; + typedef std::basic_ios basic_ios_t; + typedef std::basic_ostream base_t; + bufferbuf_t & get_buf() { return *this; } + const bufferbuf_t & get_buf() const{ return *this; } + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + public: + //!Constructor. + //!Does not throw. + basic_obufferstream(std::ios_base::openmode mode = std::ios_base::out) + : //basic_ios_t() is called first (lefting it uninitialized) as it's a + //virtual base of basic_istream. The class will be initialized when + //basic_istream is constructed calling basic_ios_t::init(). + //As bufferbuf_t's constructor does not throw there is no risk of + //calling the basic_ios_t's destructor without calling basic_ios_t::init() + bufferbuf_t(mode | std::ios_base::out) + , base_t(&get_buf()) + {} + + //!Constructor. Assigns formatting buffer. + //!Does not throw. + basic_obufferstream(CharT *buf, std::size_t length, + std::ios_base::openmode mode = std::ios_base::out) + : //basic_ios_t() is called first (lefting it uninitialized) as it's a + //virtual base of basic_istream. The class will be initialized when + //basic_istream is constructed calling basic_ios_t::init(). + //As bufferbuf_t's constructor does not throw there is no risk of + //calling the basic_ios_t's destructor without calling basic_ios_t::init() + bufferbuf_t(buf, length, mode | std::ios_base::out) + , base_t(&get_buf()) + {} + + ~basic_obufferstream(){} + + public: + //!Returns the address of the stored + //!stream buffer. + basic_bufferbuf* rdbuf() const + { return const_cast*>(&get_buf()); } + + //!Returns the pointer and size of the internal buffer. + //!Does not throw. + std::pair buffer() const + { return get_buf().buffer(); } + + //!Sets the underlying buffer to a new value. Resets + //!stream position. Does not throw. + void buffer(CharT *buf, std::size_t length) + { get_buf().buffer(buf, length); } +}; + + +//!A basic_iostream class that uses a fixed size character buffer +//!as its formatting buffer. +template +class basic_bufferstream : + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private basic_bufferbuf, + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + public std::basic_iostream +{ + public: // Typedefs + typedef typename std::basic_ios + ::char_type char_type; + typedef typename std::basic_ios::int_type int_type; + typedef typename std::basic_ios::pos_type pos_type; + typedef typename std::basic_ios::off_type off_type; + typedef typename std::basic_ios::traits_type traits_type; + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + typedef basic_bufferbuf bufferbuf_t; + typedef std::basic_ios basic_ios_t; + typedef std::basic_iostream base_t; + bufferbuf_t & get_buf() { return *this; } + const bufferbuf_t & get_buf() const{ return *this; } + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + public: + //!Constructor. + //!Does not throw. + basic_bufferstream(std::ios_base::openmode mode + = std::ios_base::in | std::ios_base::out) + : //basic_ios_t() is called first (lefting it uninitialized) as it's a + //virtual base of basic_istream. The class will be initialized when + //basic_istream is constructed calling basic_ios_t::init(). + //As bufferbuf_t's constructor does not throw there is no risk of + //calling the basic_ios_t's destructor without calling basic_ios_t::init() + bufferbuf_t(mode) + , base_t(&get_buf()) + {} + + //!Constructor. Assigns formatting buffer. + //!Does not throw. + basic_bufferstream(CharT *buf, std::size_t length, + std::ios_base::openmode mode + = std::ios_base::in | std::ios_base::out) + : //basic_ios_t() is called first (lefting it uninitialized) as it's a + //virtual base of basic_istream. The class will be initialized when + //basic_istream is constructed calling basic_ios_t::init(). + //As bufferbuf_t's constructor does not throw there is no risk of + //calling the basic_ios_t's destructor without calling basic_ios_t::init() + bufferbuf_t(buf, length, mode) + , base_t(&get_buf()) + {} + + ~basic_bufferstream(){} + + public: + //!Returns the address of the stored + //!stream buffer. + basic_bufferbuf* rdbuf() const + { return const_cast*>(&get_buf()); } + + //!Returns the pointer and size of the internal buffer. + //!Does not throw. + std::pair buffer() const + { return get_buf().buffer(); } + + //!Sets the underlying buffer to a new value. Resets + //!stream position. Does not throw. + void buffer(CharT *buf, std::size_t length) + { get_buf().buffer(buf, length); } +}; + +//Some typedefs to simplify usage +typedef basic_bufferbuf bufferbuf; +typedef basic_bufferstream bufferstream; +typedef basic_ibufferstream ibufferstream; +typedef basic_obufferstream obufferstream; + +typedef basic_bufferbuf wbufferbuf; +typedef basic_bufferstream wbufferstream; +typedef basic_ibufferstream wibufferstream; +typedef basic_obufferstream wobufferstream; + + +}} //namespace autoboost { namespace interprocess { + +#include + +#endif /* AUTOBOOST_INTERPROCESS_BUFFERSTREAM_HPP */ diff --git a/contrib/autoboost/autoboost/interprocess/sync/detail/common_algorithms.hpp b/contrib/autoboost/autoboost/interprocess/sync/detail/common_algorithms.hpp new file mode 100644 index 000000000..20c935e7e --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/detail/common_algorithms.hpp @@ -0,0 +1,77 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2012-2013. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP +#define AUTOBOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +template +bool try_based_timed_lock(MutexType &m, const autoboost::posix_time::ptime &abs_time) +{ + //Same as lock() + if(abs_time == autoboost::posix_time::pos_infin){ + m.lock(); + return true; + } + //Always try to lock to achieve POSIX guarantees: + // "Under no circumstance shall the function fail with a timeout if the mutex + // can be locked immediately. The validity of the abs_timeout parameter need not + // be checked if the mutex can be locked immediately." + else if(m.try_lock()){ + return true; + } + else{ + spin_wait swait; + while(microsec_clock::universal_time() < abs_time){ + if(m.try_lock()){ + return true; + } + swait.yield(); + } + return false; + } +} + +template +void try_based_lock(MutexType &m) +{ + if(!m.try_lock()){ + spin_wait swait; + do{ + if(m.try_lock()){ + break; + } + else{ + swait.yield(); + } + } + while(1); + } +} + +} //namespace ipcdetail +} //namespace interprocess +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/sync/lock_options.hpp b/contrib/autoboost/autoboost/interprocess/sync/lock_options.hpp new file mode 100644 index 000000000..205adadf0 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/lock_options.hpp @@ -0,0 +1,59 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_LOCK_OPTIONS_HPP +#define AUTOBOOST_INTERPROCESS_LOCK_OPTIONS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +//!\file +//!Describes the lock options with associated with interprocess_mutex lock constructors. + +namespace autoboost { + +#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +namespace posix_time +{ class ptime; } + +#endif //#if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + +namespace interprocess { + +//!Type to indicate to a mutex lock constructor that must not lock the mutex. +struct defer_lock_type{}; +//!Type to indicate to a mutex lock constructor that must try to lock the mutex. +struct try_to_lock_type {}; +//!Type to indicate to a mutex lock constructor that the mutex is already locked. +struct accept_ownership_type{}; + +//!An object indicating that the locking +//!must be deferred. +static const defer_lock_type defer_lock = defer_lock_type(); + +//!An object indicating that a try_lock() +//!operation must be executed. +static const try_to_lock_type try_to_lock = try_to_lock_type(); + +//!An object indicating that the ownership of lockable +//!object must be accepted by the new owner. +static const accept_ownership_type accept_ownership = accept_ownership_type(); + +} // namespace interprocess { +} // namespace autoboost{ + +#include + +#endif // AUTOBOOST_INTERPROCESS_LOCK_OPTIONS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/sync/scoped_lock.hpp b/contrib/autoboost/autoboost/interprocess/sync/scoped_lock.hpp new file mode 100644 index 000000000..45f649b5c --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/scoped_lock.hpp @@ -0,0 +1,372 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// +// +// This interface is inspired by Howard Hinnant's lock proposal. +// http://home.twcny.rr.com/hinnant/cpp_extensions/threads_move.html +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_SCOPED_LOCK_HPP +#define AUTOBOOST_INTERPROCESS_SCOPED_LOCK_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//!\file +//!Describes the scoped_lock class. + +namespace autoboost { +namespace interprocess { + + +//!scoped_lock is meant to carry out the tasks for locking, unlocking, try-locking +//!and timed-locking (recursive or not) for the Mutex. The Mutex need not supply all +//!of this functionality. If the client of scoped_lock does not use +//!functionality which the Mutex does not supply, no harm is done. Mutex ownership +//!transfer is supported through the syntax of move semantics. Ownership transfer +//!is allowed both by construction and assignment. The scoped_lock does not support +//!copy semantics. A compile time error results if copy construction or copy +//!assignment is attempted. Mutex ownership can also be moved from an +//!upgradable_lock and sharable_lock via constructor. In this role, scoped_lock +//!shares the same functionality as a write_lock. +template +class scoped_lock +{ + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + typedef scoped_lock this_type; + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(scoped_lock) + typedef bool this_type::*unspecified_bool_type; + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + public: + + typedef Mutex mutex_type; + + //!Effects: Default constructs a scoped_lock. + //!Postconditions: owns() == false and mutex() == 0. + scoped_lock() + : mp_mutex(0), m_locked(false) + {} + + //!Effects: m.lock(). + //!Postconditions: owns() == true and mutex() == &m. + //!Notes: The constructor will take ownership of the mutex. If another thread + //! already owns the mutex, this thread will block until the mutex is released. + //! Whether or not this constructor handles recursive locking depends upon the mutex. + explicit scoped_lock(mutex_type& m) + : mp_mutex(&m), m_locked(false) + { mp_mutex->lock(); m_locked = true; } + + //!Postconditions: owns() == false, and mutex() == &m. + //!Notes: The constructor will not take ownership of the mutex. There is no effect + //! required on the referenced mutex. + scoped_lock(mutex_type& m, defer_lock_type) + : mp_mutex(&m), m_locked(false) + {} + + //!Postconditions: owns() == true, and mutex() == &m. + //!Notes: The constructor will suppose that the mutex is already locked. There + //! is no effect required on the referenced mutex. + scoped_lock(mutex_type& m, accept_ownership_type) + : mp_mutex(&m), m_locked(true) + {} + + //!Effects: m.try_lock(). + //!Postconditions: mutex() == &m. owns() == the return value of the + //! m.try_lock() executed within the constructor. + //!Notes: The constructor will take ownership of the mutex if it can do + //! so without waiting. Whether or not this constructor handles recursive + //! locking depends upon the mutex. If the mutex_type does not support try_lock, + //! this constructor will fail at compile time if instantiated, but otherwise + //! have no effect. + scoped_lock(mutex_type& m, try_to_lock_type) + : mp_mutex(&m), m_locked(mp_mutex->try_lock()) + {} + + //!Effects: m.timed_lock(abs_time). + //!Postconditions: mutex() == &m. owns() == the return value of the + //! m.timed_lock(abs_time) executed within the constructor. + //!Notes: The constructor will take ownership of the mutex if it can do + //! it until abs_time is reached. Whether or not this constructor + //! handles recursive locking depends upon the mutex. If the mutex_type + //! does not support try_lock, this constructor will fail at compile + //! time if instantiated, but otherwise have no effect. + scoped_lock(mutex_type& m, const autoboost::posix_time::ptime& abs_time) + : mp_mutex(&m), m_locked(mp_mutex->timed_lock(abs_time)) + {} + + //!Postconditions: mutex() == the value scop.mutex() had before the + //! constructor executes. s1.mutex() == 0. owns() == the value of + //! scop.owns() before the constructor executes. scop.owns(). + //!Notes: If the scop scoped_lock owns the mutex, ownership is moved + //! to thisscoped_lock with no blocking. If the scop scoped_lock does not + //! own the mutex, then neither will this scoped_lock. Only a moved + //! scoped_lock's will match this signature. An non-moved scoped_lock + //! can be moved with the expression: "autoboost::move(lock);". This + //! constructor does not alter the state of the mutex, only potentially + //! who owns it. + scoped_lock(AUTOBOOST_RV_REF(scoped_lock) scop) + : mp_mutex(0), m_locked(scop.owns()) + { mp_mutex = scop.release(); } + + //!Effects: If upgr.owns() then calls unlock_upgradable_and_lock() on the + //! referenced mutex. upgr.release() is called. + //!Postconditions: mutex() == the value upgr.mutex() had before the construction. + //! upgr.mutex() == 0. owns() == upgr.owns() before the construction. + //! upgr.owns() == false after the construction. + //!Notes: If upgr is locked, this constructor will lock this scoped_lock while + //! unlocking upgr. If upgr is unlocked, then this scoped_lock will be + //! unlocked as well. Only a moved upgradable_lock's will match this + //! signature. An non-moved upgradable_lock can be moved with + //! the expression: "autoboost::move(lock);" This constructor may block if + //! other threads hold a sharable_lock on this mutex (sharable_lock's can + //! share ownership with an upgradable_lock). + template + explicit scoped_lock(AUTOBOOST_RV_REF(upgradable_lock) upgr + , typename ipcdetail::enable_if< ipcdetail::is_same >::type * = 0) + : mp_mutex(0), m_locked(false) + { + upgradable_lock &u_lock = upgr; + if(u_lock.owns()){ + u_lock.mutex()->unlock_upgradable_and_lock(); + m_locked = true; + } + mp_mutex = u_lock.release(); + } + + //!Effects: If upgr.owns() then calls try_unlock_upgradable_and_lock() on the + //!referenced mutex: + //! a)if try_unlock_upgradable_and_lock() returns true then mutex() obtains + //! the value from upgr.release() and owns() is set to true. + //! b)if try_unlock_upgradable_and_lock() returns false then upgr is + //! unaffected and this scoped_lock construction as the same effects as + //! a default construction. + //! c)Else upgr.owns() is false. mutex() obtains the value from upgr.release() + //! and owns() is set to false + //!Notes: This construction will not block. It will try to obtain mutex + //! ownership from upgr immediately, while changing the lock type from a + //! "read lock" to a "write lock". If the "read lock" isn't held in the + //! first place, the mutex merely changes type to an unlocked "write lock". + //! If the "read lock" is held, then mutex transfer occurs only if it can + //! do so in a non-blocking manner. + template + scoped_lock(AUTOBOOST_RV_REF(upgradable_lock) upgr, try_to_lock_type + , typename ipcdetail::enable_if< ipcdetail::is_same >::type * = 0) + : mp_mutex(0), m_locked(false) + { + upgradable_lock &u_lock = upgr; + if(u_lock.owns()){ + if((m_locked = u_lock.mutex()->try_unlock_upgradable_and_lock()) == true){ + mp_mutex = u_lock.release(); + } + } + else{ + u_lock.release(); + } + } + + //!Effects: If upgr.owns() then calls timed_unlock_upgradable_and_lock(abs_time) + //! on the referenced mutex: + //! a)if timed_unlock_upgradable_and_lock(abs_time) returns true then mutex() + //! obtains the value from upgr.release() and owns() is set to true. + //! b)if timed_unlock_upgradable_and_lock(abs_time) returns false then upgr + //! is unaffected and this scoped_lock construction as the same effects + //! as a default construction. + //! c)Else upgr.owns() is false. mutex() obtains the value from upgr.release() + //! and owns() is set to false + //!Notes: This construction will not block. It will try to obtain mutex ownership + //! from upgr immediately, while changing the lock type from a "read lock" to a + //! "write lock". If the "read lock" isn't held in the first place, the mutex + //! merely changes type to an unlocked "write lock". If the "read lock" is held, + //! then mutex transfer occurs only if it can do so in a non-blocking manner. + template + scoped_lock(AUTOBOOST_RV_REF(upgradable_lock) upgr, autoboost::posix_time::ptime &abs_time + , typename ipcdetail::enable_if< ipcdetail::is_same >::type * = 0) + : mp_mutex(0), m_locked(false) + { + upgradable_lock &u_lock = upgr; + if(u_lock.owns()){ + if((m_locked = u_lock.mutex()->timed_unlock_upgradable_and_lock(abs_time)) == true){ + mp_mutex = u_lock.release(); + } + } + else{ + u_lock.release(); + } + } + + //!Effects: If shar.owns() then calls try_unlock_sharable_and_lock() on the + //!referenced mutex. + //! a)if try_unlock_sharable_and_lock() returns true then mutex() obtains + //! the value from shar.release() and owns() is set to true. + //! b)if try_unlock_sharable_and_lock() returns false then shar is + //! unaffected and this scoped_lock construction has the same + //! effects as a default construction. + //! c)Else shar.owns() is false. mutex() obtains the value from + //! shar.release() and owns() is set to false + //!Notes: This construction will not block. It will try to obtain mutex + //! ownership from shar immediately, while changing the lock type from a + //! "read lock" to a "write lock". If the "read lock" isn't held in the + //! first place, the mutex merely changes type to an unlocked "write lock". + //! If the "read lock" is held, then mutex transfer occurs only if it can + //! do so in a non-blocking manner. + template + scoped_lock(AUTOBOOST_RV_REF(sharable_lock) shar, try_to_lock_type + , typename ipcdetail::enable_if< ipcdetail::is_same >::type * = 0) + : mp_mutex(0), m_locked(false) + { + sharable_lock &s_lock = shar; + if(s_lock.owns()){ + if((m_locked = s_lock.mutex()->try_unlock_sharable_and_lock()) == true){ + mp_mutex = s_lock.release(); + } + } + else{ + s_lock.release(); + } + } + + //!Effects: if (owns()) mp_mutex->unlock(). + //!Notes: The destructor behavior ensures that the mutex lock is not leaked.*/ + ~scoped_lock() + { + try{ if(m_locked && mp_mutex) mp_mutex->unlock(); } + catch(...){} + } + + //!Effects: If owns() before the call, then unlock() is called on mutex(). + //! *this gets the state of scop and scop gets set to a default constructed state. + //!Notes: With a recursive mutex it is possible that both this and scop own + //! the same mutex before the assignment. In this case, this will own the + //! mutex after the assignment (and scop will not), but the mutex's lock + //! count will be decremented by one. + scoped_lock &operator=(AUTOBOOST_RV_REF(scoped_lock) scop) + { + if(this->owns()) + this->unlock(); + m_locked = scop.owns(); + mp_mutex = scop.release(); + return *this; + } + + //!Effects: If mutex() == 0 or if already locked, throws a lock_exception() + //! exception. Calls lock() on the referenced mutex. + //!Postconditions: owns() == true. + //!Notes: The scoped_lock changes from a state of not owning the mutex, to + //! owning the mutex, blocking if necessary. + void lock() + { + if(!mp_mutex || m_locked) + throw lock_exception(); + mp_mutex->lock(); + m_locked = true; + } + + //!Effects: If mutex() == 0 or if already locked, throws a lock_exception() + //! exception. Calls try_lock() on the referenced mutex. + //!Postconditions: owns() == the value returned from mutex()->try_lock(). + //!Notes: The scoped_lock changes from a state of not owning the mutex, to + //! owning the mutex, but only if blocking was not required. If the + //! mutex_type does not support try_lock(), this function will fail at + //! compile time if instantiated, but otherwise have no effect.*/ + bool try_lock() + { + if(!mp_mutex || m_locked) + throw lock_exception(); + m_locked = mp_mutex->try_lock(); + return m_locked; + } + + //!Effects: If mutex() == 0 or if already locked, throws a lock_exception() + //! exception. Calls timed_lock(abs_time) on the referenced mutex. + //!Postconditions: owns() == the value returned from mutex()-> timed_lock(abs_time). + //!Notes: The scoped_lock changes from a state of not owning the mutex, to + //! owning the mutex, but only if it can obtain ownership by the specified + //! time. If the mutex_type does not support timed_lock (), this function + //! will fail at compile time if instantiated, but otherwise have no effect.*/ + bool timed_lock(const autoboost::posix_time::ptime& abs_time) + { + if(!mp_mutex || m_locked) + throw lock_exception(); + m_locked = mp_mutex->timed_lock(abs_time); + return m_locked; + } + + //!Effects: If mutex() == 0 or if not locked, throws a lock_exception() + //! exception. Calls unlock() on the referenced mutex. + //!Postconditions: owns() == false. + //!Notes: The scoped_lock changes from a state of owning the mutex, to not + //! owning the mutex.*/ + void unlock() + { + if(!mp_mutex || !m_locked) + throw lock_exception(); + mp_mutex->unlock(); + m_locked = false; + } + + //!Effects: Returns true if this scoped_lock has acquired + //!the referenced mutex. + bool owns() const + { return m_locked && mp_mutex; } + + //!Conversion to bool. + //!Returns owns(). + operator unspecified_bool_type() const + { return m_locked? &this_type::m_locked : 0; } + + //!Effects: Returns a pointer to the referenced mutex, or 0 if + //!there is no mutex to reference. + mutex_type* mutex() const + { return mp_mutex; } + + //!Effects: Returns a pointer to the referenced mutex, or 0 if there is no + //! mutex to reference. + //!Postconditions: mutex() == 0 and owns() == false. + mutex_type* release() + { + mutex_type *mut = mp_mutex; + mp_mutex = 0; + m_locked = false; + return mut; + } + + //!Effects: Swaps state with moved lock. + //!Throws: Nothing. + void swap( scoped_lock &other) + { + std::swap(mp_mutex, other.mp_mutex); + std::swap(m_locked, other.m_locked); + } + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + private: + mutex_type *mp_mutex; + bool m_locked; + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED +}; + +} // namespace interprocess +} // namespace autoboost + +#include + +#endif // AUTOBOOST_INTERPROCESS_SCOPED_LOCK_HPP diff --git a/contrib/autoboost/autoboost/interprocess/sync/spin/mutex.hpp b/contrib/autoboost/autoboost/interprocess/sync/spin/mutex.hpp new file mode 100644 index 000000000..022e21a23 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/spin/mutex.hpp @@ -0,0 +1,83 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_SPIN_MUTEX_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_SPIN_MUTEX_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +class spin_mutex +{ + spin_mutex(const spin_mutex &); + spin_mutex &operator=(const spin_mutex &); + public: + + spin_mutex(); + ~spin_mutex(); + + void lock(); + bool try_lock(); + bool timed_lock(const autoboost::posix_time::ptime &abs_time); + void unlock(); + void take_ownership(){}; + private: + volatile autoboost::uint32_t m_s; +}; + +inline spin_mutex::spin_mutex() + : m_s(0) +{ + //Note that this class is initialized to zero. + //So zeroed memory can be interpreted as an + //initialized mutex +} + +inline spin_mutex::~spin_mutex() +{ + //Trivial destructor +} + +inline void spin_mutex::lock(void) +{ return ipcdetail::try_based_lock(*this); } + +inline bool spin_mutex::try_lock(void) +{ + autoboost::uint32_t prev_s = ipcdetail::atomic_cas32(const_cast(&m_s), 1, 0); + return m_s == 1 && prev_s == 0; +} + +inline bool spin_mutex::timed_lock(const autoboost::posix_time::ptime &abs_time) +{ return ipcdetail::try_based_timed_lock(*this, abs_time); } + +inline void spin_mutex::unlock(void) +{ ipcdetail::atomic_cas32(const_cast(&m_s), 0, 1); } + +} //namespace ipcdetail { +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_DETAIL_SPIN_MUTEX_HPP diff --git a/contrib/autoboost/autoboost/interprocess/sync/spin/wait.hpp b/contrib/autoboost/autoboost/interprocess/sync/spin/wait.hpp new file mode 100644 index 000000000..012a671ed --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/spin/wait.hpp @@ -0,0 +1,181 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Peter Dimov 2008. +// (C) Copyright Ion Gaztanaga 2013-2013. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +//Parts of this file come from boost/smart_ptr/detail/yield_k.hpp +//Many thanks to Peter Dimov. + +#ifndef AUTOBOOST_INTERPROCESS_SYNC_WAIT_HPP_INCLUDED +#define AUTOBOOST_INTERPROCESS_SYNC_WAIT_HPP_INCLUDED + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include + +//#define AUTOBOOST_INTERPROCESS_SPIN_WAIT_DEBUG +#ifdef AUTOBOOST_INTERPROCESS_SPIN_WAIT_DEBUG +#include +#endif + +// AUTOBOOST_INTERPROCESS_SMT_PAUSE + +#if defined(_MSC_VER) && ( defined(_M_IX86) || defined(_M_X64) ) + +extern "C" void _mm_pause(); +#pragma intrinsic( _mm_pause ) + +#define AUTOBOOST_INTERPROCESS_SMT_PAUSE _mm_pause(); + +#elif defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) ) && !defined(_CRAYC) + +#define AUTOBOOST_INTERPROCESS_SMT_PAUSE __asm__ __volatile__( "rep; nop" : : : "memory" ); + +#endif + +namespace autoboost{ +namespace interprocess{ +namespace ipcdetail { + +template +class num_core_holder +{ + public: + static unsigned int get() + { + if(!num_cores){ + return ipcdetail::get_num_cores(); + } + else{ + return num_cores; + } + } + + private: + static unsigned int num_cores; +}; + +template +unsigned int num_core_holder::num_cores = ipcdetail::get_num_cores(); + +} //namespace ipcdetail { + +class spin_wait +{ + public: + + static const unsigned int nop_pause_limit = 32u; + spin_wait() + : m_count_start(), m_ul_yield_only_counts(), m_k() + {} + + #ifdef AUTOBOOST_INTERPROCESS_SPIN_WAIT_DEBUG + ~spin_wait() + { + if(m_k){ + std::cout << "final m_k: " << m_k + << " system tick(us): " << ipcdetail::get_system_tick_us() << std::endl; + } + } + #endif + + unsigned int count() const + { return m_k; } + + void yield() + { + //Lazy initialization of limits + if( !m_k){ + this->init_limits(); + } + //Nop tries + if( m_k < (nop_pause_limit >> 2) ){ + + } + //Pause tries if the processor supports it + #if defined(AUTOBOOST_INTERPROCESS_SMT_PAUSE) + else if( m_k < nop_pause_limit ){ + AUTOBOOST_INTERPROCESS_SMT_PAUSE + } + #endif + //Yield/Sleep strategy + else{ + //Lazy initialization of tick information + if(m_k == nop_pause_limit){ + this->init_tick_info(); + } + else if( this->yield_or_sleep() ){ + ipcdetail::thread_yield(); + } + else{ + ipcdetail::thread_sleep_tick(); + } + } + ++m_k; + } + + void reset() + { + m_k = 0u; + } + + private: + + void init_limits() + { + unsigned int num_cores = ipcdetail::num_core_holder<0>::get(); + m_k = num_cores > 1u ? 0u : nop_pause_limit; + } + + void init_tick_info() + { + m_ul_yield_only_counts = ipcdetail::get_system_tick_in_highres_counts(); + m_count_start = ipcdetail::get_current_system_highres_count(); + } + + //Returns true if yield must be called, false is sleep must be called + bool yield_or_sleep() + { + if(!m_ul_yield_only_counts){ //If yield-only limit was reached then yield one in every two tries + return (m_k & 1u) != 0; + } + else{ //Try to see if we've reched yield-only time limit + const ipcdetail::OS_highres_count_t now = ipcdetail::get_current_system_highres_count(); + const ipcdetail::OS_highres_count_t elapsed = ipcdetail::system_highres_count_subtract(now, m_count_start); + if(!ipcdetail::system_highres_count_less_ul(elapsed, m_ul_yield_only_counts)){ + #ifdef AUTOBOOST_INTERPROCESS_SPIN_WAIT_DEBUG + std::cout << "elapsed!\n" + << " m_ul_yield_only_counts: " << m_ul_yield_only_counts + << " system tick(us): " << ipcdetail::get_system_tick_us() << '\n' + << " m_k: " << m_k << " elapsed counts: "; + ipcdetail::ostream_highres_count(std::cout, elapsed) << std::endl; + #endif + //Yield-only time reached, now it's time to sleep + m_ul_yield_only_counts = 0ul; + return false; + } + } + return true; //Otherwise yield + } + + ipcdetail::OS_highres_count_t m_count_start; + unsigned long m_ul_yield_only_counts; + unsigned int m_k; +}; + +} // namespace interprocess +} // namespace autoboost + +#include + +#endif // #ifndef AUTOBOOST_INTERPROCESS_SYNC_WAIT_HPP_INCLUDED diff --git a/contrib/autoboost/autoboost/interprocess/sync/windows/sync_utils.hpp b/contrib/autoboost/autoboost/interprocess/sync/windows/sync_utils.hpp new file mode 100644 index 000000000..aa5eefb81 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/windows/sync_utils.hpp @@ -0,0 +1,236 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2005-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_SYNC_UTILS_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_SYNC_UTILS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +//Shield against external warnings +#include + #include +#include + + +#include +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +inline bool bytes_to_str(const void *mem, const std::size_t mem_length, char *out_str, std::size_t &out_length) +{ + const std::size_t need_mem = mem_length*2+1; + if(out_length < need_mem){ + out_length = need_mem; + return false; + } + + const char Characters [] = + { '0', '1', '2', '3', '4', '5', '6', '7' + , '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + std::size_t char_counter = 0; + const char *buf = (const char *)mem; + for(std::size_t i = 0; i != mem_length; ++i){ + out_str[char_counter++] = Characters[(buf[i]&0xF0)>>4]; + out_str[char_counter++] = Characters[(buf[i]&0x0F)]; + } + out_str[char_counter] = 0; + return true; +} + +class sync_id +{ + public: + typedef __int64 internal_type; + sync_id(const void *map_addr) + : map_addr_(map_addr) + { winapi::query_performance_counter(&rand_); } + + explicit sync_id(internal_type val, const void *map_addr) + : map_addr_(map_addr) + { rand_ = val; } + + const internal_type &internal_pod() const + { return rand_; } + + internal_type &internal_pod() + { return rand_; } + + const void *map_address() const + { return map_addr_; } + + friend std::size_t hash_value(const sync_id &m) + { return autoboost::hash_value(m.rand_); } + + friend bool operator==(const sync_id &l, const sync_id &r) + { return l.rand_ == r.rand_ && l.map_addr_ == r.map_addr_; } + + private: + internal_type rand_; + const void * const map_addr_; +}; + +class sync_handles +{ + public: + enum type { MUTEX, SEMAPHORE }; + + private: + struct address_less + { + bool operator()(sync_id const * const l, sync_id const * const r) const + { return l->map_address() < r->map_address(); } + }; + + typedef autoboost::unordered_map umap_type; + typedef autoboost::container::map map_type; + static const std::size_t LengthOfGlobal = sizeof("Global\\boost.ipc")-1; + static const std::size_t StrSize = LengthOfGlobal + (sizeof(sync_id)*2+1); + typedef char NameBuf[StrSize]; + + + void fill_name(NameBuf &name, const sync_id &id) + { + const char *n = "Global\\boost.ipc"; + std::size_t i = 0; + do{ + name[i] = n[i]; + ++i; + } while(n[i]); + std::size_t len = sizeof(NameBuf) - LengthOfGlobal; + bytes_to_str(&id.internal_pod(), sizeof(id.internal_pod()), &name[LengthOfGlobal], len); + } + + void throw_if_error(void *hnd_val) + { + if(!hnd_val){ + error_info err(winapi::get_last_error()); + throw interprocess_exception(err); + } + } + + void* open_or_create_semaphore(const sync_id &id, unsigned int initial_count) + { + NameBuf name; + fill_name(name, id); + permissions unrestricted_security; + unrestricted_security.set_unrestricted(); + winapi_semaphore_wrapper sem_wrapper; + bool created; + sem_wrapper.open_or_create + (name, (long)initial_count, winapi_semaphore_wrapper::MaxCount, unrestricted_security, created); + throw_if_error(sem_wrapper.handle()); + return sem_wrapper.release(); + } + + void* open_or_create_mutex(const sync_id &id) + { + NameBuf name; + fill_name(name, id); + permissions unrestricted_security; + unrestricted_security.set_unrestricted(); + winapi_mutex_wrapper mtx_wrapper; + mtx_wrapper.open_or_create(name, unrestricted_security); + throw_if_error(mtx_wrapper.handle()); + return mtx_wrapper.release(); + } + + public: + void *obtain_mutex(const sync_id &id, bool *popen_created = 0) + { + umap_type::value_type v(id, (void*)0); + scoped_lock lock(mtx_); + umap_type::iterator it = umap_.insert(v).first; + void *&hnd_val = it->second; + if(!hnd_val){ + map_[&it->first] = it; + hnd_val = open_or_create_mutex(id); + if(popen_created) *popen_created = true; + } + else if(popen_created){ + *popen_created = false; + } + return hnd_val; + } + + void *obtain_semaphore(const sync_id &id, unsigned int initial_count, bool *popen_created = 0) + { + umap_type::value_type v(id, (void*)0); + scoped_lock lock(mtx_); + umap_type::iterator it = umap_.insert(v).first; + void *&hnd_val = it->second; + if(!hnd_val){ + map_[&it->first] = it; + hnd_val = open_or_create_semaphore(id, initial_count); + if(popen_created) *popen_created = true; + } + else if(popen_created){ + *popen_created = false; + } + return hnd_val; + } + + void destroy_handle(const sync_id &id) + { + scoped_lock lock(mtx_); + umap_type::iterator it = umap_.find(id); + umap_type::iterator itend = umap_.end(); + + if(it != itend){ + winapi::close_handle(it->second); + const map_type::key_type &k = &it->first; + map_.erase(k); + umap_.erase(it); + } + } + + void destroy_syncs_in_range(const void *addr, std::size_t size) + { + const sync_id low_id(addr); + const sync_id hig_id(static_cast(addr)+size); + scoped_lock lock(mtx_); + map_type::iterator itlow(map_.lower_bound(&low_id)), + ithig(map_.lower_bound(&hig_id)); + while(itlow != ithig){ + void * const hnd = umap_[*itlow->first]; + winapi::close_handle(hnd); + umap_.erase(*itlow->first); + itlow = map_.erase(itlow); + } + } + + private: + spin_mutex mtx_; + umap_type umap_; + map_type map_; +}; + + +} //namespace ipcdetail { +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_DETAIL_SYNC_UTILS_HPP diff --git a/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_mutex_wrapper.hpp b/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_mutex_wrapper.hpp new file mode 100644 index 000000000..c772024e5 --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_mutex_wrapper.hpp @@ -0,0 +1,130 @@ + ////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2011-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_MUTEX_WRAPPER_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_MUTEX_WRAPPER_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +class winapi_mutex_functions +{ + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + + //Non-copyable + winapi_mutex_functions(const winapi_mutex_functions &); + winapi_mutex_functions &operator=(const winapi_mutex_functions &); + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + public: + winapi_mutex_functions(void *mtx_hnd) + : m_mtx_hnd(mtx_hnd) + {} + + void unlock() + { winapi::release_mutex(m_mtx_hnd); } + + void lock() + { return winapi_wrapper_wait_for_single_object(m_mtx_hnd); } + + bool try_lock() + { return winapi_wrapper_try_wait_for_single_object(m_mtx_hnd); } + + bool timed_lock(const autoboost::posix_time::ptime &abs_time) + { return winapi_wrapper_timed_wait_for_single_object(m_mtx_hnd, abs_time); } + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + protected: + void *m_mtx_hnd; + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED +}; + +//Swappable mutex wrapper +class winapi_mutex_wrapper + : public winapi_mutex_functions +{ + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + + //Non-copyable + winapi_mutex_wrapper(const winapi_mutex_wrapper &); + winapi_mutex_wrapper &operator=(const winapi_mutex_wrapper &); + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + //Note that Windows API does not return winapi::invalid_handle_value + //when failing to create/open a mutex, but a nullptr + + public: + winapi_mutex_wrapper(void *mtx_hnd = 0) + : winapi_mutex_functions(mtx_hnd) + {} + + ~winapi_mutex_wrapper() + { this->close(); } + + void *release() + { + void *hnd = m_mtx_hnd; + m_mtx_hnd = 0; + return hnd; + } + + void *handle() const + { return m_mtx_hnd; } + + bool open_or_create(const char *name, const permissions &perm) + { + if(m_mtx_hnd == 0){ + m_mtx_hnd = winapi::open_or_create_mutex + ( name + , false + , (winapi::interprocess_security_attributes*)perm.get_permissions() + ); + return m_mtx_hnd != 0; + } + else{ + return false; + } + } + + void close() + { + if(m_mtx_hnd != 0){ + winapi::close_handle(m_mtx_hnd); + m_mtx_hnd = 0; + } + } + + void swap(winapi_mutex_wrapper &other) + { void *tmp = m_mtx_hnd; m_mtx_hnd = other.m_mtx_hnd; other.m_mtx_hnd = tmp; } +}; + +} //namespace ipcdetail { +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_MUTEX_WRAPPER_HPP diff --git a/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp b/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp new file mode 100644 index 000000000..120a4afab --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp @@ -0,0 +1,164 @@ + ////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2011-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_SEMAPHORE_WRAPPER_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_SEMAPHORE_WRAPPER_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +class winapi_semaphore_functions +{ + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + + //Non-copyable + winapi_semaphore_functions(const winapi_semaphore_functions &); + winapi_semaphore_functions &operator=(const winapi_semaphore_functions &); + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED + + public: + winapi_semaphore_functions(void *hnd) + : m_sem_hnd(hnd) + {} + + void post(long count = 1) + { + long prev_count; + winapi::release_semaphore(m_sem_hnd, count, &prev_count); + } + + void wait() + { return winapi_wrapper_wait_for_single_object(m_sem_hnd); } + + bool try_wait() + { return winapi_wrapper_try_wait_for_single_object(m_sem_hnd); } + + bool timed_wait(const autoboost::posix_time::ptime &abs_time) + { return winapi_wrapper_timed_wait_for_single_object(m_sem_hnd, abs_time); } + + long value() const + { + long l_count, l_limit; + if(!winapi::get_semaphore_info(m_sem_hnd, l_count, l_limit)) + return 0; + return l_count; + } + + long limit() const + { + long l_count, l_limit; + if(!winapi::get_semaphore_info(m_sem_hnd, l_count, l_limit)) + return 0; + return l_limit; + } + + #if !defined(AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED) + protected: + void *m_sem_hnd; + #endif //#ifndef AUTOBOOST_INTERPROCESS_DOXYGEN_INVOKED +}; + + +//Swappable semaphore wrapper +class winapi_semaphore_wrapper + : public winapi_semaphore_functions +{ + winapi_semaphore_wrapper(const winapi_semaphore_wrapper &); + winapi_semaphore_wrapper &operator=(const winapi_semaphore_wrapper &); + + public: + + //Long is 32 bits in windows + static const long MaxCount = long(0x7FFFFFFF); + + winapi_semaphore_wrapper(void *hnd = winapi::invalid_handle_value) + : winapi_semaphore_functions(hnd) + {} + + ~winapi_semaphore_wrapper() + { this->close(); } + + void *release() + { + void *hnd = m_sem_hnd; + m_sem_hnd = winapi::invalid_handle_value; + return hnd; + } + + void *handle() const + { return m_sem_hnd; } + + bool open_or_create( const char *name + , long sem_count + , long max_count + , const permissions &perm + , bool &created) + { + if(m_sem_hnd == winapi::invalid_handle_value){ + m_sem_hnd = winapi::open_or_create_semaphore + ( name + , sem_count + , max_count + , (winapi::interprocess_security_attributes*)perm.get_permissions() + ); + created = winapi::get_last_error() != winapi::error_already_exists; + return m_sem_hnd != winapi::invalid_handle_value; + } + else{ + return false; + } + } + + bool open_semaphore(const char *name) + { + if(m_sem_hnd == winapi::invalid_handle_value){ + m_sem_hnd = winapi::open_semaphore(name); + return m_sem_hnd != winapi::invalid_handle_value; + } + else{ + return false; + } + } + + void close() + { + if(m_sem_hnd != winapi::invalid_handle_value){ + winapi::close_handle(m_sem_hnd); + m_sem_hnd = winapi::invalid_handle_value; + } + } + + void swap(winapi_semaphore_wrapper &other) + { void *tmp = m_sem_hnd; m_sem_hnd = other.m_sem_hnd; other.m_sem_hnd = tmp; } +}; + +} //namespace ipcdetail { +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_SEMAPHORE_WRAPPER_HPP diff --git a/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_wrapper_common.hpp b/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_wrapper_common.hpp new file mode 100644 index 000000000..23ed598af --- /dev/null +++ b/contrib/autoboost/autoboost/interprocess/sync/windows/winapi_wrapper_common.hpp @@ -0,0 +1,93 @@ + ////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2011-2012. 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/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_WRAPPER_COMMON_HPP +#define AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_WRAPPER_COMMON_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace interprocess { +namespace ipcdetail { + +inline void winapi_wrapper_wait_for_single_object(void *handle) +{ + unsigned long ret = winapi::wait_for_single_object(handle, winapi::infinite_time); + if(ret != winapi::wait_object_0){ + if(ret != winapi::wait_abandoned){ + error_info err = system_error_code(); + throw interprocess_exception(err); + } + else{ //Special case for orphaned mutexes + winapi::release_mutex(handle); + throw interprocess_exception(owner_dead_error); + } + } +} + +inline bool winapi_wrapper_try_wait_for_single_object(void *handle) +{ + unsigned long ret = winapi::wait_for_single_object(handle, 0); + if(ret == winapi::wait_object_0){ + return true; + } + else if(ret == winapi::wait_timeout){ + return false; + } + else{ + error_info err = system_error_code(); + throw interprocess_exception(err); + } +} + +inline bool winapi_wrapper_timed_wait_for_single_object(void *handle, const autoboost::posix_time::ptime &abs_time) +{ + //Windows does not support infinity abs_time so check it + if(abs_time == autoboost::posix_time::pos_infin){ + winapi_wrapper_wait_for_single_object(handle); + return true; + } + const autoboost::posix_time::ptime cur_time = microsec_clock::universal_time(); + //Windows uses relative wait times so check for negative waits + //and implement as 0 wait to allow try-semantics as POSIX mandates. + unsigned long ret = winapi::wait_for_single_object + ( handle + , (abs_time <= cur_time) ? 0u + : (abs_time - cur_time).total_milliseconds() + ); + if(ret == winapi::wait_object_0){ + return true; + } + else if(ret == winapi::wait_timeout){ + return false; + } + else{ + error_info err = system_error_code(); + throw interprocess_exception(err); + } +} + +} //namespace ipcdetail { +} //namespace interprocess { +} //namespace autoboost { + +#include + +#endif //AUTOBOOST_INTERPROCESS_DETAIL_WINAPI_MUTEX_WRAPPER_HPP diff --git a/contrib/autoboost/autoboost/intrusive/avl_set_hook.hpp b/contrib/autoboost/autoboost/intrusive/avl_set_hook.hpp new file mode 100644 index 000000000..fdfe4f291 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/avl_set_hook.hpp @@ -0,0 +1,291 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2007-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_AVL_SET_HOOK_HPP +#define AUTOBOOST_INTRUSIVE_AVL_SET_HOOK_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { + +//! Helper metafunction to define a \c avl_set_base_hook that yields to the same +//! type when the same options (either explicitly or implicitly) are used. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +struct make_avl_set_base_hook +{ + /// @cond + typedef typename pack_options + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + + #else + + #endif + ::type packed_options; + + typedef generic_hook + < avltree_algorithms > + , typename packed_options::tag + , packed_options::link_mode + , AvlTreeBaseHookId + > implementation_defined; + /// @endcond + typedef implementation_defined type; +}; + +//! Derive a class from avl_set_base_hook in order to store objects in +//! in an avl_set/avl_multiset. avl_set_base_hook holds the data necessary to maintain +//! the avl_set/avl_multiset and provides an appropriate value_traits class for avl_set/avl_multiset. +//! +//! The hook admits the following options: \c tag<>, \c void_pointer<>, +//! \c link_mode<> and \c optimize_size<>. +//! +//! \c tag<> defines a tag to identify the node. +//! The same tag value can be used in different classes, but if a class is +//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its +//! unique tag. +//! +//! \c void_pointer<> is the pointer type that will be used internally in the hook +//! and the container configured to use this hook. +//! +//! \c link_mode<> will specify the linking mode of the hook (\c normal_link, +//! \c auto_unlink or \c safe_link). +//! +//! \c optimize_size<> will tell the hook to optimize the hook for size instead +//! of speed. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +class avl_set_base_hook + : public make_avl_set_base_hook + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + + #else + + #endif + ::type +{ + #if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + public: + //! Effects: If link_mode is \c auto_unlink or \c safe_link + //! initializes the node to an unlinked state. + //! + //! Throws: Nothing. + avl_set_base_hook(); + + //! Effects: If link_mode is \c auto_unlink or \c safe_link + //! initializes the node to an unlinked state. The argument is ignored. + //! + //! Throws: Nothing. + //! + //! Rationale: Providing a copy-constructor + //! makes classes using the hook STL-compliant without forcing the + //! user to do some additional work. \c swap can be used to emulate + //! move-semantics. + avl_set_base_hook(const avl_set_base_hook& ); + + //! Effects: Empty function. The argument is ignored. + //! + //! Throws: Nothing. + //! + //! Rationale: Providing an assignment operator + //! makes classes using the hook STL-compliant without forcing the + //! user to do some additional work. \c swap can be used to emulate + //! move-semantics. + avl_set_base_hook& operator=(const avl_set_base_hook& ); + + //! Effects: If link_mode is \c normal_link, the destructor does + //! nothing (ie. no code is generated). If link_mode is \c safe_link and the + //! object is stored in a set an assertion is raised. If link_mode is + //! \c auto_unlink and \c is_linked() is true, the node is unlinked. + //! + //! Throws: Nothing. + ~avl_set_base_hook(); + + //! Effects: Swapping two nodes swaps the position of the elements + //! related to those nodes in one or two containers. That is, if the node + //! this is part of the element e1, the node x is part of the element e2 + //! and both elements are included in the containers s1 and s2, then after + //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 + //! at the position of e1. If one element is not in a container, then + //! after the swap-operation the other element is not in a container. + //! Iterators to e1 and e2 related to those nodes are invalidated. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + void swap_nodes(avl_set_base_hook &other); + + //! Precondition: link_mode must be \c safe_link or \c auto_unlink. + //! + //! Returns: true, if the node belongs to a container, false + //! otherwise. This function can be used to test whether \c set::iterator_to + //! will return a valid iterator. + //! + //! Complexity: Constant + bool is_linked() const; + + //! Effects: Removes the node if it's inserted in a container. + //! This function is only allowed if link_mode is \c auto_unlink. + //! + //! Throws: Nothing. + void unlink(); + #endif +}; + +//! Helper metafunction to define a \c avl_set_member_hook that yields to the same +//! type when the same options (either explicitly or implicitly) are used. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +struct make_avl_set_member_hook +{ + /// @cond + typedef typename pack_options + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + + #else + + #endif + ::type packed_options; + + typedef generic_hook + < avltree_algorithms > + , member_tag + , packed_options::link_mode + , NoBaseHookId + > implementation_defined; + /// @endcond + typedef implementation_defined type; +}; + +//! Put a public data member avl_set_member_hook in order to store objects of this class in +//! an avl_set/avl_multiset. avl_set_member_hook holds the data necessary for maintaining the +//! avl_set/avl_multiset and provides an appropriate value_traits class for avl_set/avl_multiset. +//! +//! The hook admits the following options: \c void_pointer<>, +//! \c link_mode<> and \c optimize_size<>. +//! +//! \c void_pointer<> is the pointer type that will be used internally in the hook +//! and the container configured to use this hook. +//! +//! \c link_mode<> will specify the linking mode of the hook (\c normal_link, +//! \c auto_unlink or \c safe_link). +//! +//! \c optimize_size<> will tell the hook to optimize the hook for size instead +//! of speed. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +class avl_set_member_hook + : public make_avl_set_member_hook + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + + #else + + #endif + ::type +{ + #if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + public: + //! Effects: If link_mode is \c auto_unlink or \c safe_link + //! initializes the node to an unlinked state. + //! + //! Throws: Nothing. + avl_set_member_hook(); + + //! Effects: If link_mode is \c auto_unlink or \c safe_link + //! initializes the node to an unlinked state. The argument is ignored. + //! + //! Throws: Nothing. + //! + //! Rationale: Providing a copy-constructor + //! makes classes using the hook STL-compliant without forcing the + //! user to do some additional work. \c swap can be used to emulate + //! move-semantics. + avl_set_member_hook(const avl_set_member_hook& ); + + //! Effects: Empty function. The argument is ignored. + //! + //! Throws: Nothing. + //! + //! Rationale: Providing an assignment operator + //! makes classes using the hook STL-compliant without forcing the + //! user to do some additional work. \c swap can be used to emulate + //! move-semantics. + avl_set_member_hook& operator=(const avl_set_member_hook& ); + + //! Effects: If link_mode is \c normal_link, the destructor does + //! nothing (ie. no code is generated). If link_mode is \c safe_link and the + //! object is stored in a set an assertion is raised. If link_mode is + //! \c auto_unlink and \c is_linked() is true, the node is unlinked. + //! + //! Throws: Nothing. + ~avl_set_member_hook(); + + //! Effects: Swapping two nodes swaps the position of the elements + //! related to those nodes in one or two containers. That is, if the node + //! this is part of the element e1, the node x is part of the element e2 + //! and both elements are included in the containers s1 and s2, then after + //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 + //! at the position of e1. If one element is not in a container, then + //! after the swap-operation the other element is not in a container. + //! Iterators to e1 and e2 related to those nodes are invalidated. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + void swap_nodes(avl_set_member_hook &other); + + //! Precondition: link_mode must be \c safe_link or \c auto_unlink. + //! + //! Returns: true, if the node belongs to a container, false + //! otherwise. This function can be used to test whether \c set::iterator_to + //! will return a valid iterator. + //! + //! Complexity: Constant + bool is_linked() const; + + //! Effects: Removes the node if it's inserted in a container. + //! This function is only allowed if link_mode is \c auto_unlink. + //! + //! Throws: Nothing. + void unlink(); + #endif +}; + +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_AVL_SET_HOOK_HPP diff --git a/contrib/autoboost/autoboost/intrusive/avltree.hpp b/contrib/autoboost/autoboost/intrusive/avltree.hpp new file mode 100644 index 000000000..989ecddc9 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/avltree.hpp @@ -0,0 +1,549 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2007-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// +#ifndef AUTOBOOST_INTRUSIVE_AVLTREE_HPP +#define AUTOBOOST_INTRUSIVE_AVLTREE_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { + +/// @cond + +struct default_avltree_hook_applier +{ template struct apply{ typedef typename T::default_avltree_hook type; }; }; + +template<> +struct is_default_hook_tag +{ static const bool value = true; }; + +struct avltree_defaults +{ + typedef default_avltree_hook_applier proto_value_traits; + static const bool constant_time_size = true; + typedef std::size_t size_type; + typedef void compare; + typedef void header_holder_type; +}; + +/// @endcond + +//! The class template avltree is an intrusive AVL tree container, that +//! is used to construct intrusive avl_set and avl_multiset containers. +//! The no-throw guarantee holds only, if the value_compare object +//! doesn't throw. +//! +//! The template parameter \c T is the type to be managed by the container. +//! The user can specify additional options and if no options are provided +//! default options are used. +//! +//! The container supports the following options: +//! \c base_hook<>/member_hook<>/value_traits<>, +//! \c constant_time_size<>, \c size_type<> and +//! \c compare<>. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +class avltree_impl + /// @cond + : public bstree_impl + /// @endcond +{ + public: + typedef ValueTraits value_traits; + /// @cond + typedef bstree_impl< ValueTraits, VoidOrKeyComp, SizeType + , ConstantTimeSize, AvlTreeAlgorithms + , HeaderHolder> tree_type; + typedef tree_type implementation_defined; + /// @endcond + + typedef typename implementation_defined::pointer pointer; + typedef typename implementation_defined::const_pointer const_pointer; + typedef typename implementation_defined::value_type value_type; + typedef typename implementation_defined::key_type key_type; + typedef typename implementation_defined::reference reference; + typedef typename implementation_defined::const_reference const_reference; + typedef typename implementation_defined::difference_type difference_type; + typedef typename implementation_defined::size_type size_type; + typedef typename implementation_defined::value_compare value_compare; + typedef typename implementation_defined::key_compare key_compare; + typedef typename implementation_defined::iterator iterator; + typedef typename implementation_defined::const_iterator const_iterator; + typedef typename implementation_defined::reverse_iterator reverse_iterator; + typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator; + typedef typename implementation_defined::node_traits node_traits; + typedef typename implementation_defined::node node; + typedef typename implementation_defined::node_ptr node_ptr; + typedef typename implementation_defined::const_node_ptr const_node_ptr; + typedef typename implementation_defined::node_algorithms node_algorithms; + + static const bool constant_time_size = implementation_defined::constant_time_size; + /// @cond + private: + + //noncopyable + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(avltree_impl) + + /// @endcond + + public: + + typedef typename implementation_defined::insert_commit_data insert_commit_data; + + + //! @copydoc ::autoboost::intrusive::bstree::bstree(const value_compare &,const value_traits &) + explicit avltree_impl( const value_compare &cmp = value_compare() + , const value_traits &v_traits = value_traits()) + : tree_type(cmp, v_traits) + {} + + //! @copydoc ::autoboost::intrusive::bstree::bstree(bool,Iterator,Iterator,const value_compare &,const value_traits &) + template + avltree_impl( bool unique, Iterator b, Iterator e + , const value_compare &cmp = value_compare() + , const value_traits &v_traits = value_traits()) + : tree_type(unique, b, e, cmp, v_traits) + {} + + //! @copydoc ::autoboost::intrusive::bstree::bstree(bstree &&) + avltree_impl(AUTOBOOST_RV_REF(avltree_impl) x) + : tree_type(::autoboost::move(static_cast(x))) + {} + + //! @copydoc ::autoboost::intrusive::bstree::operator=(bstree &&) + avltree_impl& operator=(AUTOBOOST_RV_REF(avltree_impl) x) + { return static_cast(tree_type::operator=(::autoboost::move(static_cast(x)))); } + + #ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! @copydoc ::autoboost::intrusive::bstree::~bstree() + ~avltree_impl(); + + //! @copydoc ::autoboost::intrusive::bstree::begin() + iterator begin(); + + //! @copydoc ::autoboost::intrusive::bstree::begin()const + const_iterator begin() const; + + //! @copydoc ::autoboost::intrusive::bstree::cbegin()const + const_iterator cbegin() const; + + //! @copydoc ::autoboost::intrusive::bstree::end() + iterator end(); + + //! @copydoc ::autoboost::intrusive::bstree::end()const + const_iterator end() const; + + //! @copydoc ::autoboost::intrusive::bstree::cend()const + const_iterator cend() const; + + //! @copydoc ::autoboost::intrusive::bstree::rbegin() + reverse_iterator rbegin(); + + //! @copydoc ::autoboost::intrusive::bstree::rbegin()const + const_reverse_iterator rbegin() const; + + //! @copydoc ::autoboost::intrusive::bstree::crbegin()const + const_reverse_iterator crbegin() const; + + //! @copydoc ::autoboost::intrusive::bstree::rend() + reverse_iterator rend(); + + //! @copydoc ::autoboost::intrusive::bstree::rend()const + const_reverse_iterator rend() const; + + //! @copydoc ::autoboost::intrusive::bstree::crend()const + const_reverse_iterator crend() const; + + //! @copydoc ::autoboost::intrusive::bstree::container_from_end_iterator(iterator) + static avltree_impl &container_from_end_iterator(iterator end_iterator); + + //! @copydoc ::autoboost::intrusive::bstree::container_from_end_iterator(const_iterator) + static const avltree_impl &container_from_end_iterator(const_iterator end_iterator); + + //! @copydoc ::autoboost::intrusive::bstree::container_from_iterator(iterator) + static avltree_impl &container_from_iterator(iterator it); + + //! @copydoc ::autoboost::intrusive::bstree::container_from_iterator(const_iterator) + static const avltree_impl &container_from_iterator(const_iterator it); + + //! @copydoc ::autoboost::intrusive::bstree::key_comp()const + key_compare key_comp() const; + + //! @copydoc ::autoboost::intrusive::bstree::value_comp()const + value_compare value_comp() const; + + //! @copydoc ::autoboost::intrusive::bstree::empty()const + bool empty() const; + + //! @copydoc ::autoboost::intrusive::bstree::size()const + size_type size() const; + + //! @copydoc ::autoboost::intrusive::bstree::swap + void swap(avltree_impl& other); + + //! @copydoc ::autoboost::intrusive::bstree::clone_from + template + void clone_from(const avltree_impl &src, Cloner cloner, Disposer disposer); + + //! @copydoc ::autoboost::intrusive::bstree::insert_equal(reference) + iterator insert_equal(reference value); + + //! @copydoc ::autoboost::intrusive::bstree::insert_equal(const_iterator,reference) + iterator insert_equal(const_iterator hint, reference value); + + //! @copydoc ::autoboost::intrusive::bstree::insert_equal(Iterator,Iterator) + template + void insert_equal(Iterator b, Iterator e); + + //! @copydoc ::autoboost::intrusive::bstree::insert_unique(reference) + std::pair insert_unique(reference value); + + //! @copydoc ::autoboost::intrusive::bstree::insert_unique(const_iterator,reference) + iterator insert_unique(const_iterator hint, reference value); + + //! @copydoc ::autoboost::intrusive::bstree::insert_unique_check(const KeyType&,KeyValueCompare,insert_commit_data&) + template + std::pair insert_unique_check + (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data); + + //! @copydoc ::autoboost::intrusive::bstree::insert_unique_check(const_iterator,const KeyType&,KeyValueCompare,insert_commit_data&) + template + std::pair insert_unique_check + (const_iterator hint, const KeyType &key + ,KeyValueCompare key_value_comp, insert_commit_data &commit_data); + + //! @copydoc ::autoboost::intrusive::bstree::insert_unique_commit + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data); + + //! @copydoc ::autoboost::intrusive::bstree::insert_unique(Iterator,Iterator) + template + void insert_unique(Iterator b, Iterator e); + + //! @copydoc ::autoboost::intrusive::bstree::insert_before + iterator insert_before(const_iterator pos, reference value); + + //! @copydoc ::autoboost::intrusive::bstree::push_back + void push_back(reference value); + + //! @copydoc ::autoboost::intrusive::bstree::push_front + void push_front(reference value); + + //! @copydoc ::autoboost::intrusive::bstree::erase(const_iterator) + iterator erase(const_iterator i); + + //! @copydoc ::autoboost::intrusive::bstree::erase(const_iterator,const_iterator) + iterator erase(const_iterator b, const_iterator e); + + //! @copydoc ::autoboost::intrusive::bstree::erase(const_reference) + size_type erase(const_reference value); + + //! @copydoc ::autoboost::intrusive::bstree::erase(const KeyType&,KeyValueCompare) + template + size_type erase(const KeyType& key, KeyValueCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer) + template + iterator erase_and_dispose(const_iterator i, Disposer disposer); + + //! @copydoc ::autoboost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer) + template + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + + //! @copydoc ::autoboost::intrusive::bstree::erase_and_dispose(const_reference, Disposer) + template + size_type erase_and_dispose(const_reference value, Disposer disposer); + + //! @copydoc ::autoboost::intrusive::bstree::erase_and_dispose(const KeyType&,KeyValueCompare,Disposer) + template + size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer); + + //! @copydoc ::autoboost::intrusive::bstree::clear + void clear(); + + //! @copydoc ::autoboost::intrusive::bstree::clear_and_dispose + template + void clear_and_dispose(Disposer disposer); + + //! @copydoc ::autoboost::intrusive::bstree::count(const_reference)const + size_type count(const_reference value) const; + + //! @copydoc ::autoboost::intrusive::bstree::count(const KeyType&,KeyValueCompare)const + template + size_type count(const KeyType& key, KeyValueCompare comp) const; + + //! @copydoc ::autoboost::intrusive::bstree::lower_bound(const_reference) + iterator lower_bound(const_reference value); + + //! @copydoc ::autoboost::intrusive::bstree::lower_bound(const KeyType&,KeyValueCompare) + template + iterator lower_bound(const KeyType& key, KeyValueCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree::lower_bound(const_reference)const + const_iterator lower_bound(const_reference value) const; + + //! @copydoc ::autoboost::intrusive::bstree::lower_bound(const KeyType&,KeyValueCompare)const + template + const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const; + + //! @copydoc ::autoboost::intrusive::bstree::upper_bound(const_reference) + iterator upper_bound(const_reference value); + + //! @copydoc ::autoboost::intrusive::bstree::upper_bound(const KeyType&,KeyValueCompare) + template + iterator upper_bound(const KeyType& key, KeyValueCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree::upper_bound(const_reference)const + const_iterator upper_bound(const_reference value) const; + + //! @copydoc ::autoboost::intrusive::bstree::upper_bound(const KeyType&,KeyValueCompare)const + template + const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const; + + //! @copydoc ::autoboost::intrusive::bstree::find(const_reference) + iterator find(const_reference value); + + //! @copydoc ::autoboost::intrusive::bstree::find(const KeyType&,KeyValueCompare) + template + iterator find(const KeyType& key, KeyValueCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree::find(const_reference)const + const_iterator find(const_reference value) const; + + //! @copydoc ::autoboost::intrusive::bstree::find(const KeyType&,KeyValueCompare)const + template + const_iterator find(const KeyType& key, KeyValueCompare comp) const; + + //! @copydoc ::autoboost::intrusive::bstree::equal_range(const_reference) + std::pair equal_range(const_reference value); + + //! @copydoc ::autoboost::intrusive::bstree::equal_range(const KeyType&,KeyValueCompare) + template + std::pair equal_range(const KeyType& key, KeyValueCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree::equal_range(const_reference)const + std::pair + equal_range(const_reference value) const; + + //! @copydoc ::autoboost::intrusive::bstree::equal_range(const KeyType&,KeyValueCompare)const + template + std::pair + equal_range(const KeyType& key, KeyValueCompare comp) const; + + //! @copydoc ::autoboost::intrusive::bstree::bounded_range(const_reference,const_reference,bool,bool) + std::pair bounded_range + (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed); + + //! @copydoc ::autoboost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool) + template + std::pair bounded_range + (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed); + + //! @copydoc ::autoboost::intrusive::bstree::bounded_range(const_reference,const_reference,bool,bool)const + std::pair + bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const; + + //! @copydoc ::autoboost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)const + template + std::pair bounded_range + (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const; + + //! @copydoc ::autoboost::intrusive::bstree::s_iterator_to(reference) + static iterator s_iterator_to(reference value); + + //! @copydoc ::autoboost::intrusive::bstree::s_iterator_to(const_reference) + static const_iterator s_iterator_to(const_reference value); + + //! @copydoc ::autoboost::intrusive::bstree::iterator_to(reference) + iterator iterator_to(reference value); + + //! @copydoc ::autoboost::intrusive::bstree::iterator_to(const_reference)const + const_iterator iterator_to(const_reference value) const; + + //! @copydoc ::autoboost::intrusive::bstree::init_node(reference) + static void init_node(reference value); + + //! @copydoc ::autoboost::intrusive::bstree::unlink_leftmost_without_rebalance + pointer unlink_leftmost_without_rebalance(); + + //! @copydoc ::autoboost::intrusive::bstree::replace_node + void replace_node(iterator replace_this, reference with_this); + + //! @copydoc ::autoboost::intrusive::bstree::remove_node + void remove_node(reference value); + #endif //#ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED +}; + +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + +template +bool operator< (const avltree_impl &x, const avltree_impl &y); + +template +bool operator==(const avltree_impl &x, const avltree_impl &y); + +template +bool operator!= (const avltree_impl &x, const avltree_impl &y); + +template +bool operator>(const avltree_impl &x, const avltree_impl &y); + +template +bool operator<=(const avltree_impl &x, const avltree_impl &y); + +template +bool operator>=(const avltree_impl &x, const avltree_impl &y); + +template +void swap(avltree_impl &x, avltree_impl &y); + +#endif //#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + +//! Helper metafunction to define a \c avltree that yields to the same type when the +//! same options (either explicitly or implicitly) are used. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +struct make_avltree +{ + /// @cond + typedef typename pack_options + < avltree_defaults, + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + O1, O2, O3, O4, O5 + #else + Options... + #endif + >::type packed_options; + + typedef typename detail::get_value_traits + ::type value_traits; + typedef typename detail::get_header_holder_type + < value_traits, typename packed_options::header_holder_type >::type header_holder_type; + + typedef avltree_impl + < value_traits + , typename packed_options::compare + , typename packed_options::size_type + , packed_options::constant_time_size + , header_holder_type + > implementation_defined; + /// @endcond + typedef implementation_defined type; +}; + + +#ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + +#if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +class avltree + : public make_avltree::type +{ + typedef typename make_avltree + ::type Base; + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(avltree) + + public: + typedef typename Base::value_compare value_compare; + typedef typename Base::value_traits value_traits; + typedef typename Base::iterator iterator; + typedef typename Base::const_iterator const_iterator; + typedef typename Base::reverse_iterator reverse_iterator; + typedef typename Base::const_reverse_iterator const_reverse_iterator; + + //Assert if passed value traits are compatible with the type + AUTOBOOST_STATIC_ASSERT((detail::is_same::value)); + + explicit avltree( const value_compare &cmp = value_compare() + , const value_traits &v_traits = value_traits()) + : Base(cmp, v_traits) + {} + + template + avltree( bool unique, Iterator b, Iterator e + , const value_compare &cmp = value_compare() + , const value_traits &v_traits = value_traits()) + : Base(unique, b, e, cmp, v_traits) + {} + + avltree(AUTOBOOST_RV_REF(avltree) x) + : Base(::autoboost::move(static_cast(x))) + {} + + avltree& operator=(AUTOBOOST_RV_REF(avltree) x) + { return static_cast(this->Base::operator=(::autoboost::move(static_cast(x)))); } + + static avltree &container_from_end_iterator(iterator end_iterator) + { return static_cast(Base::container_from_end_iterator(end_iterator)); } + + static const avltree &container_from_end_iterator(const_iterator end_iterator) + { return static_cast(Base::container_from_end_iterator(end_iterator)); } + + static avltree &container_from_iterator(iterator it) + { return static_cast(Base::container_from_iterator(it)); } + + static const avltree &container_from_iterator(const_iterator it) + { return static_cast(Base::container_from_iterator(it)); } +}; + +#endif + +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_AVLTREE_HPP diff --git a/contrib/autoboost/autoboost/intrusive/avltree_algorithms.hpp b/contrib/autoboost/autoboost/intrusive/avltree_algorithms.hpp new file mode 100644 index 000000000..1e3e0db20 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/avltree_algorithms.hpp @@ -0,0 +1,687 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Daniel K. O. 2005. +// (C) Copyright Ion Gaztanaga 2007-2014 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_AVLTREE_ALGORITHMS_HPP +#define AUTOBOOST_INTRUSIVE_AVLTREE_ALGORITHMS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include + +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { + +/// @cond + +template +struct avltree_node_cloner + : private detail::ebo_functor_holder +{ + typedef typename NodeTraits::node_ptr node_ptr; + typedef detail::ebo_functor_holder base_t; + + avltree_node_cloner(F f) + : base_t(f) + {} + + node_ptr operator()(const node_ptr & p) + { + node_ptr n = base_t::get()(p); + NodeTraits::set_balance(n, NodeTraits::get_balance(p)); + return n; + } +}; + +namespace detail { + +template +struct avltree_node_checker + : public bstree_node_checker +{ + typedef bstree_node_checker base_checker_t; + typedef ValueTraits value_traits; + typedef typename value_traits::node_traits node_traits; + typedef typename node_traits::const_node_ptr const_node_ptr; + + struct return_type + : public base_checker_t::return_type + { + return_type() : height(0) {} + int height; + }; + + avltree_node_checker(const NodePtrCompare& comp, ExtraChecker extra_checker) + : base_checker_t(comp, extra_checker) + {} + + void operator () (const const_node_ptr& p, + const return_type& check_return_left, const return_type& check_return_right, + return_type& check_return) + { + const int height_diff = check_return_right.height - check_return_left.height; (void)height_diff; + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT( + (height_diff == -1 && node_traits::get_balance(p) == node_traits::negative()) || + (height_diff == 0 && node_traits::get_balance(p) == node_traits::zero()) || + (height_diff == 1 && node_traits::get_balance(p) == node_traits::positive()) + ); + check_return.height = 1 + + (check_return_left.height > check_return_right.height ? check_return_left.height : check_return_right.height); + base_checker_t::operator()(p, check_return_left, check_return_right, check_return); + } +}; + +} // namespace detail + +/// @endcond + +//! avltree_algorithms is configured with a NodeTraits class, which encapsulates the +//! information about the node to be manipulated. NodeTraits must support the +//! following interface: +//! +//! Typedefs: +//! +//! node: The type of the node that forms the binary search tree +//! +//! node_ptr: A pointer to a node +//! +//! const_node_ptr: A pointer to a const node +//! +//! balance: The type of the balance factor +//! +//! Static functions: +//! +//! static node_ptr get_parent(const_node_ptr n); +//! +//! static void set_parent(node_ptr n, node_ptr parent); +//! +//! static node_ptr get_left(const_node_ptr n); +//! +//! static void set_left(node_ptr n, node_ptr left); +//! +//! static node_ptr get_right(const_node_ptr n); +//! +//! static void set_right(node_ptr n, node_ptr right); +//! +//! static balance get_balance(const_node_ptr n); +//! +//! static void set_balance(node_ptr n, balance b); +//! +//! static balance negative(); +//! +//! static balance zero(); +//! +//! static balance positive(); +template +class avltree_algorithms + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + : public bstree_algorithms + #endif +{ + public: + typedef typename NodeTraits::node node; + typedef NodeTraits node_traits; + typedef typename NodeTraits::node_ptr node_ptr; + typedef typename NodeTraits::const_node_ptr const_node_ptr; + typedef typename NodeTraits::balance balance; + + /// @cond + private: + typedef bstree_algorithms bstree_algo; + + /// @endcond + + public: + //! This type is the information that will be + //! filled by insert_unique_check + typedef typename bstree_algo::insert_commit_data insert_commit_data; + + #ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::get_header(const const_node_ptr&) + static node_ptr get_header(const const_node_ptr & n); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::begin_node + static node_ptr begin_node(const const_node_ptr & header); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::end_node + static node_ptr end_node(const const_node_ptr & header); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::swap_tree + static void swap_tree(const node_ptr & header1, const node_ptr & header2); + + #endif //#ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&) + static void swap_nodes(const node_ptr & node1, const node_ptr & node2) + { + if(node1 == node2) + return; + + node_ptr header1(bstree_algo::get_header(node1)), header2(bstree_algo::get_header(node2)); + swap_nodes(node1, header1, node2, header2); + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&,const node_ptr&,const node_ptr&) + static void swap_nodes(const node_ptr & node1, const node_ptr & header1, const node_ptr & node2, const node_ptr & header2) + { + if(node1 == node2) return; + + bstree_algo::swap_nodes(node1, header1, node2, header2); + //Swap balance + balance c = NodeTraits::get_balance(node1); + NodeTraits::set_balance(node1, NodeTraits::get_balance(node2)); + NodeTraits::set_balance(node2, c); + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&) + static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & new_node) + { + if(node_to_be_replaced == new_node) + return; + replace_node(node_to_be_replaced, bstree_algo::get_header(node_to_be_replaced), new_node); + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&,const node_ptr&) + static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node) + { + bstree_algo::replace_node(node_to_be_replaced, header, new_node); + NodeTraits::set_balance(new_node, NodeTraits::get_balance(node_to_be_replaced)); + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::unlink(const node_ptr&) + static void unlink(const node_ptr & node) + { + node_ptr x = NodeTraits::get_parent(node); + if(x){ + while(!is_header(x)) + x = NodeTraits::get_parent(x); + erase(x, node); + } + } + + #ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + //! @copydoc ::autoboost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance + static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::unique(const const_node_ptr&) + static bool unique(const const_node_ptr & node); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::size(const const_node_ptr&) + static std::size_t size(const const_node_ptr & header); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::next_node(const node_ptr&) + static node_ptr next_node(const node_ptr & node); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::prev_node(const node_ptr&) + static node_ptr prev_node(const node_ptr & node); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::init(const node_ptr&) + static void init(const node_ptr & node); + #endif //#ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! Requires: node must not be part of any tree. + //! + //! Effects: Initializes the header to represent an empty tree. + //! unique(header) == true. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + //! + //! Nodes: If node is inserted in a tree, this function corrupts the tree. + static void init_header(const node_ptr & header) + { + bstree_algo::init_header(header); + NodeTraits::set_balance(header, NodeTraits::zero()); + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::erase(const node_ptr&,const node_ptr&) + static node_ptr erase(const node_ptr & header, const node_ptr & z) + { + typename bstree_algo::data_for_rebalance info; + bstree_algo::erase(header, z, info); + if(info.y != z){ + NodeTraits::set_balance(info.y, NodeTraits::get_balance(z)); + } + //Rebalance avltree + rebalance_after_erasure(header, info.x, info.x_parent); + return z; + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::clone(const const_node_ptr&,const node_ptr&,Cloner,Disposer) + template + static void clone + (const const_node_ptr & source_header, const node_ptr & target_header, Cloner cloner, Disposer disposer) + { + avltree_node_cloner new_cloner(cloner); + bstree_algo::clone(source_header, target_header, new_cloner, disposer); + } + + #ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + //! @copydoc ::autoboost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) + template + static void clear_and_dispose(const node_ptr & header, Disposer disposer); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + template + static node_ptr lower_bound + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + template + static node_ptr upper_bound + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::find(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + template + static node_ptr find + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + template + static std::pair equal_range + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) + template + static std::pair bounded_range + (const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp + , bool left_closed, bool right_closed); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + template + static std::size_t count(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + + #endif //#ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::insert_equal_upper_bound(const node_ptr&,const node_ptr&,NodePtrCompare) + template + static node_ptr insert_equal_upper_bound + (const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp) + { + bstree_algo::insert_equal_upper_bound(h, new_node, comp); + rebalance_after_insertion(h, new_node); + return new_node; + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::insert_equal_lower_bound(const node_ptr&,const node_ptr&,NodePtrCompare) + template + static node_ptr insert_equal_lower_bound + (const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp) + { + bstree_algo::insert_equal_lower_bound(h, new_node, comp); + rebalance_after_insertion(h, new_node); + return new_node; + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::insert_equal(const node_ptr&,const node_ptr&,const node_ptr&,NodePtrCompare) + template + static node_ptr insert_equal + (const node_ptr & header, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp) + { + bstree_algo::insert_equal(header, hint, new_node, comp); + rebalance_after_insertion(header, new_node); + return new_node; + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::insert_before(const node_ptr&,const node_ptr&,const node_ptr&) + static node_ptr insert_before + (const node_ptr & header, const node_ptr & pos, const node_ptr & new_node) + { + bstree_algo::insert_before(header, pos, new_node); + rebalance_after_insertion(header, new_node); + return new_node; + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::push_back(const node_ptr&,const node_ptr&) + static void push_back(const node_ptr & header, const node_ptr & new_node) + { + bstree_algo::push_back(header, new_node); + rebalance_after_insertion(header, new_node); + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::push_front(const node_ptr&,const node_ptr&) + static void push_front(const node_ptr & header, const node_ptr & new_node) + { + bstree_algo::push_front(header, new_node); + rebalance_after_insertion(header, new_node); + } + + #ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + //! @copydoc ::autoboost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + template + static std::pair insert_unique_check + (const const_node_ptr & header, const KeyType &key + ,KeyNodePtrCompare comp, insert_commit_data &commit_data); + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + template + static std::pair insert_unique_check + (const const_node_ptr & header, const node_ptr &hint, const KeyType &key + ,KeyNodePtrCompare comp, insert_commit_data &commit_data); + #endif //#ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::insert_unique_commit(const node_ptr&,const node_ptr&,const insert_commit_data &) + static void insert_unique_commit + (const node_ptr & header, const node_ptr & new_value, const insert_commit_data &commit_data) + { + bstree_algo::insert_unique_commit(header, new_value, commit_data); + rebalance_after_insertion(header, new_value); + } + + //! @copydoc ::autoboost::intrusive::bstree_algorithms::is_header + static bool is_header(const const_node_ptr & p) + { return NodeTraits::get_balance(p) == NodeTraits::zero() && bstree_algo::is_header(p); } + + + /// @cond + static bool verify(const node_ptr &header) + { + std::size_t height; + std::size_t count; + return verify_recursion(NodeTraits::get_parent(header), count, height); + } + + private: + + static bool verify_recursion(node_ptr n, std::size_t &count, std::size_t &height) + { + if (!n){ + count = 0; + height = 0; + return true; + } + std::size_t leftcount, rightcount; + std::size_t leftheight, rightheight; + if(!verify_recursion(NodeTraits::get_left (n), leftcount, leftheight) || + !verify_recursion(NodeTraits::get_right(n), rightcount, rightheight) ){ + return false; + } + count = 1u + leftcount + rightcount; + height = 1u + (leftheight > rightheight ? leftheight : rightheight); + + //If equal height, balance must be zero + if(rightheight == leftheight){ + if(NodeTraits::get_balance(n) != NodeTraits::zero()){ + AUTOBOOST_ASSERT(0); + return false; + } + } + //If right is taller than left, then the difference must be at least 1 and the balance positive + else if(rightheight > leftheight){ + if(rightheight - leftheight > 1 ){ + AUTOBOOST_ASSERT(0); + return false; + } + else if(NodeTraits::get_balance(n) != NodeTraits::positive()){ + AUTOBOOST_ASSERT(0); + return false; + } + } + //If left is taller than right, then the difference must be at least 1 and the balance negative + else{ + if(leftheight - rightheight > 1 ){ + AUTOBOOST_ASSERT(0); + return false; + } + else if(NodeTraits::get_balance(n) != NodeTraits::negative()){ + AUTOBOOST_ASSERT(0); + return false; + } + } + return true; + } + + static void rebalance_after_erasure(const node_ptr & header, node_ptr x, node_ptr x_parent) + { + for ( node_ptr root = NodeTraits::get_parent(header) + ; x != root + ; root = NodeTraits::get_parent(header), x_parent = NodeTraits::get_parent(x)) { + const balance x_parent_balance = NodeTraits::get_balance(x_parent); + //Don't cache x_is_leftchild or similar because x can be null and + //equal to both x_parent_left and x_parent_right + const node_ptr x_parent_left (NodeTraits::get_left(x_parent)); + const node_ptr x_parent_right(NodeTraits::get_right(x_parent)); + + if(x_parent_balance == NodeTraits::zero()){ + NodeTraits::set_balance( x_parent, x == x_parent_right ? NodeTraits::negative() : NodeTraits::positive() ); + break; // the height didn't change, let's stop here + } + else if(x_parent_balance == NodeTraits::negative()){ + if (x == x_parent_left) { ////x is left child or x and sibling are null + NodeTraits::set_balance(x_parent, NodeTraits::zero()); // balanced + x = x_parent; + } + else { + // x is right child (x_parent_left is the left child) + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(x_parent_left); + if (NodeTraits::get_balance(x_parent_left) == NodeTraits::positive()) { + // x_parent_left MUST have a right child + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_right(x_parent_left)); + x = avl_rotate_left_right(x_parent, x_parent_left, header); + } + else { + avl_rotate_right(x_parent, x_parent_left, header); + x = x_parent_left; + } + + // if changed from negative to NodeTraits::positive(), no need to check above + if (NodeTraits::get_balance(x) == NodeTraits::positive()){ + break; + } + } + } + else if(x_parent_balance == NodeTraits::positive()){ + if (x == x_parent_right) { //x is right child or x and sibling are null + NodeTraits::set_balance(x_parent, NodeTraits::zero()); // balanced + x = x_parent; + } + else { + // x is left child (x_parent_right is the right child) + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(x_parent_right); + if (NodeTraits::get_balance(x_parent_right) == NodeTraits::negative()) { + // x_parent_right MUST have then a left child + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_left(x_parent_right)); + x = avl_rotate_right_left(x_parent, x_parent_right, header); + } + else { + avl_rotate_left(x_parent, x_parent_right, header); + x = x_parent_right; + } + // if changed from NodeTraits::positive() to negative, no need to check above + if (NodeTraits::get_balance(x) == NodeTraits::negative()){ + break; + } + } + } + else{ + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(false); // never reached + } + } + } + + static void rebalance_after_insertion(const node_ptr & header, node_ptr x) + { + NodeTraits::set_balance(x, NodeTraits::zero()); + // Rebalance. + for(node_ptr root = NodeTraits::get_parent(header); x != root; root = NodeTraits::get_parent(header)){ + node_ptr const x_parent(NodeTraits::get_parent(x)); + node_ptr const x_parent_left(NodeTraits::get_left(x_parent)); + const balance x_parent_balance = NodeTraits::get_balance(x_parent); + const bool x_is_leftchild(x == x_parent_left); + if(x_parent_balance == NodeTraits::zero()){ + // if x is left, parent will have parent->bal_factor = negative + // else, parent->bal_factor = NodeTraits::positive() + NodeTraits::set_balance( x_parent, x_is_leftchild ? NodeTraits::negative() : NodeTraits::positive() ); + x = x_parent; + } + else if(x_parent_balance == NodeTraits::positive()){ + // if x is a left child, parent->bal_factor = zero + if (x_is_leftchild) + NodeTraits::set_balance(x_parent, NodeTraits::zero()); + else{ // x is a right child, needs rebalancing + if (NodeTraits::get_balance(x) == NodeTraits::negative()) + avl_rotate_right_left(x_parent, x, header); + else + avl_rotate_left(x_parent, x, header); + } + break; + } + else if(x_parent_balance == NodeTraits::negative()){ + // if x is a left child, needs rebalancing + if (x_is_leftchild) { + if (NodeTraits::get_balance(x) == NodeTraits::positive()) + avl_rotate_left_right(x_parent, x, header); + else + avl_rotate_right(x_parent, x, header); + } + else + NodeTraits::set_balance(x_parent, NodeTraits::zero()); + break; + } + else{ + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(false); // never reached + } + } + } + + static void left_right_balancing(const node_ptr & a, const node_ptr & b, const node_ptr & c) + { + // balancing... + const balance c_balance = NodeTraits::get_balance(c); + const balance zero_balance = NodeTraits::zero(); + const balance posi_balance = NodeTraits::positive(); + const balance nega_balance = NodeTraits::negative(); + NodeTraits::set_balance(c, zero_balance); + if(c_balance == nega_balance){ + NodeTraits::set_balance(a, posi_balance); + NodeTraits::set_balance(b, zero_balance); + } + else if(c_balance == zero_balance){ + NodeTraits::set_balance(a, zero_balance); + NodeTraits::set_balance(b, zero_balance); + } + else if(c_balance == posi_balance){ + NodeTraits::set_balance(a, zero_balance); + NodeTraits::set_balance(b, nega_balance); + } + else{ + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(false); // never reached + } + } + + static node_ptr avl_rotate_left_right(const node_ptr a, const node_ptr a_oldleft, const node_ptr & hdr) + { // [note: 'a_oldleft' is 'b'] + // | | // + // a(-2) c // + // / \ / \ // + // / \ ==> / \ // + // (pos)b [g] b a // + // / \ / \ / \ // + // [d] c [d] e f [g] // + // / \ // + // e f // + const node_ptr c = NodeTraits::get_right(a_oldleft); + bstree_algo::rotate_left_no_parent_fix(a_oldleft, c); + //No need to link c with a [NodeTraits::set_parent(c, a) + NodeTraits::set_left(a, c)] + //as c is not root and another rotation is coming + bstree_algo::rotate_right(a, c, NodeTraits::get_parent(a), hdr); + left_right_balancing(a, a_oldleft, c); + return c; + } + + static node_ptr avl_rotate_right_left(const node_ptr a, const node_ptr a_oldright, const node_ptr & hdr) + { // [note: 'a_oldright' is 'b'] + // | | // + // a(pos) c // + // / \ / \ // + // / \ / \ // + // [d] b(neg) ==> a b // + // / \ / \ / \ // + // c [g] [d] e f [g] // + // / \ // + // e f // + const node_ptr c (NodeTraits::get_left(a_oldright)); + bstree_algo::rotate_right_no_parent_fix(a_oldright, c); + //No need to link c with a [NodeTraits::set_parent(c, a) + NodeTraits::set_right(a, c)] + //as c is not root and another rotation is coming. + bstree_algo::rotate_left(a, c, NodeTraits::get_parent(a), hdr); + left_right_balancing(a_oldright, a, c); + return c; + } + + static void avl_rotate_left(const node_ptr &x, const node_ptr &x_oldright, const node_ptr & hdr) + { + bstree_algo::rotate_left(x, x_oldright, NodeTraits::get_parent(x), hdr); + + // reset the balancing factor + if (NodeTraits::get_balance(x_oldright) == NodeTraits::positive()) { + NodeTraits::set_balance(x, NodeTraits::zero()); + NodeTraits::set_balance(x_oldright, NodeTraits::zero()); + } + else { // this doesn't happen during insertions + NodeTraits::set_balance(x, NodeTraits::positive()); + NodeTraits::set_balance(x_oldright, NodeTraits::negative()); + } + } + + static void avl_rotate_right(const node_ptr &x, const node_ptr &x_oldleft, const node_ptr & hdr) + { + bstree_algo::rotate_right(x, x_oldleft, NodeTraits::get_parent(x), hdr); + + // reset the balancing factor + if (NodeTraits::get_balance(x_oldleft) == NodeTraits::negative()) { + NodeTraits::set_balance(x, NodeTraits::zero()); + NodeTraits::set_balance(x_oldleft, NodeTraits::zero()); + } + else { // this doesn't happen during insertions + NodeTraits::set_balance(x, NodeTraits::negative()); + NodeTraits::set_balance(x_oldleft, NodeTraits::positive()); + } + } + + /// @endcond +}; + +/// @cond + +template +struct get_algo +{ + typedef avltree_algorithms type; +}; + +template +struct get_node_checker +{ + typedef detail::avltree_node_checker type; +}; + +/// @endcond + +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_AVLTREE_ALGORITHMS_HPP diff --git a/contrib/autoboost/autoboost/intrusive/bs_set_hook.hpp b/contrib/autoboost/autoboost/intrusive/bs_set_hook.hpp new file mode 100644 index 000000000..d7553300f --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/bs_set_hook.hpp @@ -0,0 +1,286 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2007-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_BS_SET_HOOK_HPP +#define AUTOBOOST_INTRUSIVE_BS_SET_HOOK_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { + +//! Helper metafunction to define a \c bs_set_base_hook that yields to the same +//! type when the same options (either explicitly or implicitly) are used. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +struct make_bs_set_base_hook +{ + /// @cond + typedef typename pack_options + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + < hook_defaults, O1, O2, O3> + #else + < hook_defaults, Options...> + #endif + ::type packed_options; + + typedef generic_hook + < bstree_algorithms > + , typename packed_options::tag + , packed_options::link_mode + , BsTreeBaseHookId + > implementation_defined; + /// @endcond + typedef implementation_defined type; +}; + +//! Derive a class from bs_set_base_hook in order to store objects in +//! in a bs_set/bs_multiset. bs_set_base_hook holds the data necessary to maintain +//! the bs_set/bs_multiset and provides an appropriate value_traits class for bs_set/bs_multiset. +//! +//! The hook admits the following options: \c tag<>, \c void_pointer<>, +//! \c link_mode<>. +//! +//! \c tag<> defines a tag to identify the node. +//! The same tag value can be used in different classes, but if a class is +//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its +//! unique tag. +//! +//! \c void_pointer<> is the pointer type that will be used internally in the hook +//! and the container configured to use this hook. +//! +//! \c link_mode<> will specify the linking mode of the hook (\c normal_link, +//! \c auto_unlink or \c safe_link). +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +class bs_set_base_hook + : public make_bs_set_base_hook + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + + #else + + #endif + ::type + +{ + #if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + public: + //! Effects: If link_mode is \c auto_unlink or \c safe_link + //! initializes the node to an unlinked state. + //! + //! Throws: Nothing. + bs_set_base_hook(); + + //! Effects: If link_mode is \c auto_unlink or \c safe_link + //! initializes the node to an unlinked state. The argument is ignored. + //! + //! Throws: Nothing. + //! + //! Rationale: Providing a copy-constructor + //! makes classes using the hook STL-compliant without forcing the + //! user to do some additional work. \c swap can be used to emulate + //! move-semantics. + bs_set_base_hook(const bs_set_base_hook& ); + + //! Effects: Empty function. The argument is ignored. + //! + //! Throws: Nothing. + //! + //! Rationale: Providing an assignment operator + //! makes classes using the hook STL-compliant without forcing the + //! user to do some additional work. \c swap can be used to emulate + //! move-semantics. + bs_set_base_hook& operator=(const bs_set_base_hook& ); + + //! Effects: If link_mode is \c normal_link, the destructor does + //! nothing (ie. no code is generated). If link_mode is \c safe_link and the + //! object is stored in a set an assertion is raised. If link_mode is + //! \c auto_unlink and \c is_linked() is true, the node is unlinked. + //! + //! Throws: Nothing. + ~bs_set_base_hook(); + + //! Effects: Swapping two nodes swaps the position of the elements + //! related to those nodes in one or two containers. That is, if the node + //! this is part of the element e1, the node x is part of the element e2 + //! and both elements are included in the containers s1 and s2, then after + //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 + //! at the position of e1. If one element is not in a container, then + //! after the swap-operation the other element is not in a container. + //! Iterators to e1 and e2 related to those nodes are invalidated. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + void swap_nodes(bs_set_base_hook &other); + + //! Precondition: link_mode must be \c safe_link or \c auto_unlink. + //! + //! Returns: true, if the node belongs to a container, false + //! otherwise. This function can be used to test whether \c set::iterator_to + //! will return a valid iterator. + //! + //! Complexity: Constant + bool is_linked() const; + + //! Effects: Removes the node if it's inserted in a container. + //! This function is only allowed if link_mode is \c auto_unlink. + //! + //! Throws: Nothing. + void unlink(); + #endif +}; + +//! Helper metafunction to define a \c bs_set_member_hook that yields to the same +//! type when the same options (either explicitly or implicitly) are used. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +struct make_bs_set_member_hook +{ + /// @cond + typedef typename pack_options + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + < hook_defaults, O1, O2, O3> + #else + < hook_defaults, Options...> + #endif + + ::type packed_options; + + typedef generic_hook + < bstree_algorithms > + , member_tag + , packed_options::link_mode + , NoBaseHookId + > implementation_defined; + /// @endcond + typedef implementation_defined type; +}; + +//! Put a public data member bs_set_member_hook in order to store objects of this class in +//! a bs_set/bs_multiset. bs_set_member_hook holds the data necessary for maintaining the +//! bs_set/bs_multiset and provides an appropriate value_traits class for bs_set/bs_multiset. +//! +//! The hook admits the following options: \c void_pointer<>, \c link_mode<>. +//! +//! \c void_pointer<> is the pointer type that will be used internally in the hook +//! and the container configured to use this hook. +//! +//! \c link_mode<> will specify the linking mode of the hook (\c normal_link, +//! \c auto_unlink or \c safe_link). +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +class bs_set_member_hook + : public make_bs_set_member_hook + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + + #else + + #endif + ::type +{ + #if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + public: + //! Effects: If link_mode is \c auto_unlink or \c safe_link + //! initializes the node to an unlinked state. + //! + //! Throws: Nothing. + bs_set_member_hook(); + + //! Effects: If link_mode is \c auto_unlink or \c safe_link + //! initializes the node to an unlinked state. The argument is ignored. + //! + //! Throws: Nothing. + //! + //! Rationale: Providing a copy-constructor + //! makes classes using the hook STL-compliant without forcing the + //! user to do some additional work. \c swap can be used to emulate + //! move-semantics. + bs_set_member_hook(const bs_set_member_hook& ); + + //! Effects: Empty function. The argument is ignored. + //! + //! Throws: Nothing. + //! + //! Rationale: Providing an assignment operator + //! makes classes using the hook STL-compliant without forcing the + //! user to do some additional work. \c swap can be used to emulate + //! move-semantics. + bs_set_member_hook& operator=(const bs_set_member_hook& ); + + //! Effects: If link_mode is \c normal_link, the destructor does + //! nothing (ie. no code is generated). If link_mode is \c safe_link and the + //! object is stored in a set an assertion is raised. If link_mode is + //! \c auto_unlink and \c is_linked() is true, the node is unlinked. + //! + //! Throws: Nothing. + ~bs_set_member_hook(); + + //! Effects: Swapping two nodes swaps the position of the elements + //! related to those nodes in one or two containers. That is, if the node + //! this is part of the element e1, the node x is part of the element e2 + //! and both elements are included in the containers s1 and s2, then after + //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 + //! at the position of e1. If one element is not in a container, then + //! after the swap-operation the other element is not in a container. + //! Iterators to e1 and e2 related to those nodes are invalidated. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + void swap_nodes(bs_set_member_hook &other); + + //! Precondition: link_mode must be \c safe_link or \c auto_unlink. + //! + //! Returns: true, if the node belongs to a container, false + //! otherwise. This function can be used to test whether \c set::iterator_to + //! will return a valid iterator. + //! + //! Complexity: Constant + bool is_linked() const; + + //! Effects: Removes the node if it's inserted in a container. + //! This function is only allowed if link_mode is \c auto_unlink. + //! + //! Throws: Nothing. + void unlink(); + #endif +}; + +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_BS_SET_HOOK_HPP diff --git a/contrib/autoboost/autoboost/intrusive/bstree.hpp b/contrib/autoboost/autoboost/intrusive/bstree.hpp new file mode 100644 index 000000000..e184d3eab --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/bstree.hpp @@ -0,0 +1,2177 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2013-2014 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// +#ifndef AUTOBOOST_INTRUSIVE_BSTREE_HPP +#define AUTOBOOST_INTRUSIVE_BSTREE_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include //pair,lexicographical_compare +#include //swap +#include //size_t... +#include //less, equal_to + + +namespace autoboost { +namespace intrusive { + +/// @cond + +struct default_bstree_hook_applier +{ template struct apply{ typedef typename T::default_bstree_hook type; }; }; + +template<> +struct is_default_hook_tag +{ static const bool value = true; }; + +struct bstree_defaults +{ + typedef default_bstree_hook_applier proto_value_traits; + static const bool constant_time_size = true; + typedef std::size_t size_type; + typedef void compare; + static const bool floating_point = true; //For sgtree + typedef void priority; //For treap + typedef void header_holder_type; +}; + +template +struct bstbase3 +{ + typedef ValueTraits value_traits; + typedef typename value_traits::node_traits node_traits; + typedef typename node_traits::node node_type; + typedef typename get_algo::type node_algorithms; + typedef typename node_traits::node_ptr node_ptr; + typedef typename node_traits::const_node_ptr const_node_ptr; + typedef tree_iterator iterator; + typedef tree_iterator const_iterator; + typedef autoboost::intrusive::detail::reverse_iterator reverse_iterator; + typedef autoboost::intrusive::detail::reverse_iterator const_reverse_iterator; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename value_traits::pointer) pointer; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename value_traits::const_pointer) const_pointer; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::element_type) value_type; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(value_type) key_type; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::reference) reference; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::reference) const_reference; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::difference_type) difference_type; + typedef HeaderHolder header_holder_type; + + static const bool safemode_or_autounlink = is_safe_autounlink::value; + static const bool stateful_value_traits = detail::is_stateful_value_traits::value; + static const bool has_container_from_iterator = + detail::is_same< header_holder_type, detail::default_header_holder< node_traits > >::value; + + struct holder_t : public ValueTraits + { + explicit holder_t(const ValueTraits &vtraits) + : ValueTraits(vtraits) + {} + header_holder_type root; + } holder; + + static bstbase3 &get_tree_base_from_end_iterator(const const_iterator &end_iterator) + { + AUTOBOOST_STATIC_ASSERT(has_container_from_iterator); + node_ptr p = end_iterator.pointed_node(); + header_holder_type* h = header_holder_type::get_holder(p); + holder_t *holder = get_parent_from_member(h, &holder_t::root); + bstbase3 *base = get_parent_from_member (holder, &bstbase3::holder); + return *base; + } + + bstbase3(const ValueTraits &vtraits) + : holder(vtraits) + { + node_algorithms::init_header(this->header_ptr()); + } + + node_ptr header_ptr() + { return holder.root.get_node(); } + + const_node_ptr header_ptr() const + { return holder.root.get_node(); } + + const value_traits &get_value_traits() const + { return this->holder; } + + value_traits &get_value_traits() + { return this->holder; } + + typedef typename autoboost::intrusive::value_traits_pointers + ::const_value_traits_ptr const_value_traits_ptr; + + const_value_traits_ptr priv_value_traits_ptr() const + { return pointer_traits::pointer_to(this->get_value_traits()); } + + iterator begin() + { return iterator(node_algorithms::begin_node(this->header_ptr()), this->priv_value_traits_ptr()); } + + const_iterator begin() const + { return cbegin(); } + + const_iterator cbegin() const + { return const_iterator(node_algorithms::begin_node(this->header_ptr()), this->priv_value_traits_ptr()); } + + iterator end() + { return iterator(node_algorithms::end_node(this->header_ptr()), this->priv_value_traits_ptr()); } + + const_iterator end() const + { return cend(); } + + const_iterator cend() const + { return const_iterator(node_algorithms::end_node(this->header_ptr()), this->priv_value_traits_ptr()); } + + iterator root() + { return iterator(node_algorithms::root_node(this->header_ptr()), this->priv_value_traits_ptr()); } + + const_iterator root() const + { return croot(); } + + const_iterator croot() const + { return const_iterator(node_algorithms::root_node(this->header_ptr()), this->priv_value_traits_ptr()); } + + reverse_iterator rbegin() + { return reverse_iterator(end()); } + + const_reverse_iterator rbegin() const + { return const_reverse_iterator(end()); } + + const_reverse_iterator crbegin() const + { return const_reverse_iterator(end()); } + + reverse_iterator rend() + { return reverse_iterator(begin()); } + + const_reverse_iterator rend() const + { return const_reverse_iterator(begin()); } + + const_reverse_iterator crend() const + { return const_reverse_iterator(begin()); } + + void replace_node(iterator replace_this, reference with_this) + { + node_algorithms::replace_node( get_value_traits().to_node_ptr(*replace_this) + , this->header_ptr() + , get_value_traits().to_node_ptr(with_this)); + if(safemode_or_autounlink) + node_algorithms::init(replace_this.pointed_node()); + } + + void rebalance() + { node_algorithms::rebalance(this->header_ptr()); } + + iterator rebalance_subtree(iterator root) + { return iterator(node_algorithms::rebalance_subtree(root.pointed_node()), this->priv_value_traits_ptr()); } + + static iterator s_iterator_to(reference value) + { + AUTOBOOST_STATIC_ASSERT((!stateful_value_traits)); + return iterator (value_traits::to_node_ptr(value), const_value_traits_ptr()); + } + + static const_iterator s_iterator_to(const_reference value) + { + AUTOBOOST_STATIC_ASSERT((!stateful_value_traits)); + return const_iterator (value_traits::to_node_ptr(*pointer_traits::const_cast_from(pointer_traits::pointer_to(value))), const_value_traits_ptr()); + } + + iterator iterator_to(reference value) + { return iterator (this->get_value_traits().to_node_ptr(value), this->priv_value_traits_ptr()); } + + const_iterator iterator_to(const_reference value) const + { return const_iterator (this->get_value_traits().to_node_ptr(*pointer_traits::const_cast_from(pointer_traits::pointer_to(value))), this->priv_value_traits_ptr()); } + + static void init_node(reference value) + { node_algorithms::init(value_traits::to_node_ptr(value)); } + +}; + +template +struct get_less +{ + typedef Less type; +}; + +template +struct get_less +{ + typedef ::std::less type; +}; + +template +struct bstbase2 + //Put the (possibly empty) functor in the first position to get EBO in MSVC + : public detail::ebo_functor_holder::type> + , public bstbase3 +{ + typedef bstbase3 treeheader_t; + typedef typename treeheader_t::value_traits value_traits; + typedef typename treeheader_t::node_algorithms node_algorithms; + typedef typename get_less + < VoidOrKeyComp, typename value_traits::value_type>::type value_compare; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(value_compare) key_compare; + typedef typename treeheader_t::iterator iterator; + typedef typename treeheader_t::const_iterator const_iterator; + typedef typename treeheader_t::node_ptr node_ptr; + typedef typename treeheader_t::const_node_ptr const_node_ptr; + + bstbase2(const value_compare &comp, const ValueTraits &vtraits) + : detail::ebo_functor_holder(comp), treeheader_t(vtraits) + {} + + const value_compare &comp() const + { return this->get(); } + + value_compare &comp() + { return this->get(); } + + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename value_traits::pointer) pointer; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename value_traits::const_pointer) const_pointer; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::element_type) value_type; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(value_type) key_type; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::reference) reference; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::reference) const_reference; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::difference_type) difference_type; + typedef typename node_algorithms::insert_commit_data insert_commit_data; + + value_compare value_comp() const + { return this->comp(); } + + key_compare key_comp() const + { return this->comp(); } + + //lower_bound + iterator lower_bound(const_reference value) + { return this->lower_bound(value, this->comp()); } + + const_iterator lower_bound(const_reference value) const + { return this->lower_bound(value, this->comp()); } + + template + iterator lower_bound(const KeyType &key, KeyValueCompare comp) + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + return iterator(node_algorithms::lower_bound + (this->header_ptr(), key, key_node_comp), this->priv_value_traits_ptr()); + } + + template + const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + return const_iterator(node_algorithms::lower_bound + (this->header_ptr(), key, key_node_comp), this->priv_value_traits_ptr()); + } + + //upper_bound + iterator upper_bound(const_reference value) + { return this->upper_bound(value, this->comp()); } + + template + iterator upper_bound(const KeyType &key, KeyValueCompare comp) + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + return iterator(node_algorithms::upper_bound + (this->header_ptr(), key, key_node_comp), this->priv_value_traits_ptr()); + } + + const_iterator upper_bound(const_reference value) const + { return this->upper_bound(value, this->comp()); } + + template + const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + return const_iterator(node_algorithms::upper_bound + (this->header_ptr(), key, key_node_comp), this->priv_value_traits_ptr()); + } + + //find + iterator find(const_reference value) + { return this->find(value, this->comp()); } + + template + iterator find(const KeyType &key, KeyValueCompare comp) + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + return iterator + (node_algorithms::find(this->header_ptr(), key, key_node_comp), this->priv_value_traits_ptr()); + } + + const_iterator find(const_reference value) const + { return this->find(value, this->comp()); } + + template + const_iterator find(const KeyType &key, KeyValueCompare comp) const + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + return const_iterator + (node_algorithms::find(this->header_ptr(), key, key_node_comp), this->priv_value_traits_ptr()); + } + + //equal_range + std::pair equal_range(const_reference value) + { return this->equal_range(value, this->comp()); } + + template + std::pair equal_range(const KeyType &key, KeyValueCompare comp) + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + std::pair ret + (node_algorithms::equal_range(this->header_ptr(), key, key_node_comp)); + return std::pair( iterator(ret.first, this->priv_value_traits_ptr()) + , iterator(ret.second, this->priv_value_traits_ptr())); + } + + std::pair + equal_range(const_reference value) const + { return this->equal_range(value, this->comp()); } + + template + std::pair + equal_range(const KeyType &key, KeyValueCompare comp) const + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + std::pair ret + (node_algorithms::equal_range(this->header_ptr(), key, key_node_comp)); + return std::pair( const_iterator(ret.first, this->priv_value_traits_ptr()) + , const_iterator(ret.second, this->priv_value_traits_ptr())); + } + + //lower_bound_range + std::pair lower_bound_range(const_reference value) + { return this->lower_bound_range(value, this->comp()); } + + template + std::pair lower_bound_range(const KeyType &key, KeyValueCompare comp) + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + std::pair ret + (node_algorithms::lower_bound_range(this->header_ptr(), key, key_node_comp)); + return std::pair( iterator(ret.first, this->priv_value_traits_ptr()) + , iterator(ret.second, this->priv_value_traits_ptr())); + } + + std::pair + lower_bound_range(const_reference value) const + { return this->lower_bound_range(value, this->comp()); } + + template + std::pair + lower_bound_range(const KeyType &key, KeyValueCompare comp) const + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + std::pair ret + (node_algorithms::lower_bound_range(this->header_ptr(), key, key_node_comp)); + return std::pair( const_iterator(ret.first, this->priv_value_traits_ptr()) + , const_iterator(ret.second, this->priv_value_traits_ptr())); + } + + //bounded_range + std::pair bounded_range + (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) + { return this->bounded_range(lower_value, upper_value, this->comp(), left_closed, right_closed); } + + template + std::pair bounded_range + (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + std::pair ret + (node_algorithms::bounded_range + (this->header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed)); + return std::pair( iterator(ret.first, this->priv_value_traits_ptr()) + , iterator(ret.second, this->priv_value_traits_ptr())); + } + + std::pair bounded_range + (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const + { return this->bounded_range(lower_value, upper_value, this->comp(), left_closed, right_closed); } + + template + std::pair bounded_range + (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const + { + detail::key_nodeptr_comp + key_node_comp(comp, &this->get_value_traits()); + std::pair ret + (node_algorithms::bounded_range + (this->header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed)); + return std::pair( const_iterator(ret.first, this->priv_value_traits_ptr()) + , const_iterator(ret.second, this->priv_value_traits_ptr())); + } + + //insert_unique_check + template + std::pair insert_unique_check + (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data) + { + detail::key_nodeptr_comp + ocomp(key_value_comp, &this->get_value_traits()); + std::pair ret = + (node_algorithms::insert_unique_check + (this->header_ptr(), key, ocomp, commit_data)); + return std::pair(iterator(ret.first, this->priv_value_traits_ptr()), ret.second); + } + + template + std::pair insert_unique_check + (const_iterator hint, const KeyType &key + ,KeyValueCompare key_value_comp, insert_commit_data &commit_data) + { + detail::key_nodeptr_comp + ocomp(key_value_comp, &this->get_value_traits()); + std::pair ret = + (node_algorithms::insert_unique_check + (this->header_ptr(), hint.pointed_node(), key, ocomp, commit_data)); + return std::pair(iterator(ret.first, this->priv_value_traits_ptr()), ret.second); + } +}; + +//Due to MSVC's EBO implementation, to save space and maintain the ABI, we must put the non-empty size member +//in the first position, but if size is not going to be stored then we'll use an specialization +//that doesn't inherit from size_holder +template +struct bstbase_hack + : public detail::size_holder + , public bstbase2 < ValueTraits, VoidOrKeyComp, AlgoType, HeaderHolder> +{ + typedef bstbase2< ValueTraits, VoidOrKeyComp, AlgoType, HeaderHolder> base_type; + typedef typename base_type::value_compare value_compare; + typedef SizeType size_type; + typedef typename base_type::node_traits node_traits; + typedef typename get_algo + ::type algo_type; + + bstbase_hack(const value_compare & comp, const ValueTraits &vtraits) + : base_type(comp, vtraits) + { + this->sz_traits().set_size(size_type(0)); + } + + typedef detail::size_holder size_traits; + + size_traits &sz_traits() + { return static_cast(*this); } + + const size_traits &sz_traits() const + { return static_cast(*this); } +}; + +//Specialization for ConstantTimeSize == false +template +struct bstbase_hack + : public bstbase2 < ValueTraits, VoidOrKeyComp, AlgoType, HeaderHolder> +{ + typedef bstbase2< ValueTraits, VoidOrKeyComp, AlgoType, HeaderHolder> base_type; + typedef typename base_type::value_compare value_compare; + bstbase_hack(const value_compare & comp, const ValueTraits &vtraits) + : base_type(comp, vtraits) + {} + + typedef detail::size_holder size_traits; + + size_traits &sz_traits() + { return s_size_traits; } + + const size_traits &sz_traits() const + { return s_size_traits; } + + static size_traits s_size_traits; +}; + +template +detail::size_holder bstbase_hack::s_size_traits; + +//This class will +template +struct bstbase + : public bstbase_hack< ValueTraits, VoidOrKeyComp, ConstantTimeSize, SizeType, AlgoType, HeaderHolder> +{ + typedef bstbase_hack< ValueTraits, VoidOrKeyComp, ConstantTimeSize, SizeType, AlgoType, HeaderHolder> base_type; + typedef ValueTraits value_traits; + typedef typename base_type::value_compare value_compare; + typedef value_compare key_compare; + typedef typename base_type::const_reference const_reference; + typedef typename base_type::reference reference; + typedef typename base_type::iterator iterator; + typedef typename base_type::const_iterator const_iterator; + typedef typename base_type::node_traits node_traits; + typedef typename get_algo + ::type node_algorithms; + typedef SizeType size_type; + + bstbase(const value_compare & comp, const ValueTraits &vtraits) + : base_type(comp, vtraits) + {} + + //Detach all inserted nodes. This will add exception safety to bstree_impl + //constructors inserting elements. + ~bstbase() + { + if(is_safe_autounlink::value){ + node_algorithms::clear_and_dispose + ( this->header_ptr() + , detail::node_disposer + (detail::null_disposer(), &this->get_value_traits())); + node_algorithms::init(this->header_ptr()); + } + } +}; + + +/// @endcond + +//! The class template bstree is an unbalanced intrusive binary search tree +//! container. The no-throw guarantee holds only, if the value_compare object +//! doesn't throw. +//! +//! The complexity guarantees only hold if the tree is balanced, logarithmic +//! complexity would increase to linear if the tree is totally unbalanced. +//! +//! The template parameter \c T is the type to be managed by the container. +//! The user can specify additional options and if no options are provided +//! default options are used. +//! +//! The container supports the following options: +//! \c base_hook<>/member_hook<>/value_traits<>, +//! \c constant_time_size<>, \c size_type<> and +//! \c compare<>. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +class bstree_impl + : public bstbase +{ + public: + /// @cond + typedef bstbase data_type; + typedef tree_iterator iterator_type; + typedef tree_iterator const_iterator_type; + /// @endcond + + typedef AUTOBOOST_INTRUSIVE_IMPDEF(ValueTraits) value_traits; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename value_traits::pointer) pointer; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename value_traits::const_pointer) const_pointer; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::element_type) value_type; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(value_type) key_type; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::reference) reference; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::reference) const_reference; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename pointer_traits::difference_type) difference_type; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(SizeType) size_type; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename data_type::value_compare) value_compare; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(value_compare) key_compare; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(iterator_type) iterator; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(const_iterator_type) const_iterator; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(autoboost::intrusive::detail::reverse_iterator) reverse_iterator; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(autoboost::intrusive::detail::reverse_iterator) const_reverse_iterator; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename value_traits::node_traits) node_traits; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename node_traits::node) node; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename node_traits::node_ptr) node_ptr; + typedef AUTOBOOST_INTRUSIVE_IMPDEF(typename node_traits::const_node_ptr) const_node_ptr; + /// @cond + typedef typename get_algo::type algo_type; + /// @endcond + typedef AUTOBOOST_INTRUSIVE_IMPDEF(algo_type) node_algorithms; + + static const bool constant_time_size = ConstantTimeSize; + static const bool stateful_value_traits = detail::is_stateful_value_traits::value; + /// @cond + private: + + //noncopyable + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(bstree_impl) + + static const bool safemode_or_autounlink = is_safe_autounlink::value; + + //Constant-time size is incompatible with auto-unlink hooks! + AUTOBOOST_STATIC_ASSERT(!(constant_time_size && ((int)value_traits::link_mode == (int)auto_unlink))); + + + protected: + + + /// @endcond + + public: + + typedef typename node_algorithms::insert_commit_data insert_commit_data; + + //! Effects: Constructs an empty container. + //! + //! Complexity: Constant. + //! + //! Throws: If value_traits::node_traits::node + //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) + //! or the copy constructor of the value_compare object throws. Basic guarantee. + explicit bstree_impl( const value_compare &cmp = value_compare() + , const value_traits &v_traits = value_traits()) + : data_type(cmp, v_traits) + {} + + //! Requires: Dereferencing iterator must yield an lvalue of type value_type. + //! cmp must be a comparison function that induces a strict weak ordering. + //! + //! Effects: Constructs an empty container and inserts elements from + //! [b, e). + //! + //! Complexity: Linear in N if [b, e) is already sorted using + //! comp and otherwise N * log N, where N is the distance between first and last. + //! + //! Throws: If value_traits::node_traits::node + //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) + //! or the copy constructor/operator() of the value_compare object throws. Basic guarantee. + template + bstree_impl( bool unique, Iterator b, Iterator e + , const value_compare &cmp = value_compare() + , const value_traits &v_traits = value_traits()) + : data_type(cmp, v_traits) + { + //bstbase releases elements in case of exceptions + if(unique) + this->insert_unique(b, e); + else + this->insert_equal(b, e); + } + + //! Effects: to-do + //! + bstree_impl(AUTOBOOST_RV_REF(bstree_impl) x) + : data_type(::autoboost::move(x.comp()), ::autoboost::move(x.get_value_traits())) + { + this->swap(x); + } + + //! Effects: to-do + //! + bstree_impl& operator=(AUTOBOOST_RV_REF(bstree_impl) x) + { this->swap(x); return *this; } + + #ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + //! Effects: Detaches all elements from this. The objects in the set + //! are not deleted (i.e. no destructors are called), but the nodes according to + //! the value_traits template parameter are reinitialized and thus can be reused. + //! + //! Complexity: Linear to elements contained in *this. + //! + //! Throws: Nothing. + ~bstree_impl() + {} + + //! Effects: Returns an iterator pointing to the beginning of the container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + iterator begin(); + + //! Effects: Returns a const_iterator pointing to the beginning of the container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_iterator begin() const; + + //! Effects: Returns a const_iterator pointing to the beginning of the container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_iterator cbegin() const; + + //! Effects: Returns an iterator pointing to the end of the container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + iterator end(); + + //! Effects: Returns a const_iterator pointing to the end of the container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_iterator end() const; + + //! Effects: Returns a const_iterator pointing to the end of the container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_iterator cend() const; + + //! Effects: Returns a reverse_iterator pointing to the beginning of the + //! reversed container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + reverse_iterator rbegin(); + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_reverse_iterator rbegin() const; + + //! Effects: Returns a const_reverse_iterator pointing to the beginning + //! of the reversed container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_reverse_iterator crbegin() const; + + //! Effects: Returns a reverse_iterator pointing to the end + //! of the reversed container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + reverse_iterator rend(); + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_reverse_iterator rend() const; + + //! Effects: Returns a const_reverse_iterator pointing to the end + //! of the reversed container. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_reverse_iterator crend() const; + + #endif //#ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! Precondition: end_iterator must be a valid end iterator + //! of the container. + //! + //! Effects: Returns a const reference to the container associated to the end iterator + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + static bstree_impl &container_from_end_iterator(iterator end_iterator) + { + return static_cast + (data_type::get_tree_base_from_end_iterator(end_iterator)); + } + + //! Precondition: end_iterator must be a valid end const_iterator + //! of the container. + //! + //! Effects: Returns a const reference to the container associated to the iterator + //! + //! Throws: Nothing. + //! + //! Complexity: Constant. + static const bstree_impl &container_from_end_iterator(const_iterator end_iterator) + { + return static_cast + (data_type::get_tree_base_from_end_iterator(end_iterator)); + } + + //! Precondition: it must be a valid iterator + //! of the container. + //! + //! Effects: Returns a const reference to the container associated to the iterator + //! + //! Throws: Nothing. + //! + //! Complexity: Logarithmic. + static bstree_impl &container_from_iterator(iterator it) + { return container_from_end_iterator(it.end_iterator_from_it()); } + + //! Precondition: it must be a valid end const_iterator + //! of container. + //! + //! Effects: Returns a const reference to the container associated to the end iterator + //! + //! Throws: Nothing. + //! + //! Complexity: Logarithmic. + static const bstree_impl &container_from_iterator(const_iterator it) + { return container_from_end_iterator(it.end_iterator_from_it()); } + + #ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! Effects: Returns the key_compare object used by the container. + //! + //! Complexity: Constant. + //! + //! Throws: If value_compare copy-constructor throws. + key_compare key_comp() const; + + //! Effects: Returns the value_compare object used by the container. + //! + //! Complexity: Constant. + //! + //! Throws: If value_compare copy-constructor throws. + value_compare value_comp() const; + + #endif //#ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! Effects: Returns true if the container is empty. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + bool empty() const + { + if(ConstantTimeSize){ + return !this->data_type::sz_traits().get_size(); + } + else{ + return algo_type::unique(this->header_ptr()); + } + } + + //! Effects: Returns the number of elements stored in the container. + //! + //! Complexity: Linear to elements contained in *this + //! if constant-time size option is disabled. Constant time otherwise. + //! + //! Throws: Nothing. + size_type size() const + { + if(constant_time_size) + return this->sz_traits().get_size(); + else{ + return (size_type)node_algorithms::size(this->header_ptr()); + } + } + + //! Effects: Swaps the contents of two containers. + //! + //! Complexity: Constant. + //! + //! Throws: If the comparison functor's swap call throws. + void swap(bstree_impl& other) + { + //This can throw + using std::swap; + swap(this->comp(), this->comp()); + //These can't throw + node_algorithms::swap_tree(this->header_ptr(), node_ptr(other.header_ptr())); + if(constant_time_size){ + size_type backup = this->sz_traits().get_size(); + this->sz_traits().set_size(other.sz_traits().get_size()); + other.sz_traits().set_size(backup); + } + } + + //! Requires: Disposer::operator()(pointer) shouldn't throw. + //! Cloner should yield to nodes equivalent to the original nodes. + //! + //! Effects: Erases all the elements from *this + //! calling Disposer::operator()(pointer), clones all the + //! elements from src calling Cloner::operator()(const_reference ) + //! and inserts them on *this. Copies the predicate from the source container. + //! + //! If cloner throws, all cloned elements are unlinked and disposed + //! calling Disposer::operator()(pointer). + //! + //! Complexity: Linear to erased plus inserted elements. + //! + //! Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. + template + void clone_from(const bstree_impl &src, Cloner cloner, Disposer disposer) + { + this->clear_and_dispose(disposer); + if(!src.empty()){ + detail::exception_disposer + rollback(*this, disposer); + node_algorithms::clone + (const_node_ptr(src.header_ptr()) + ,node_ptr(this->header_ptr()) + ,detail::node_cloner (cloner, &this->get_value_traits()) + ,detail::node_disposer(disposer, &this->get_value_traits())); + this->sz_traits().set_size(src.sz_traits().get_size()); + this->comp() = src.comp(); + rollback.release(); + } + } + + //! Requires: value must be an lvalue + //! + //! Effects: Inserts value into the container before the upper bound. + //! + //! Complexity: Average complexity for insert element is at + //! most logarithmic. + //! + //! Throws: If the internal value_compare ordering function throws. Strong guarantee. + //! + //! Note: Does not affect the validity of iterators and references. + //! No copy-constructors are called. + iterator insert_equal(reference value) + { + detail::key_nodeptr_comp + key_node_comp(this->comp(), &this->get_value_traits()); + node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert)); + iterator ret(node_algorithms::insert_equal_upper_bound + (this->header_ptr(), to_insert, key_node_comp), this->priv_value_traits_ptr()); + this->sz_traits().increment(); + return ret; + } + + //! Requires: value must be an lvalue, and "hint" must be + //! a valid iterator. + //! + //! Effects: Inserts x into the container, using "hint" as a hint to + //! where it will be inserted. If "hint" is the upper_bound + //! the insertion takes constant time (two comparisons in the worst case) + //! + //! Complexity: Logarithmic in general, but it is amortized + //! constant time if t is inserted immediately before hint. + //! + //! Throws: If the internal value_compare ordering function throws. Strong guarantee. + //! + //! Note: Does not affect the validity of iterators and references. + //! No copy-constructors are called. + iterator insert_equal(const_iterator hint, reference value) + { + detail::key_nodeptr_comp + key_node_comp(this->comp(), &this->get_value_traits()); + node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert)); + iterator ret(node_algorithms::insert_equal + (this->header_ptr(), hint.pointed_node(), to_insert, key_node_comp), this->priv_value_traits_ptr()); + this->sz_traits().increment(); + return ret; + } + + //! Requires: Dereferencing iterator must yield an lvalue + //! of type value_type. + //! + //! Effects: Inserts a each element of a range into the container + //! before the upper bound of the key of each element. + //! + //! Complexity: Insert range is in general O(N * log(N)), where N is the + //! size of the range. However, it is linear in N if the range is already sorted + //! by value_comp(). + //! + //! Throws: Nothing. + //! + //! Note: Does not affect the validity of iterators and references. + //! No copy-constructors are called. + template + void insert_equal(Iterator b, Iterator e) + { + iterator iend(this->end()); + for (; b != e; ++b) + this->insert_equal(iend, *b); + } + + //! Requires: value must be an lvalue + //! + //! Effects: Inserts value into the container if the value + //! is not already present. + //! + //! Complexity: Average complexity for insert element is at + //! most logarithmic. + //! + //! Throws: Nothing. + //! + //! Note: Does not affect the validity of iterators and references. + //! No copy-constructors are called. + std::pair insert_unique(reference value) + { + insert_commit_data commit_data; + std::pair ret = this->insert_unique_check(value, this->comp(), commit_data); + if(!ret.second) + return ret; + return std::pair (this->insert_unique_commit(value, commit_data), true); + } + + //! Requires: value must be an lvalue, and "hint" must be + //! a valid iterator + //! + //! Effects: Tries to insert x into the container, using "hint" as a hint + //! to where it will be inserted. + //! + //! Complexity: Logarithmic in general, but it is amortized + //! constant time (two comparisons in the worst case) + //! if t is inserted immediately before hint. + //! + //! Throws: Nothing. + //! + //! Note: Does not affect the validity of iterators and references. + //! No copy-constructors are called. + iterator insert_unique(const_iterator hint, reference value) + { + insert_commit_data commit_data; + std::pair ret = this->insert_unique_check(hint, value, this->comp(), commit_data); + if(!ret.second) + return ret.first; + return this->insert_unique_commit(value, commit_data); + } + + //! Requires: Dereferencing iterator must yield an lvalue + //! of type value_type. + //! + //! Effects: Tries to insert each element of a range into the container. + //! + //! Complexity: Insert range is in general O(N * log(N)), where N is the + //! size of the range. However, it is linear in N if the range is already sorted + //! by value_comp(). + //! + //! Throws: Nothing. + //! + //! Note: Does not affect the validity of iterators and references. + //! No copy-constructors are called. + template + void insert_unique(Iterator b, Iterator e) + { + if(this->empty()){ + iterator iend(this->end()); + for (; b != e; ++b) + this->insert_unique(iend, *b); + } + else{ + for (; b != e; ++b) + this->insert_unique(*b); + } + } + + #ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! Requires: key_value_comp must be a comparison function that induces + //! the same strict weak ordering as value_compare. The difference is that + //! key_value_comp compares an arbitrary key with the contained values. + //! + //! Effects: Checks if a value can be inserted in the container, using + //! a user provided key instead of the value itself. + //! + //! Returns: If there is an equivalent value + //! returns a pair containing an iterator to the already present value + //! and false. If the value can be inserted returns true in the returned + //! pair boolean and fills "commit_data" that is meant to be used with + //! the "insert_commit" function. + //! + //! Complexity: Average complexity is at most logarithmic. + //! + //! Throws: If the key_value_comp ordering function throws. Strong guarantee. + //! + //! Notes: This function is used to improve performance when constructing + //! a value_type is expensive: if there is an equivalent value + //! the constructed object must be discarded. Many times, the part of the + //! node that is used to impose the order is much cheaper to construct + //! than the value_type and this function offers the possibility to use that + //! part to check if the insertion will be successful. + //! + //! If the check is successful, the user can construct the value_type and use + //! "insert_commit" to insert the object in constant-time. This gives a total + //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)). + //! + //! "commit_data" remains valid for a subsequent "insert_commit" only if no more + //! objects are inserted or erased from the container. + template + std::pair insert_unique_check + (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data); + + //! Requires: key_value_comp must be a comparison function that induces + //! the same strict weak ordering as value_compare. The difference is that + //! key_value_comp compares an arbitrary key with the contained values. + //! + //! Effects: Checks if a value can be inserted in the container, using + //! a user provided key instead of the value itself, using "hint" + //! as a hint to where it will be inserted. + //! + //! Returns: If there is an equivalent value + //! returns a pair containing an iterator to the already present value + //! and false. If the value can be inserted returns true in the returned + //! pair boolean and fills "commit_data" that is meant to be used with + //! the "insert_commit" function. + //! + //! Complexity: Logarithmic in general, but it's amortized + //! constant time if t is inserted immediately before hint. + //! + //! Throws: If the key_value_comp ordering function throws. Strong guarantee. + //! + //! Notes: This function is used to improve performance when constructing + //! a value_type is expensive: if there is an equivalent value + //! the constructed object must be discarded. Many times, the part of the + //! constructing that is used to impose the order is much cheaper to construct + //! than the value_type and this function offers the possibility to use that key + //! to check if the insertion will be successful. + //! + //! If the check is successful, the user can construct the value_type and use + //! "insert_commit" to insert the object in constant-time. This can give a total + //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)). + //! + //! "commit_data" remains valid for a subsequent "insert_commit" only if no more + //! objects are inserted or erased from the container. + template + std::pair insert_unique_check + (const_iterator hint, const KeyType &key + ,KeyValueCompare key_value_comp, insert_commit_data &commit_data); + + #endif //#ifdef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + + //! Requires: value must be an lvalue of type value_type. commit_data + //! must have been obtained from a previous call to "insert_check". + //! No objects should have been inserted or erased from the container between + //! the "insert_check" that filled "commit_data" and the call to "insert_commit". + //! + //! Effects: Inserts the value in the container using the information obtained + //! from the "commit_data" that a previous "insert_check" filled. + //! + //! Returns: An iterator to the newly inserted object. + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + //! + //! Notes: This function has only sense if a "insert_check" has been + //! previously executed to fill "commit_data". No value should be inserted or + //! erased between the "insert_check" and "insert_commit" calls. + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) + { + node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert)); + node_algorithms::insert_unique_commit + (this->header_ptr(), to_insert, commit_data); + this->sz_traits().increment(); + return iterator(to_insert, this->priv_value_traits_ptr()); + } + + //! Requires: value must be an lvalue, "pos" must be + //! a valid iterator (or end) and must be the succesor of value + //! once inserted according to the predicate + //! + //! Effects: Inserts x into the container before "pos". + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + //! + //! Note: This function does not check preconditions so if "pos" is not + //! the successor of "value" container ordering invariant will be broken. + //! This is a low-level function to be used only for performance reasons + //! by advanced users. + iterator insert_before(const_iterator pos, reference value) + { + node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert)); + this->sz_traits().increment(); + return iterator(node_algorithms::insert_before + (this->header_ptr(), pos.pointed_node(), to_insert), this->priv_value_traits_ptr()); + } + + //! Requires: value must be an lvalue, and it must be no less + //! than the greatest inserted key + //! + //! Effects: Inserts x into the container in the last position. + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + //! + //! Note: This function does not check preconditions so if value is + //! less than the greatest inserted key container ordering invariant will be broken. + //! This function is slightly more efficient than using "insert_before". + //! This is a low-level function to be used only for performance reasons + //! by advanced users. + void push_back(reference value) + { + node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert)); + this->sz_traits().increment(); + node_algorithms::push_back(this->header_ptr(), to_insert); + } + + //! Requires: value must be an lvalue, and it must be no greater + //! than the minimum inserted key + //! + //! Effects: Inserts x into the container in the first position. + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + //! + //! Note: This function does not check preconditions so if value is + //! greater than the minimum inserted key container ordering invariant will be broken. + //! This function is slightly more efficient than using "insert_before". + //! This is a low-level function to be used only for performance reasons + //! by advanced users. + void push_front(reference value) + { + node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert)); + this->sz_traits().increment(); + node_algorithms::push_front(this->header_ptr(), to_insert); + } + + //! Effects: Erases the element pointed to by pos. + //! + //! Complexity: Average complexity for erase element is constant time. + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators (but not the references) + //! to the erased elements. No destructors are called. + iterator erase(const_iterator i) + { + const_iterator ret(i); + ++ret; + node_ptr to_erase(i.pointed_node()); + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!node_algorithms::unique(to_erase)); + node_algorithms::erase(this->header_ptr(), to_erase); + this->sz_traits().decrement(); + if(safemode_or_autounlink) + node_algorithms::init(to_erase); + return ret.unconst(); + } + + //! Effects: Erases the range pointed to by b end e. + //! + //! Complexity: Average complexity for erase range is at most + //! O(log(size() + N)), where N is the number of elements in the range. + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators (but not the references) + //! to the erased elements. No destructors are called. + iterator erase(const_iterator b, const_iterator e) + { size_type n; return this->private_erase(b, e, n); } + + //! Effects: Erases all the elements with the given value. + //! + //! Returns: The number of erased elements. + //! + //! Complexity: O(log(size() + N). + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators (but not the references) + //! to the erased elements. No destructors are called. + size_type erase(const_reference value) + { return this->erase(value, this->comp()); } + + //! Effects: Erases all the elements with the given key. + //! according to the comparison functor "comp". + //! + //! Returns: The number of erased elements. + //! + //! Complexity: O(log(size() + N). + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators (but not the references) + //! to the erased elements. No destructors are called. + template + size_type erase(const KeyType& key, KeyValueCompare comp + /// @cond + , typename detail::enable_if_c::value >::type * = 0 + /// @endcond + ) + { + std::pair p = this->equal_range(key, comp); + size_type n; + this->private_erase(p.first, p.second, n); + return n; + } + + //! Requires: Disposer::operator()(pointer) shouldn't throw. + //! + //! Effects: Erases the element pointed to by pos. + //! Disposer::operator()(pointer) is called for the removed element. + //! + //! Complexity: Average complexity for erase element is constant time. + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators + //! to the erased elements. + template + iterator erase_and_dispose(const_iterator i, Disposer disposer) + { + node_ptr to_erase(i.pointed_node()); + iterator ret(this->erase(i)); + disposer(this->get_value_traits().to_value_ptr(to_erase)); + return ret; + } + + #if !defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + template + iterator erase_and_dispose(iterator i, Disposer disposer) + { return this->erase_and_dispose(const_iterator(i), disposer); } + #endif + + //! Requires: Disposer::operator()(pointer) shouldn't throw. + //! + //! Effects: Erases all the elements with the given value. + //! Disposer::operator()(pointer) is called for the removed elements. + //! + //! Returns: The number of erased elements. + //! + //! Complexity: O(log(size() + N). + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators (but not the references) + //! to the erased elements. No destructors are called. + template + size_type erase_and_dispose(const_reference value, Disposer disposer) + { + std::pair p = this->equal_range(value); + size_type n; + this->private_erase(p.first, p.second, n, disposer); + return n; + } + + //! Requires: Disposer::operator()(pointer) shouldn't throw. + //! + //! Effects: Erases the range pointed to by b end e. + //! Disposer::operator()(pointer) is called for the removed elements. + //! + //! Complexity: Average complexity for erase range is at most + //! O(log(size() + N)), where N is the number of elements in the range. + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators + //! to the erased elements. + template + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) + { size_type n; return this->private_erase(b, e, n, disposer); } + + //! Requires: Disposer::operator()(pointer) shouldn't throw. + //! + //! Effects: Erases all the elements with the given key. + //! according to the comparison functor "comp". + //! Disposer::operator()(pointer) is called for the removed elements. + //! + //! Returns: The number of erased elements. + //! + //! Complexity: O(log(size() + N). + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators + //! to the erased elements. + template + size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer + /// @cond + , typename detail::enable_if_c::value >::type * = 0 + /// @endcond + ) + { + std::pair p = this->equal_range(key, comp); + size_type n; + this->private_erase(p.first, p.second, n, disposer); + return n; + } + + //! Effects: Erases all of the elements. + //! + //! Complexity: Linear to the number of elements on the container. + //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise. + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators (but not the references) + //! to the erased elements. No destructors are called. + void clear() + { + if(safemode_or_autounlink){ + this->clear_and_dispose(detail::null_disposer()); + } + else{ + node_algorithms::init_header(this->header_ptr()); + this->sz_traits().set_size(0); + } + } + + //! Effects: Erases all of the elements calling disposer(p) for + //! each node to be erased. + //! Complexity: Average complexity for is at most O(log(size() + N)), + //! where N is the number of elements in the container. + //! + //! Throws: Nothing. + //! + //! Note: Invalidates the iterators (but not the references) + //! to the erased elements. Calls N times to disposer functor. + template + void clear_and_dispose(Disposer disposer) + { + node_algorithms::clear_and_dispose(this->header_ptr() + , detail::node_disposer(disposer, &this->get_value_traits())); + node_algorithms::init_header(this->header_ptr()); + this->sz_traits().set_size(0); + } + + //! Effects: Returns the number of contained elements with the given value + //! + //! Complexity: Logarithmic to the number of elements contained plus lineal + //! to number of objects with the given value. + //! + //! Throws: If `value_compare` throws. + size_type count(const_reference value) const + { return size_type(this->count(value, this->comp())); } + + //! Effects: Returns the number of contained elements with the given key + //! + //! Complexity: Logarithmic to the number of elements contained plus lineal + //! to number of objects with the given key. + //! + //! Throws: If `comp` throws. + template + size_type count(const KeyType &key, KeyValueCompare comp) const + { + std::pair ret = this->equal_range(key, comp); + size_type n = 0; + for(; ret.first != ret.second; ++ret.first){ ++n; } + return n; + } + + #if !defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + + //Add non-const overloads to theoretically const members + //as some algorithms have different behavior when non-const versions are used (like splay trees). + size_type count(const_reference value) + { return size_type(this->count(value, this->comp())); } + + template + size_type count(const KeyType &key, KeyValueCompare comp) + { + std::pair ret = this->equal_range(key, comp); + size_type n = 0; + for(; ret.first != ret.second; ++ret.first){ ++n; } + return n; + } + + #else //defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + + //! Effects: Returns an iterator to the first element whose + //! key is not less than k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + iterator lower_bound(const_reference value); + + //! Effects: Returns an iterator to the first element whose + //! key is not less than k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + const_iterator lower_bound(const_reference value) const; + + //! Effects: Returns an iterator to the first element whose + //! key is not less than k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + template + iterator lower_bound(const KeyType &key, KeyValueCompare comp); + + //! Effects: Returns a const iterator to the first element whose + //! key is not less than k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + template + const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const; + + //! Effects: Returns an iterator to the first element whose + //! key is greater than k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + iterator upper_bound(const_reference value); + + //! Effects: Returns an iterator to the first element whose + //! key is greater than k according to comp or end() if that element + //! does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + template + iterator upper_bound(const KeyType &key, KeyValueCompare comp); + + //! Effects: Returns an iterator to the first element whose + //! key is greater than k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + const_iterator upper_bound(const_reference value) const; + + //! Effects: Returns an iterator to the first element whose + //! key is greater than k according to comp or end() if that element + //! does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + template + const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const; + + //! Effects: Finds an iterator to the first element whose key is + //! k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + iterator find(const_reference value); + + //! Effects: Finds an iterator to the first element whose key is + //! k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + template + iterator find(const KeyType &key, KeyValueCompare comp); + + //! Effects: Finds a const_iterator to the first element whose key is + //! k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + const_iterator find(const_reference value) const; + + //! Effects: Finds a const_iterator to the first element whose key is + //! k or end() if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + template + const_iterator find(const KeyType &key, KeyValueCompare comp) const; + + //! Effects: Finds a range containing all elements whose key is k or + //! an empty range that indicates the position where those elements would be + //! if they there is no elements with key k. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + std::pair equal_range(const_reference value); + + //! Effects: Finds a range containing all elements whose key is k or + //! an empty range that indicates the position where those elements would be + //! if they there is no elements with key k. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + template + std::pair equal_range(const KeyType &key, KeyValueCompare comp); + + //! Effects: Finds a range containing all elements whose key is k or + //! an empty range that indicates the position where those elements would be + //! if they there is no elements with key k. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + std::pair + equal_range(const_reference value) const; + + //! Effects: Finds a range containing all elements whose key is k or + //! an empty range that indicates the position where those elements would be + //! if they there is no elements with key k. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + template + std::pair + equal_range(const KeyType &key, KeyValueCompare comp) const; + + //! Requires: 'lower_value' must not be greater than 'upper_value'. If + //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false. + //! + //! Effects: Returns an a pair with the following criteria: + //! + //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise + //! + //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + //! + //! Note: This function can be more efficient than calling upper_bound + //! and lower_bound for lower_value and upper_value. + //! + //! Note: Experimental function, the interface might change in future releases. + std::pair bounded_range + (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed); + + //! Requires: KeyValueCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the container. + //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If + //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false. + //! + //! Effects: Returns an a pair with the following criteria: + //! + //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise + //! + //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + //! + //! Note: This function can be more efficient than calling upper_bound + //! and lower_bound for lower_key and upper_key. + //! + //! Note: Experimental function, the interface might change in future releases. + template + std::pair bounded_range + (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed); + + //! Requires: 'lower_value' must not be greater than 'upper_value'. If + //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false. + //! + //! Effects: Returns an a pair with the following criteria: + //! + //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise + //! + //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `value_compare` throws. + //! + //! Note: This function can be more efficient than calling upper_bound + //! and lower_bound for lower_value and upper_value. + //! + //! Note: Experimental function, the interface might change in future releases. + std::pair bounded_range + (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const; + + //! Requires: KeyValueCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the container. + //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If + //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false. + //! + //! Effects: Returns an a pair with the following criteria: + //! + //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise + //! + //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise + //! + //! Complexity: Logarithmic. + //! + //! Throws: If `comp` throws. + //! + //! Note: This function can be more efficient than calling upper_bound + //! and lower_bound for lower_key and upper_key. + //! + //! Note: Experimental function, the interface might change in future releases. + template + std::pair bounded_range + (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const; + + //! Requires: value must be an lvalue and shall be in a set of + //! appropriate type. Otherwise the behavior is undefined. + //! + //! Effects: Returns: a valid iterator i belonging to the set + //! that points to the value + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + //! + //! Note: This static function is available only if the value traits + //! is stateless. + static iterator s_iterator_to(reference value); + + //! Requires: value must be an lvalue and shall be in a set of + //! appropriate type. Otherwise the behavior is undefined. + //! + //! Effects: Returns: a valid const_iterator i belonging to the + //! set that points to the value + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + //! + //! Note: This static function is available only if the value traits + //! is stateless. + static const_iterator s_iterator_to(const_reference value); + + //! Requires: value must be an lvalue and shall be in a set of + //! appropriate type. Otherwise the behavior is undefined. + //! + //! Effects: Returns: a valid iterator i belonging to the set + //! that points to the value + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + iterator iterator_to(reference value); + + //! Requires: value must be an lvalue and shall be in a set of + //! appropriate type. Otherwise the behavior is undefined. + //! + //! Effects: Returns: a valid const_iterator i belonging to the + //! set that points to the value + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + const_iterator iterator_to(const_reference value) const; + + //! Requires: value shall not be in a container. + //! + //! Effects: init_node puts the hook of a value in a well-known default + //! state. + //! + //! Throws: Nothing. + //! + //! Complexity: Constant time. + //! + //! Note: This function puts the hook in the well-known default state + //! used by auto_unlink and safe hooks. + static void init_node(reference value); + + #endif //#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + + //! Effects: Unlinks the leftmost node from the container. + //! + //! Complexity: Average complexity is constant time. + //! + //! Throws: Nothing. + //! + //! Notes: This function breaks the container and the container can + //! only be used for more unlink_leftmost_without_rebalance calls. + //! This function is normally used to achieve a step by step + //! controlled destruction of the container. + pointer unlink_leftmost_without_rebalance() + { + node_ptr to_be_disposed(node_algorithms::unlink_leftmost_without_rebalance + (this->header_ptr())); + if(!to_be_disposed) + return 0; + this->sz_traits().decrement(); + if(safemode_or_autounlink)//If this is commented does not work with normal_link + node_algorithms::init(to_be_disposed); + return this->get_value_traits().to_value_ptr(to_be_disposed); + } + + #if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + + //! Requires: replace_this must be a valid iterator of *this + //! and with_this must not be inserted in any container. + //! + //! Effects: Replaces replace_this in its position in the + //! container with with_this. The container does not need to be rebalanced. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + //! + //! Note: This function will break container ordering invariants if + //! with_this is not equivalent to *replace_this according to the + //! ordering rules. This function is faster than erasing and inserting + //! the node, since no rebalancing or comparison is needed. + void replace_node(iterator replace_this, reference with_this); + + //! Effects: Rebalances the tree. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear. + void rebalance(); + + //! Requires: old_root is a node of a tree. + //! + //! Effects: Rebalances the subtree rooted at old_root. + //! + //! Returns: The new root of the subtree. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the elements in the subtree. + iterator rebalance_subtree(iterator root); + + #endif //#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) + + //! Effects: removes "value" from the container. + //! + //! Throws: Nothing. + //! + //! Complexity: Logarithmic time. + //! + //! Note: This static function is only usable with non-constant + //! time size containers that have stateless comparison functors. + //! + //! If the user calls + //! this function with a constant time size container or stateful comparison + //! functor a compilation error will be issued. + static void remove_node(reference value) + { + AUTOBOOST_STATIC_ASSERT((!constant_time_size)); + node_ptr to_remove(value_traits::to_node_ptr(value)); + node_algorithms::unlink(to_remove); + if(safemode_or_autounlink) + node_algorithms::init(to_remove); + } + + //! Effects: Asserts the integrity of the container with additional checks provided by the user. + //! + //! Complexity: Linear time. + //! + //! Note: The method might not have effect when asserts are turned off (e.g., with NDEBUG). + //! Experimental function, interface might change in future versions. + template + void check(ExtraChecker extra_checker) const + { + typedef detail::key_nodeptr_comp nodeptr_comp_t; + nodeptr_comp_t nodeptr_comp(this->comp(), &this->get_value_traits()); + typedef typename get_node_checker::type node_checker_t; + typename node_checker_t::return_type checker_return; + node_algorithms::check(this->header_ptr(), node_checker_t(nodeptr_comp, extra_checker), checker_return); + if (constant_time_size) + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(this->sz_traits().get_size() == checker_return.node_count); + } + + //! Effects: Asserts the integrity of the container. + //! + //! Complexity: Linear time. + //! + //! Note: The method has no effect when asserts are turned off (e.g., with NDEBUG). + //! Experimental function, interface might change in future versions. + void check() const + { + check(detail::empty_node_checker()); + } + + /// @cond + private: + template + iterator private_erase(const_iterator b, const_iterator e, size_type &n, Disposer disposer) + { + for(n = 0; b != e; ++n) + this->erase_and_dispose(b++, disposer); + return b.unconst(); + } + + iterator private_erase(const_iterator b, const_iterator e, size_type &n) + { + for(n = 0; b != e; ++n) + this->erase(b++); + return b.unconst(); + } + /// @endcond +}; + +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +inline bool operator< +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +(const bstree_impl &x, const bstree_impl &y) +#else +( const bstree_impl &x +, const bstree_impl &y) +#endif +{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); } + +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +bool operator== +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +(const bstree_impl &x, const bstree_impl &y) +#else +( const bstree_impl &x +, const bstree_impl &y) +#endif +{ + typedef bstree_impl tree_type; + typedef typename tree_type::const_iterator const_iterator; + + if(tree_type::constant_time_size && x.size() != y.size()){ + return false; + } + const_iterator end1 = x.end(); + const_iterator i1 = x.begin(); + const_iterator i2 = y.begin(); + if(tree_type::constant_time_size){ + while (i1 != end1 && *i1 == *i2) { + ++i1; + ++i2; + } + return i1 == end1; + } + else{ + const_iterator end2 = y.end(); + while (i1 != end1 && i2 != end2 && *i1 == *i2) { + ++i1; + ++i2; + } + return i1 == end1 && i2 == end2; + } +} + +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +inline bool operator!= +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +(const bstree_impl &x, const bstree_impl &y) +#else +( const bstree_impl &x +, const bstree_impl &y) +#endif +{ return !(x == y); } + +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +inline bool operator> +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +(const bstree_impl &x, const bstree_impl &y) +#else +( const bstree_impl &x +, const bstree_impl &y) +#endif +{ return y < x; } + +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +inline bool operator<= +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +(const bstree_impl &x, const bstree_impl &y) +#else +( const bstree_impl &x +, const bstree_impl &y) +#endif +{ return !(y < x); } + +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +inline bool operator>= +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +(const bstree_impl &x, const bstree_impl &y) +#else +( const bstree_impl &x +, const bstree_impl &y) +#endif +{ return !(x < y); } + +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +template +#else +template +#endif +inline void swap +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) +(bstree_impl &x, bstree_impl &y) +#else +( bstree_impl &x +, bstree_impl &y) +#endif +{ x.swap(y); } + +//! Helper metafunction to define a \c bstree that yields to the same type when the +//! same options (either explicitly or implicitly) are used. +#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +struct make_bstree +{ + /// @cond + typedef typename pack_options + < bstree_defaults, + #if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) + O1, O2, O3, O4, O5 + #else + Options... + #endif + >::type packed_options; + + typedef typename detail::get_value_traits + ::type value_traits; + typedef typename detail::get_header_holder_type + < value_traits, typename packed_options::header_holder_type >::type header_holder_type; + + typedef bstree_impl + < value_traits + , typename packed_options::compare + , typename packed_options::size_type + , packed_options::constant_time_size + , BsTreeAlgorithms + , header_holder_type + > implementation_defined; + /// @endcond + typedef implementation_defined type; +}; + + +#ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + +#if !defined(AUTOBOOST_INTRUSIVE_VARIADIC_TEMPLATES) +template +#else +template +#endif +class bstree + : public make_bstree::type +{ + typedef typename make_bstree + ::type Base; + AUTOBOOST_MOVABLE_BUT_NOT_COPYABLE(bstree) + + public: + typedef typename Base::value_compare value_compare; + typedef typename Base::value_traits value_traits; + typedef typename Base::iterator iterator; + typedef typename Base::const_iterator const_iterator; + + //Assert if passed value traits are compatible with the type + AUTOBOOST_STATIC_ASSERT((detail::is_same::value)); + + bstree( const value_compare &cmp = value_compare() + , const value_traits &v_traits = value_traits()) + : Base(cmp, v_traits) + {} + + template + bstree( bool unique, Iterator b, Iterator e + , const value_compare &cmp = value_compare() + , const value_traits &v_traits = value_traits()) + : Base(unique, b, e, cmp, v_traits) + {} + + bstree(AUTOBOOST_RV_REF(bstree) x) + : Base(::autoboost::move(static_cast(x))) + {} + + bstree& operator=(AUTOBOOST_RV_REF(bstree) x) + { return static_cast(this->Base::operator=(::autoboost::move(static_cast(x)))); } + + static bstree &container_from_end_iterator(iterator end_iterator) + { return static_cast(Base::container_from_end_iterator(end_iterator)); } + + static const bstree &container_from_end_iterator(const_iterator end_iterator) + { return static_cast(Base::container_from_end_iterator(end_iterator)); } + + static bstree &container_from_iterator(iterator it) + { return static_cast(Base::container_from_iterator(it)); } + + static const bstree &container_from_iterator(const_iterator it) + { return static_cast(Base::container_from_iterator(it)); } +}; + +#endif +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_BSTREE_HPP diff --git a/contrib/autoboost/autoboost/intrusive/bstree_algorithms.hpp b/contrib/autoboost/autoboost/intrusive/bstree_algorithms.hpp new file mode 100644 index 000000000..28f50771d --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/bstree_algorithms.hpp @@ -0,0 +1,2127 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2007-2014 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_BSTREE_ALGORITHMS_HPP +#define AUTOBOOST_INTRUSIVE_BSTREE_ALGORITHMS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { + +/// @cond + +//! This type is the information that will be filled by insert_unique_check +template +struct insert_commit_data_t +{ + insert_commit_data_t() + : link_left(false) + , node() + {} + bool link_left; + NodePtr node; +}; + +template +struct data_for_rebalance_t +{ + NodePtr x; + NodePtr x_parent; + NodePtr y; +}; + +namespace detail { + +template +struct bstree_node_checker + : public ExtraChecker +{ + typedef ExtraChecker base_checker_t; + typedef ValueTraits value_traits; + typedef typename value_traits::node_traits node_traits; + typedef typename node_traits::const_node_ptr const_node_ptr; + + struct return_type + : public base_checker_t::return_type + { + return_type() : min_key_node_ptr(const_node_ptr()), max_key_node_ptr(const_node_ptr()), node_count(0) {} + + const_node_ptr min_key_node_ptr; + const_node_ptr max_key_node_ptr; + size_t node_count; + }; + + bstree_node_checker(const NodePtrCompare& comp, ExtraChecker extra_checker) + : base_checker_t(extra_checker), comp_(comp) + {} + + void operator () (const const_node_ptr& p, + const return_type& check_return_left, const return_type& check_return_right, + return_type& check_return) + { + if (check_return_left.max_key_node_ptr) + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(!comp_(p, check_return_left.max_key_node_ptr)); + if (check_return_right.min_key_node_ptr) + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(!comp_(check_return_right.min_key_node_ptr, p)); + check_return.min_key_node_ptr = node_traits::get_left(p)? check_return_left.min_key_node_ptr : p; + check_return.max_key_node_ptr = node_traits::get_right(p)? check_return_right.max_key_node_ptr : p; + check_return.node_count = check_return_left.node_count + check_return_right.node_count + 1; + base_checker_t::operator()(p, check_return_left, check_return_right, check_return); + } + + const NodePtrCompare comp_; +}; + +} // namespace detail + +/// @endcond + + + +//! This is an implementation of a binary search tree. +//! A node in the search tree has references to its children and its parent. This +//! is to allow traversal of the whole tree from a given node making the +//! implementation of iterator a pointer to a node. +//! At the top of the tree a node is used specially. This node's parent pointer +//! is pointing to the root of the tree. Its left pointer points to the +//! leftmost node in the tree and the right pointer to the rightmost one. +//! This node is used to represent the end-iterator. +//! +//! +---------+ +//! header------------------------------>| | +//! | | +//! +----------(left)--------| |--------(right)---------+ +//! | +---------+ | +//! | | | +//! | | (parent) | +//! | | | +//! | | | +//! | +---------+ | +//! root of tree ..|......................> | | | +//! | | D | | +//! | | | | +//! | +-------+---------+-------+ | +//! | | | | +//! | | | | +//! | | | | +//! | | | | +//! | | | | +//! | +---------+ +---------+ | +//! | | | | | | +//! | | B | | F | | +//! | | | | | | +//! | +--+---------+--+ +--+---------+--+ | +//! | | | | | | +//! | | | | | | +//! | | | | | | +//! | +---+-----+ +-----+---+ +---+-----+ +-----+---+ | +//! +-->| | | | | | | |<--+ +//! | A | | C | | E | | G | +//! | | | | | | | | +//! +---------+ +---------+ +---------+ +---------+ +//! +//! bstree_algorithms is configured with a NodeTraits class, which encapsulates the +//! information about the node to be manipulated. NodeTraits must support the +//! following interface: +//! +//! Typedefs: +//! +//! node: The type of the node that forms the binary search tree +//! +//! node_ptr: A pointer to a node +//! +//! const_node_ptr: A pointer to a const node +//! +//! Static functions: +//! +//! static node_ptr get_parent(const_node_ptr n); +//! +//! static void set_parent(node_ptr n, node_ptr parent); +//! +//! static node_ptr get_left(const_node_ptr n); +//! +//! static void set_left(node_ptr n, node_ptr left); +//! +//! static node_ptr get_right(const_node_ptr n); +//! +//! static void set_right(node_ptr n, node_ptr right); +template +class bstree_algorithms +{ + public: + typedef typename NodeTraits::node node; + typedef NodeTraits node_traits; + typedef typename NodeTraits::node_ptr node_ptr; + typedef typename NodeTraits::const_node_ptr const_node_ptr; + typedef insert_commit_data_t insert_commit_data; + typedef data_for_rebalance_t data_for_rebalance; + + /// @cond + + private: + template + struct dispose_subtree_disposer + { + dispose_subtree_disposer(Disposer &disp, const node_ptr & subtree) + : disposer_(&disp), subtree_(subtree) + {} + + void release() + { disposer_ = 0; } + + ~dispose_subtree_disposer() + { + if(disposer_){ + dispose_subtree(subtree_, *disposer_); + } + } + Disposer *disposer_; + const node_ptr subtree_; + }; + + /// @endcond + + public: + //! Requires: 'header' is the header node of a tree. + //! + //! Effects: Returns the first node of the tree, the header if the tree is empty. + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + static node_ptr begin_node(const const_node_ptr & header) + { return node_traits::get_left(header); } + + //! Requires: 'header' is the header node of a tree. + //! + //! Effects: Returns the header of the tree. + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + static node_ptr end_node(const const_node_ptr & header) + { return detail::uncast(header); } + + //! Requires: 'header' is the header node of a tree. + //! + //! Effects: Returns the root of the tree if any, header otherwise + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + static node_ptr root_node(const const_node_ptr & header) + { + node_ptr p = node_traits::get_parent(header); + return p ? p : detail::uncast(header); + } + + //! Requires: 'node' is a node of the tree or a node initialized + //! by init(...) or init_node. + //! + //! Effects: Returns true if the node is initialized by init() or init_node(). + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + static bool unique(const const_node_ptr & node) + { return !NodeTraits::get_parent(node); } + + //! Requires: 'node' is a node of the tree or a header node. + //! + //! Effects: Returns the header of the tree. + //! + //! Complexity: Logarithmic. + //! + //! Throws: Nothing. + static node_ptr get_header(const const_node_ptr & node) + { + node_ptr n(detail::uncast(node)); + node_ptr p(NodeTraits::get_parent(node)); + //If p is null, then n is the header of an empty tree + if(p){ + //Non-empty tree, check if n is neither root nor header + node_ptr pp(NodeTraits::get_parent(p)); + //If granparent is not equal to n, then n is neither root nor header, + //the try the fast path + if(n != pp){ + do{ + n = p; + p = pp; + pp = NodeTraits::get_parent(pp); + }while(n != pp); + n = p; + } + //Check if n is root or header when size() > 0 + else if(!is_header(n)){ + n = p; + } + } + return n; + /* + node_ptr h = detail::uncast(node); + node_ptr p = NodeTraits::get_parent(node); + if(p){ + while(!is_header(p)) + p = NodeTraits::get_parent(p); + return p; + } + else{ + return h; + }*/ + } + + //! Requires: node1 and node2 can't be header nodes + //! of two trees. + //! + //! Effects: Swaps two nodes. After the function node1 will be inserted + //! in the position node2 before the function. node2 will be inserted in the + //! position node1 had before the function. + //! + //! Complexity: Logarithmic. + //! + //! Throws: Nothing. + //! + //! Note: This function will break container ordering invariants if + //! node1 and node2 are not equivalent according to the ordering rules. + //! + //!Experimental function + static void swap_nodes(const node_ptr & node1, const node_ptr & node2) + { + if(node1 == node2) + return; + + node_ptr header1(get_header(node1)), header2(get_header(node2)); + swap_nodes(node1, header1, node2, header2); + } + + //! Requires: node1 and node2 can't be header nodes + //! of two trees with header header1 and header2. + //! + //! Effects: Swaps two nodes. After the function node1 will be inserted + //! in the position node2 before the function. node2 will be inserted in the + //! position node1 had before the function. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + //! + //! Note: This function will break container ordering invariants if + //! node1 and node2 are not equivalent according to the ordering rules. + //! + //!Experimental function + static void swap_nodes(const node_ptr & node1, const node_ptr & header1, const node_ptr & node2, const node_ptr & header2) + { + if(node1 == node2) + return; + + //node1 and node2 must not be header nodes + //AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT((header1 != node1 && header2 != node2)); + if(header1 != header2){ + //Update header1 if necessary + if(node1 == NodeTraits::get_left(header1)){ + NodeTraits::set_left(header1, node2); + } + + if(node1 == NodeTraits::get_right(header1)){ + NodeTraits::set_right(header1, node2); + } + + if(node1 == NodeTraits::get_parent(header1)){ + NodeTraits::set_parent(header1, node2); + } + + //Update header2 if necessary + if(node2 == NodeTraits::get_left(header2)){ + NodeTraits::set_left(header2, node1); + } + + if(node2 == NodeTraits::get_right(header2)){ + NodeTraits::set_right(header2, node1); + } + + if(node2 == NodeTraits::get_parent(header2)){ + NodeTraits::set_parent(header2, node1); + } + } + else{ + //If both nodes are from the same tree + //Update header if necessary + if(node1 == NodeTraits::get_left(header1)){ + NodeTraits::set_left(header1, node2); + } + else if(node2 == NodeTraits::get_left(header2)){ + NodeTraits::set_left(header2, node1); + } + + if(node1 == NodeTraits::get_right(header1)){ + NodeTraits::set_right(header1, node2); + } + else if(node2 == NodeTraits::get_right(header2)){ + NodeTraits::set_right(header2, node1); + } + + if(node1 == NodeTraits::get_parent(header1)){ + NodeTraits::set_parent(header1, node2); + } + else if(node2 == NodeTraits::get_parent(header2)){ + NodeTraits::set_parent(header2, node1); + } + + //Adjust data in nodes to be swapped + //so that final link swap works as expected + if(node1 == NodeTraits::get_parent(node2)){ + NodeTraits::set_parent(node2, node2); + + if(node2 == NodeTraits::get_right(node1)){ + NodeTraits::set_right(node1, node1); + } + else{ + NodeTraits::set_left(node1, node1); + } + } + else if(node2 == NodeTraits::get_parent(node1)){ + NodeTraits::set_parent(node1, node1); + + if(node1 == NodeTraits::get_right(node2)){ + NodeTraits::set_right(node2, node2); + } + else{ + NodeTraits::set_left(node2, node2); + } + } + } + + //Now swap all the links + node_ptr temp; + //swap left link + temp = NodeTraits::get_left(node1); + NodeTraits::set_left(node1, NodeTraits::get_left(node2)); + NodeTraits::set_left(node2, temp); + //swap right link + temp = NodeTraits::get_right(node1); + NodeTraits::set_right(node1, NodeTraits::get_right(node2)); + NodeTraits::set_right(node2, temp); + //swap parent link + temp = NodeTraits::get_parent(node1); + NodeTraits::set_parent(node1, NodeTraits::get_parent(node2)); + NodeTraits::set_parent(node2, temp); + + //Now adjust adjacent nodes for newly inserted node 1 + if((temp = NodeTraits::get_left(node1))){ + NodeTraits::set_parent(temp, node1); + } + if((temp = NodeTraits::get_right(node1))){ + NodeTraits::set_parent(temp, node1); + } + if((temp = NodeTraits::get_parent(node1)) && + //The header has been already updated so avoid it + temp != header2){ + if(NodeTraits::get_left(temp) == node2){ + NodeTraits::set_left(temp, node1); + } + if(NodeTraits::get_right(temp) == node2){ + NodeTraits::set_right(temp, node1); + } + } + //Now adjust adjacent nodes for newly inserted node 2 + if((temp = NodeTraits::get_left(node2))){ + NodeTraits::set_parent(temp, node2); + } + if((temp = NodeTraits::get_right(node2))){ + NodeTraits::set_parent(temp, node2); + } + if((temp = NodeTraits::get_parent(node2)) && + //The header has been already updated so avoid it + temp != header1){ + if(NodeTraits::get_left(temp) == node1){ + NodeTraits::set_left(temp, node2); + } + if(NodeTraits::get_right(temp) == node1){ + NodeTraits::set_right(temp, node2); + } + } + } + + //! Requires: node_to_be_replaced must be inserted in a tree + //! and new_node must not be inserted in a tree. + //! + //! Effects: Replaces node_to_be_replaced in its position in the + //! tree with new_node. The tree does not need to be rebalanced + //! + //! Complexity: Logarithmic. + //! + //! Throws: Nothing. + //! + //! Note: This function will break container ordering invariants if + //! new_node is not equivalent to node_to_be_replaced according to the + //! ordering rules. This function is faster than erasing and inserting + //! the node, since no rebalancing and comparison is needed. Experimental function + static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & new_node) + { + if(node_to_be_replaced == new_node) + return; + replace_node(node_to_be_replaced, get_header(node_to_be_replaced), new_node); + } + + //! Requires: node_to_be_replaced must be inserted in a tree + //! with header "header" and new_node must not be inserted in a tree. + //! + //! Effects: Replaces node_to_be_replaced in its position in the + //! tree with new_node. The tree does not need to be rebalanced + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + //! + //! Note: This function will break container ordering invariants if + //! new_node is not equivalent to node_to_be_replaced according to the + //! ordering rules. This function is faster than erasing and inserting + //! the node, since no rebalancing or comparison is needed. Experimental function + static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node) + { + if(node_to_be_replaced == new_node) + return; + + //Update header if necessary + if(node_to_be_replaced == NodeTraits::get_left(header)){ + NodeTraits::set_left(header, new_node); + } + + if(node_to_be_replaced == NodeTraits::get_right(header)){ + NodeTraits::set_right(header, new_node); + } + + if(node_to_be_replaced == NodeTraits::get_parent(header)){ + NodeTraits::set_parent(header, new_node); + } + + //Now set data from the original node + node_ptr temp; + NodeTraits::set_left(new_node, NodeTraits::get_left(node_to_be_replaced)); + NodeTraits::set_right(new_node, NodeTraits::get_right(node_to_be_replaced)); + NodeTraits::set_parent(new_node, NodeTraits::get_parent(node_to_be_replaced)); + + //Now adjust adjacent nodes for newly inserted node + if((temp = NodeTraits::get_left(new_node))){ + NodeTraits::set_parent(temp, new_node); + } + if((temp = NodeTraits::get_right(new_node))){ + NodeTraits::set_parent(temp, new_node); + } + if((temp = NodeTraits::get_parent(new_node)) && + //The header has been already updated so avoid it + temp != header){ + if(NodeTraits::get_left(temp) == node_to_be_replaced){ + NodeTraits::set_left(temp, new_node); + } + if(NodeTraits::get_right(temp) == node_to_be_replaced){ + NodeTraits::set_right(temp, new_node); + } + } + } + + //! Requires: 'node' is a node from the tree except the header. + //! + //! Effects: Returns the next node of the tree. + //! + //! Complexity: Average constant time. + //! + //! Throws: Nothing. + static node_ptr next_node(const node_ptr & node) + { + node_ptr const n_right(NodeTraits::get_right(node)); + if(n_right){ + return minimum(n_right); + } + else { + node_ptr n(node); + node_ptr p(NodeTraits::get_parent(n)); + while(n == NodeTraits::get_right(p)){ + n = p; + p = NodeTraits::get_parent(p); + } + return NodeTraits::get_right(n) != p ? p : n; + } + } + + //! Requires: 'node' is a node from the tree except the leftmost node. + //! + //! Effects: Returns the previous node of the tree. + //! + //! Complexity: Average constant time. + //! + //! Throws: Nothing. + static node_ptr prev_node(const node_ptr & node) + { + if(is_header(node)){ + return NodeTraits::get_right(node); + //return maximum(NodeTraits::get_parent(node)); + } + else if(NodeTraits::get_left(node)){ + return maximum(NodeTraits::get_left(node)); + } + else { + node_ptr p(node); + node_ptr x = NodeTraits::get_parent(p); + while(p == NodeTraits::get_left(x)){ + p = x; + x = NodeTraits::get_parent(x); + } + return x; + } + } + + //! Requires: 'node' is a node of a tree but not the header. + //! + //! Effects: Returns the minimum node of the subtree starting at p. + //! + //! Complexity: Logarithmic to the size of the subtree. + //! + //! Throws: Nothing. + static node_ptr minimum(node_ptr node) + { + for(node_ptr p_left = NodeTraits::get_left(node) + ;p_left + ;p_left = NodeTraits::get_left(node)){ + node = p_left; + } + return node; + } + + //! Requires: 'node' is a node of a tree but not the header. + //! + //! Effects: Returns the maximum node of the subtree starting at p. + //! + //! Complexity: Logarithmic to the size of the subtree. + //! + //! Throws: Nothing. + static node_ptr maximum(node_ptr node) + { + for(node_ptr p_right = NodeTraits::get_right(node) + ;p_right + ;p_right = NodeTraits::get_right(node)){ + node = p_right; + } + return node; + } + + //! Requires: 'node' must not be part of any tree. + //! + //! Effects: After the function unique(node) == true. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + //! + //! Nodes: If node is inserted in a tree, this function corrupts the tree. + static void init(const node_ptr & node) + { + NodeTraits::set_parent(node, node_ptr()); + NodeTraits::set_left(node, node_ptr()); + NodeTraits::set_right(node, node_ptr()); + }; + + //! Effects: Returns true if node is in the same state as if called init(node) + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + static bool inited(const const_node_ptr & node) + { + return !NodeTraits::get_parent(node) && + !NodeTraits::get_left(node) && + !NodeTraits::get_right(node) ; + }; + + //! Requires: node must not be part of any tree. + //! + //! Effects: Initializes the header to represent an empty tree. + //! unique(header) == true. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + //! + //! Nodes: If node is inserted in a tree, this function corrupts the tree. + static void init_header(const node_ptr & header) + { + NodeTraits::set_parent(header, node_ptr()); + NodeTraits::set_left(header, header); + NodeTraits::set_right(header, header); + } + + //! Requires: "disposer" must be an object function + //! taking a node_ptr parameter and shouldn't throw. + //! + //! Effects: Empties the target tree calling + //! void disposer::operator()(const node_ptr &) for every node of the tree + //! except the header. + //! + //! Complexity: Linear to the number of element of the source tree plus the. + //! number of elements of tree target tree when calling this function. + //! + //! Throws: If cloner functor throws. If this happens target nodes are disposed. + template + static void clear_and_dispose(const node_ptr & header, Disposer disposer) + { + node_ptr source_root = NodeTraits::get_parent(header); + if(!source_root) + return; + dispose_subtree(source_root, disposer); + init_header(header); + } + + //! Requires: header is the header of a tree. + //! + //! Effects: Unlinks the leftmost node from the tree, and + //! updates the header link to the new leftmost node. + //! + //! Complexity: Average complexity is constant time. + //! + //! Throws: Nothing. + //! + //! Notes: This function breaks the tree and the tree can + //! only be used for more unlink_leftmost_without_rebalance calls. + //! This function is normally used to achieve a step by step + //! controlled destruction of the tree. + static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header) + { + node_ptr leftmost = NodeTraits::get_left(header); + if (leftmost == header) + return node_ptr(); + node_ptr leftmost_parent(NodeTraits::get_parent(leftmost)); + node_ptr leftmost_right (NodeTraits::get_right(leftmost)); + bool is_root = leftmost_parent == header; + + if (leftmost_right){ + NodeTraits::set_parent(leftmost_right, leftmost_parent); + NodeTraits::set_left(header, bstree_algorithms::minimum(leftmost_right)); + + if (is_root) + NodeTraits::set_parent(header, leftmost_right); + else + NodeTraits::set_left(NodeTraits::get_parent(header), leftmost_right); + } + else if (is_root){ + NodeTraits::set_parent(header, node_ptr()); + NodeTraits::set_left(header, header); + NodeTraits::set_right(header, header); + } + else{ + NodeTraits::set_left(leftmost_parent, node_ptr()); + NodeTraits::set_left(header, leftmost_parent); + } + return leftmost; + } + + //! Requires: node is a node of the tree but it's not the header. + //! + //! Effects: Returns the number of nodes of the subtree. + //! + //! Complexity: Linear time. + //! + //! Throws: Nothing. + static std::size_t size(const const_node_ptr & header) + { + node_ptr beg(begin_node(header)); + node_ptr end(end_node(header)); + std::size_t i = 0; + for(;beg != end; beg = next_node(beg)) ++i; + return i; + } + + //! Requires: header1 and header2 must be the header nodes + //! of two trees. + //! + //! Effects: Swaps two trees. After the function header1 will contain + //! links to the second tree and header2 will have links to the first tree. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + static void swap_tree(const node_ptr & header1, const node_ptr & header2) + { + if(header1 == header2) + return; + + node_ptr tmp; + + //Parent swap + tmp = NodeTraits::get_parent(header1); + NodeTraits::set_parent(header1, NodeTraits::get_parent(header2)); + NodeTraits::set_parent(header2, tmp); + //Left swap + tmp = NodeTraits::get_left(header1); + NodeTraits::set_left(header1, NodeTraits::get_left(header2)); + NodeTraits::set_left(header2, tmp); + //Right swap + tmp = NodeTraits::get_right(header1); + NodeTraits::set_right(header1, NodeTraits::get_right(header2)); + NodeTraits::set_right(header2, tmp); + + //Now test parent + node_ptr h1_parent(NodeTraits::get_parent(header1)); + if(h1_parent){ + NodeTraits::set_parent(h1_parent, header1); + } + else{ + NodeTraits::set_left(header1, header1); + NodeTraits::set_right(header1, header1); + } + + node_ptr h2_parent(NodeTraits::get_parent(header2)); + if(h2_parent){ + NodeTraits::set_parent(h2_parent, header2); + } + else{ + NodeTraits::set_left(header2, header2); + NodeTraits::set_right(header2, header2); + } + } + + //! Requires: p is a node of a tree. + //! + //! Effects: Returns true if p is the header of the tree. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + static bool is_header(const const_node_ptr & p) + { + node_ptr p_left (NodeTraits::get_left(p)); + node_ptr p_right(NodeTraits::get_right(p)); + if(!NodeTraits::get_parent(p) || //Header condition when empty tree + (p_left && p_right && //Header always has leftmost and rightmost + (p_left == p_right || //Header condition when only node + (NodeTraits::get_parent(p_left) != p || + NodeTraits::get_parent(p_right) != p )) + //When tree size > 1 headers can't be leftmost's + //and rightmost's parent + )){ + return true; + } + return false; + } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. + //! + //! Effects: Returns a node_ptr to the first element that is equivalent to + //! "key" according to "comp" or "header" if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If "comp" throws. + template + static node_ptr find + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + { + node_ptr end = detail::uncast(header); + node_ptr y = lower_bound(header, key, comp); + return (y == end || comp(key, y)) ? end : y; + } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. + //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If + //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false. + //! + //! Effects: Returns an a pair with the following criteria: + //! + //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise + //! + //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise + //! + //! Complexity: Logarithmic. + //! + //! Throws: If "comp" throws. + //! + //! Note: This function can be more efficient than calling upper_bound + //! and lower_bound for lower_key and upper_key. + //! + //! Note: Experimental function, the interface might change. + template< class KeyType, class KeyNodePtrCompare> + static std::pair bounded_range + ( const const_node_ptr & header + , const KeyType &lower_key + , const KeyType &upper_key + , KeyNodePtrCompare comp + , bool left_closed + , bool right_closed) + { + node_ptr y = detail::uncast(header); + node_ptr x = NodeTraits::get_parent(header); + + while(x){ + //If x is less than lower_key the target + //range is on the right part + if(comp(x, lower_key)){ + //Check for invalid input range + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(comp(x, upper_key)); + x = NodeTraits::get_right(x); + } + //If the upper_key is less than x, the target + //range is on the left part + else if(comp(upper_key, x)){ + y = x; + x = NodeTraits::get_left(x); + } + else{ + //x is inside the bounded range( x >= lower_key && x <= upper_key), + //so we must split lower and upper searches + // + //Sanity check: if lower_key and upper_key are equal, then both left_closed and right_closed can't be false + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(left_closed || right_closed || comp(lower_key, x) || comp(x, upper_key)); + return std::pair( + left_closed + //If left_closed, then comp(x, lower_key) is already the lower_bound + //condition so we save one comparison and go to the next level + //following traditional lower_bound algo + ? lower_bound_loop(NodeTraits::get_left(x), x, lower_key, comp) + //If left-open, comp(x, lower_key) is not the upper_bound algo + //condition so we must recheck current 'x' node with upper_bound algo + : upper_bound_loop(x, y, lower_key, comp) + , + right_closed + //If right_closed, then comp(upper_key, x) is already the upper_bound + //condition so we can save one comparison and go to the next level + //following lower_bound algo + ? upper_bound_loop(NodeTraits::get_right(x), y, upper_key, comp) + //If right-open, comp(upper_key, x) is not the lower_bound algo + //condition so we must recheck current 'x' node with lower_bound algo + : lower_bound_loop(x, y, upper_key, comp) + ); + } + } + return std::pair (y, y); + } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. + //! + //! Effects: Returns the number of elements with a key equivalent to "key" + //! according to "comp". + //! + //! Complexity: Logarithmic. + //! + //! Throws: If "comp" throws. + template + static std::size_t count + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + { + std::pair ret = equal_range(header, key, comp); + std::size_t n = 0; + while(ret.first != ret.second){ + ++n; + ret.first = next_node(ret.first); + } + return n; + } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. + //! + //! Effects: Returns an a pair of node_ptr delimiting a range containing + //! all elements that are equivalent to "key" according to "comp" or an + //! empty range that indicates the position where those elements would be + //! if there are no equivalent elements. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If "comp" throws. + template + static std::pair equal_range + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + { + return bounded_range(header, key, key, comp, true, true); + } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. + //! + //! Effects: Returns an a pair of node_ptr delimiting a range containing + //! the first element that is equivalent to "key" according to "comp" or an + //! empty range that indicates the position where that element would be + //! if there are no equivalent elements. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If "comp" throws. + template + static std::pair lower_bound_range + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + { + node_ptr const lb(lower_bound(header, key, comp)); + std::pair ret_ii(lb, lb); + if(lb != header && !comp(key, lb)){ + ret_ii.second = next_node(ret_ii.second); + } + return ret_ii; + } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. + //! + //! Effects: Returns a node_ptr to the first element that is + //! not less than "key" according to "comp" or "header" if that element does + //! not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If "comp" throws. + template + static node_ptr lower_bound + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + { + return lower_bound_loop(NodeTraits::get_parent(header), detail::uncast(header), key, comp); + } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. + //! + //! Effects: Returns a node_ptr to the first element that is greater + //! than "key" according to "comp" or "header" if that element does not exist. + //! + //! Complexity: Logarithmic. + //! + //! Throws: If "comp" throws. + template + static node_ptr upper_bound + (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + { + return upper_bound_loop(NodeTraits::get_parent(header), detail::uncast(header), key, comp); + } + + //! Requires: "header" must be the header node of a tree. + //! "commit_data" must have been obtained from a previous call to + //! "insert_unique_check". No objects should have been inserted or erased + //! from the set between the "insert_unique_check" that filled "commit_data" + //! and the call to "insert_commit". + //! + //! + //! Effects: Inserts new_node in the set using the information obtained + //! from the "commit_data" that a previous "insert_check" filled. + //! + //! Complexity: Constant time. + //! + //! Throws: Nothing. + //! + //! Notes: This function has only sense if a "insert_unique_check" has been + //! previously executed to fill "commit_data". No value should be inserted or + //! erased between the "insert_check" and "insert_commit" calls. + static void insert_unique_commit + (const node_ptr & header, const node_ptr & new_value, const insert_commit_data &commit_data) + { return insert_commit(header, new_value, commit_data); } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. NodePtrCompare compares KeyType with a node_ptr. + //! + //! Effects: Checks if there is an equivalent node to "key" in the + //! tree according to "comp" and obtains the needed information to realize + //! a constant-time node insertion if there is no equivalent node. + //! + //! Returns: If there is an equivalent value + //! returns a pair containing a node_ptr to the already present node + //! and false. If there is not equivalent key can be inserted returns true + //! in the returned pair's boolean and fills "commit_data" that is meant to + //! be used with the "insert_commit" function to achieve a constant-time + //! insertion function. + //! + //! Complexity: Average complexity is at most logarithmic. + //! + //! Throws: If "comp" throws. + //! + //! Notes: This function is used to improve performance when constructing + //! a node is expensive and the user does not want to have two equivalent nodes + //! in the tree: if there is an equivalent value + //! the constructed object must be discarded. Many times, the part of the + //! node that is used to impose the order is much cheaper to construct + //! than the node and this function offers the possibility to use that part + //! to check if the insertion will be successful. + //! + //! If the check is successful, the user can construct the node and use + //! "insert_commit" to insert the node in constant-time. This gives a total + //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)). + //! + //! "commit_data" remains valid for a subsequent "insert_unique_commit" only + //! if no more objects are inserted or erased from the set. + template + static std::pair insert_unique_check + (const const_node_ptr & header, const KeyType &key + ,KeyNodePtrCompare comp, insert_commit_data &commit_data + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + std::size_t depth = 0; + node_ptr h(detail::uncast(header)); + node_ptr y(h); + node_ptr x(NodeTraits::get_parent(y)); + node_ptr prev = node_ptr(); + + //Find the upper bound, cache the previous value and if we should + //store it in the left or right node + bool left_child = true; + while(x){ + ++depth; + y = x; + x = (left_child = comp(key, x)) ? + NodeTraits::get_left(x) : (prev = y, NodeTraits::get_right(x)); + } + + if(pdepth) *pdepth = depth; + + //Since we've found the upper bound there is no other value with the same key if: + // - There is no previous node + // - The previous node is less than the key + const bool not_present = !prev || comp(prev, key); + if(not_present){ + commit_data.link_left = left_child; + commit_data.node = y; + } + return std::pair(prev, not_present); + } + + //! Requires: "header" must be the header node of a tree. + //! KeyNodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. NodePtrCompare compares KeyType with a node_ptr. + //! "hint" is node from the "header"'s tree. + //! + //! Effects: Checks if there is an equivalent node to "key" in the + //! tree according to "comp" using "hint" as a hint to where it should be + //! inserted and obtains the needed information to realize + //! a constant-time node insertion if there is no equivalent node. + //! If "hint" is the upper_bound the function has constant time + //! complexity (two comparisons in the worst case). + //! + //! Returns: If there is an equivalent value + //! returns a pair containing a node_ptr to the already present node + //! and false. If there is not equivalent key can be inserted returns true + //! in the returned pair's boolean and fills "commit_data" that is meant to + //! be used with the "insert_commit" function to achieve a constant-time + //! insertion function. + //! + //! Complexity: Average complexity is at most logarithmic, but it is + //! amortized constant time if new_node should be inserted immediately before "hint". + //! + //! Throws: If "comp" throws. + //! + //! Notes: This function is used to improve performance when constructing + //! a node is expensive and the user does not want to have two equivalent nodes + //! in the tree: if there is an equivalent value + //! the constructed object must be discarded. Many times, the part of the + //! node that is used to impose the order is much cheaper to construct + //! than the node and this function offers the possibility to use that part + //! to check if the insertion will be successful. + //! + //! If the check is successful, the user can construct the node and use + //! "insert_commit" to insert the node in constant-time. This gives a total + //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)). + //! + //! "commit_data" remains valid for a subsequent "insert_unique_commit" only + //! if no more objects are inserted or erased from the set. + template + static std::pair insert_unique_check + (const const_node_ptr & header, const node_ptr &hint, const KeyType &key + ,KeyNodePtrCompare comp, insert_commit_data &commit_data + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + //hint must be bigger than the key + if(hint == header || comp(key, hint)){ + node_ptr prev(hint); + //Previous value should be less than the key + if(hint == begin_node(header) || comp((prev = prev_node(hint)), key)){ + commit_data.link_left = unique(header) || !NodeTraits::get_left(hint); + commit_data.node = commit_data.link_left ? hint : prev; + if(pdepth){ + *pdepth = commit_data.node == header ? 0 : depth(commit_data.node) + 1; + } + return std::pair(node_ptr(), true); + } + } + //Hint was wrong, use hintless insertion + return insert_unique_check(header, key, comp, commit_data, pdepth); + } + + //! Requires: "header" must be the header node of a tree. + //! NodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from + //! the "header"'s tree. + //! + //! Effects: Inserts new_node into the tree, using "hint" as a hint to + //! where it will be inserted. If "hint" is the upper_bound + //! the insertion takes constant time (two comparisons in the worst case). + //! + //! Complexity: Logarithmic in general, but it is amortized + //! constant time if new_node is inserted immediately before "hint". + //! + //! Throws: If "comp" throws. + template + static node_ptr insert_equal + (const node_ptr & h, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + insert_commit_data commit_data; + insert_equal_check(h, hint, new_node, comp, commit_data, pdepth); + insert_commit(h, new_node, commit_data); + return new_node; + } + + //! Requires: "h" must be the header node of a tree. + //! NodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. NodePtrCompare compares two node_ptrs. + //! + //! Effects: Inserts new_node into the tree before the upper bound + //! according to "comp". + //! + //! Complexity: Average complexity for insert element is at + //! most logarithmic. + //! + //! Throws: If "comp" throws. + template + static node_ptr insert_equal_upper_bound + (const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + insert_commit_data commit_data; + insert_equal_upper_bound_check(h, new_node, comp, commit_data, pdepth); + insert_commit(h, new_node, commit_data); + return new_node; + } + + //! Requires: "h" must be the header node of a tree. + //! NodePtrCompare is a function object that induces a strict weak + //! ordering compatible with the strict weak ordering used to create the + //! the tree. NodePtrCompare compares two node_ptrs. + //! + //! Effects: Inserts new_node into the tree before the lower bound + //! according to "comp". + //! + //! Complexity: Average complexity for insert element is at + //! most logarithmic. + //! + //! Throws: If "comp" throws. + template + static node_ptr insert_equal_lower_bound + (const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + insert_commit_data commit_data; + insert_equal_lower_bound_check(h, new_node, comp, commit_data, pdepth); + insert_commit(h, new_node, commit_data); + return new_node; + } + + //! Requires: "header" must be the header node of a tree. + //! "pos" must be a valid iterator or header (end) node. + //! "pos" must be an iterator pointing to the successor to "new_node" + //! once inserted according to the order of already inserted nodes. This function does not + //! check "pos" and this precondition must be guaranteed by the caller. + //! + //! Effects: Inserts new_node into the tree before "pos". + //! + //! Complexity: Constant-time. + //! + //! Throws: Nothing. + //! + //! Note: If "pos" is not the successor of the newly inserted "new_node" + //! tree invariants might be broken. + static node_ptr insert_before + (const node_ptr & header, const node_ptr & pos, const node_ptr & new_node + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + insert_commit_data commit_data; + insert_before_check(header, pos, commit_data, pdepth); + insert_commit(header, new_node, commit_data); + return new_node; + } + + //! Requires: "header" must be the header node of a tree. + //! "new_node" must be, according to the used ordering no less than the + //! greatest inserted key. + //! + //! Effects: Inserts new_node into the tree before "pos". + //! + //! Complexity: Constant-time. + //! + //! Throws: Nothing. + //! + //! Note: If "new_node" is less than the greatest inserted key + //! tree invariants are broken. This function is slightly faster than + //! using "insert_before". + static void push_back + (const node_ptr & header, const node_ptr & new_node + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + insert_commit_data commit_data; + push_back_check(header, commit_data, pdepth); + insert_commit(header, new_node, commit_data); + } + + //! Requires: "header" must be the header node of a tree. + //! "new_node" must be, according to the used ordering, no greater than the + //! lowest inserted key. + //! + //! Effects: Inserts new_node into the tree before "pos". + //! + //! Complexity: Constant-time. + //! + //! Throws: Nothing. + //! + //! Note: If "new_node" is greater than the lowest inserted key + //! tree invariants are broken. This function is slightly faster than + //! using "insert_before". + static void push_front + (const node_ptr & header, const node_ptr & new_node + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + insert_commit_data commit_data; + push_front_check(header, commit_data, pdepth); + insert_commit(header, new_node, commit_data); + } + + //! Requires: 'node' can't be a header node. + //! + //! Effects: Calculates the depth of a node: the depth of a + //! node is the length (number of edges) of the path from the root + //! to that node. (The root node is at depth 0.) + //! + //! Complexity: Logarithmic to the number of nodes in the tree. + //! + //! Throws: Nothing. + static std::size_t depth(const_node_ptr node) + { + std::size_t depth = 0; + node_ptr p_parent; + while(node != NodeTraits::get_parent(p_parent = NodeTraits::get_parent(node))){ + ++depth; + node = p_parent; + } + return depth; + } + + //! Requires: "cloner" must be a function + //! object taking a node_ptr and returning a new cloned node of it. "disposer" must + //! take a node_ptr and shouldn't throw. + //! + //! Effects: First empties target tree calling + //! void disposer::operator()(const node_ptr &) for every node of the tree + //! except the header. + //! + //! Then, duplicates the entire tree pointed by "source_header" cloning each + //! source node with node_ptr Cloner::operator()(const node_ptr &) to obtain + //! the nodes of the target tree. If "cloner" throws, the cloned target nodes + //! are disposed using void disposer(const node_ptr &). + //! + //! Complexity: Linear to the number of element of the source tree plus the. + //! number of elements of tree target tree when calling this function. + //! + //! Throws: If cloner functor throws. If this happens target nodes are disposed. + template + static void clone + (const const_node_ptr & source_header, const node_ptr & target_header, Cloner cloner, Disposer disposer) + { + if(!unique(target_header)){ + clear_and_dispose(target_header, disposer); + } + + node_ptr leftmost, rightmost; + node_ptr new_root = clone_subtree + (source_header, target_header, cloner, disposer, leftmost, rightmost); + + //Now update header node + NodeTraits::set_parent(target_header, new_root); + NodeTraits::set_left (target_header, leftmost); + NodeTraits::set_right (target_header, rightmost); + } + + //! Requires: header must be the header of a tree, z a node + //! of that tree and z != header. + //! + //! Effects: Erases node "z" from the tree with header "header". + //! + //! Complexity: Amortized constant time. + //! + //! Throws: Nothing. + static void erase(const node_ptr & header, const node_ptr & z) + { + data_for_rebalance ignored; + erase(header, z, ignored); + } + + //! Requires: node is a tree node but not the header. + //! + //! Effects: Unlinks the node and rebalances the tree. + //! + //! Complexity: Average complexity is constant time. + //! + //! Throws: Nothing. + static void unlink(const node_ptr & node) + { + node_ptr x = NodeTraits::get_parent(node); + if(x){ + while(!is_header(x)) + x = NodeTraits::get_parent(x); + erase(x, node); + } + } + + //! Requires: header must be the header of a tree. + //! + //! Effects: Rebalances the tree. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear. + static void rebalance(const node_ptr & header) + { + node_ptr root = NodeTraits::get_parent(header); + if(root){ + rebalance_subtree(root); + } + } + + //! Requires: old_root is a node of a tree. It shall not be null. + //! + //! Effects: Rebalances the subtree rooted at old_root. + //! + //! Returns: The new root of the subtree. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear. + static node_ptr rebalance_subtree(const node_ptr & old_root) + { + //Taken from: + //"Tree rebalancing in optimal time and space" + //Quentin F. Stout and Bette L. Warren + + //To avoid irregularities in the algorithm (old_root can be a + //left or right child or even the root of the tree) just put the + //root as the right child of its parent. Before doing this backup + //information to restore the original relationship after + //the algorithm is applied. + node_ptr super_root = NodeTraits::get_parent(old_root); + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(super_root); + + //Get root info + node_ptr super_root_right_backup = NodeTraits::get_right(super_root); + bool super_root_is_header = NodeTraits::get_parent(super_root) == old_root; + bool old_root_is_right = is_right_child(old_root); + NodeTraits::set_right(super_root, old_root); + + std::size_t size; + subtree_to_vine(super_root, size); + vine_to_subtree(super_root, size); + node_ptr new_root = NodeTraits::get_right(super_root); + + //Recover root + if(super_root_is_header){ + NodeTraits::set_right(super_root, super_root_right_backup); + NodeTraits::set_parent(super_root, new_root); + } + else if(old_root_is_right){ + NodeTraits::set_right(super_root, new_root); + } + else{ + NodeTraits::set_right(super_root, super_root_right_backup); + NodeTraits::set_left(super_root, new_root); + } + return new_root; + } + + //! Effects: Asserts the integrity of the container with additional checks provided by the user. + //! + //! Requires: header must be the header of a tree. + //! + //! Complexity: Linear time. + //! + //! Note: The method might not have effect when asserts are turned off (e.g., with NDEBUG). + //! Experimental function, interface might change in future versions. + template + static void check(const const_node_ptr& header, Checker checker, typename Checker::return_type& checker_return) + { + const_node_ptr root_node_ptr = NodeTraits::get_parent(header); + if (!root_node_ptr) + { + // check left&right header pointers + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_left(header) == header); + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_right(header) == header); + } + else + { + // check parent pointer of root node + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_parent(root_node_ptr) == header); + // check subtree from root + check_subtree(root_node_ptr, checker, checker_return); + // check left&right header pointers + const_node_ptr p = root_node_ptr; + while (NodeTraits::get_left(p)) { p = NodeTraits::get_left(p); } + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_left(header) == p); + p = root_node_ptr; + while (NodeTraits::get_right(p)) { p = NodeTraits::get_right(p); } + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_right(header) == p); + } + } + + protected: + static void erase(const node_ptr & header, const node_ptr & z, data_for_rebalance &info) + { + node_ptr y(z); + node_ptr x; + const node_ptr z_left(NodeTraits::get_left(z)); + const node_ptr z_right(NodeTraits::get_right(z)); + + if(!z_left){ + x = z_right; // x might be null. + } + else if(!z_right){ // z has exactly one non-null child. y == z. + x = z_left; // x is not null. + AUTOBOOST_ASSERT(x); + } + else{ //make y != z + // y = find z's successor + y = bstree_algorithms::minimum(z_right); + x = NodeTraits::get_right(y); // x might be null. + } + + node_ptr x_parent; + const node_ptr z_parent(NodeTraits::get_parent(z)); + const bool z_is_leftchild(NodeTraits::get_left(z_parent) == z); + + if(y != z){ //has two children and y is the minimum of z + //y is z's successor and it has a null left child. + //x is the right child of y (it can be null) + //Relink y in place of z and link x with y's old parent + NodeTraits::set_parent(z_left, y); + NodeTraits::set_left(y, z_left); + if(y != z_right){ + //Link y with the right tree of z + NodeTraits::set_right(y, z_right); + NodeTraits::set_parent(z_right, y); + //Link x with y's old parent (y must be a left child) + x_parent = NodeTraits::get_parent(y); + AUTOBOOST_ASSERT(NodeTraits::get_left(x_parent) == y); + if(x) + NodeTraits::set_parent(x, x_parent); + //Since y was the successor and not the right child of z, it must be a left child + NodeTraits::set_left(x_parent, x); + } + else{ //y was the right child of y so no need to fix x's position + x_parent = y; + } + NodeTraits::set_parent(y, z_parent); + bstree_algorithms::set_child(header, y, z_parent, z_is_leftchild); + } + else { // z has zero or one child, x is one child (it can be null) + //Just link x to z's parent + x_parent = z_parent; + if(x) + NodeTraits::set_parent(x, z_parent); + bstree_algorithms::set_child(header, x, z_parent, z_is_leftchild); + + //Now update leftmost/rightmost in case z was one of them + if(NodeTraits::get_left(header) == z){ + //z_left must be null because z is the leftmost + AUTOBOOST_ASSERT(!z_left); + NodeTraits::set_left(header, !z_right ? + z_parent : // makes leftmost == header if z == root + bstree_algorithms::minimum(z_right)); + } + if(NodeTraits::get_right(header) == z){ + //z_right must be null because z is the rightmost + AUTOBOOST_ASSERT(!z_right); + NodeTraits::set_right(header, !z_left ? + z_parent : // makes rightmost == header if z == root + bstree_algorithms::maximum(z_left)); + } + } + + //If z had 0/1 child, y == z and one of its children (and maybe null) + //If z had 2 children, y is the successor of z and x is the right child of y + info.x = x; + info.y = y; + //If z had 0/1 child, x_parent is the new parent of the old right child of y (z's successor) + //If z had 2 children, x_parent is the new parent of y (z_parent) + AUTOBOOST_ASSERT(!x || NodeTraits::get_parent(x) == x_parent); + info.x_parent = x_parent; + } + + //! Requires: node is a node of the tree but it's not the header. + //! + //! Effects: Returns the number of nodes of the subtree. + //! + //! Complexity: Linear time. + //! + //! Throws: Nothing. + static std::size_t subtree_size(const const_node_ptr & subtree) + { + std::size_t count = 0; + if (subtree){ + node_ptr n = detail::uncast(subtree); + node_ptr m = NodeTraits::get_left(n); + while(m){ + n = m; + m = NodeTraits::get_left(n); + } + + while(1){ + ++count; + node_ptr n_right(NodeTraits::get_right(n)); + if(n_right){ + n = n_right; + m = NodeTraits::get_left(n); + while(m){ + n = m; + m = NodeTraits::get_left(n); + } + } + else { + do{ + if (n == subtree){ + return count; + } + m = n; + n = NodeTraits::get_parent(n); + }while(NodeTraits::get_left(n) != m); + } + } + } + return count; + } + + //! Requires: p is a node of a tree. + //! + //! Effects: Returns true if p is a left child. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + static bool is_left_child(const node_ptr & p) + { return NodeTraits::get_left(NodeTraits::get_parent(p)) == p; } + + //! Requires: p is a node of a tree. + //! + //! Effects: Returns true if p is a right child. + //! + //! Complexity: Constant. + //! + //! Throws: Nothing. + static bool is_right_child(const node_ptr & p) + { return NodeTraits::get_right(NodeTraits::get_parent(p)) == p; } + + static void insert_before_check + (const node_ptr &header, const node_ptr & pos + , insert_commit_data &commit_data + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + node_ptr prev(pos); + if(pos != NodeTraits::get_left(header)) + prev = prev_node(pos); + bool link_left = unique(header) || !NodeTraits::get_left(pos); + commit_data.link_left = link_left; + commit_data.node = link_left ? pos : prev; + if(pdepth){ + *pdepth = commit_data.node == header ? 0 : depth(commit_data.node) + 1; + } + } + + static void push_back_check + (const node_ptr & header, insert_commit_data &commit_data + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + node_ptr prev(NodeTraits::get_right(header)); + if(pdepth){ + *pdepth = prev == header ? 0 : depth(prev) + 1; + } + commit_data.link_left = false; + commit_data.node = prev; + } + + static void push_front_check + (const node_ptr & header, insert_commit_data &commit_data + #ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED + , std::size_t *pdepth = 0 + #endif + ) + { + node_ptr pos(NodeTraits::get_left(header)); + if(pdepth){ + *pdepth = pos == header ? 0 : depth(pos) + 1; + } + commit_data.link_left = true; + commit_data.node = pos; + } + + template + static void insert_equal_check + (const node_ptr &header, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp + , insert_commit_data &commit_data + /// @cond + , std::size_t *pdepth = 0 + /// @endcond + ) + { + if(hint == header || !comp(hint, new_node)){ + node_ptr prev(hint); + if(hint == NodeTraits::get_left(header) || + !comp(new_node, (prev = prev_node(hint)))){ + bool link_left = unique(header) || !NodeTraits::get_left(hint); + commit_data.link_left = link_left; + commit_data.node = link_left ? hint : prev; + if(pdepth){ + *pdepth = commit_data.node == header ? 0 : depth(commit_data.node) + 1; + } + } + else{ + insert_equal_upper_bound_check(header, new_node, comp, commit_data, pdepth); + } + } + else{ + insert_equal_lower_bound_check(header, new_node, comp, commit_data, pdepth); + } + } + + template + static void insert_equal_upper_bound_check + (const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0) + { + std::size_t depth = 0; + node_ptr y(h); + node_ptr x(NodeTraits::get_parent(y)); + + while(x){ + ++depth; + y = x; + x = comp(new_node, x) ? + NodeTraits::get_left(x) : NodeTraits::get_right(x); + } + if(pdepth) *pdepth = depth; + commit_data.link_left = (y == h) || comp(new_node, y); + commit_data.node = y; + } + + template + static void insert_equal_lower_bound_check + (const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0) + { + std::size_t depth = 0; + node_ptr y(h); + node_ptr x(NodeTraits::get_parent(y)); + + while(x){ + ++depth; + y = x; + x = !comp(x, new_node) ? + NodeTraits::get_left(x) : NodeTraits::get_right(x); + } + if(pdepth) *pdepth = depth; + commit_data.link_left = (y == h) || !comp(y, new_node); + commit_data.node = y; + } + + static void insert_commit + (const node_ptr & header, const node_ptr & new_node, const insert_commit_data &commit_data) + { + //Check if commit_data has not been initialized by a insert_unique_check call. + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(commit_data.node != node_ptr()); + node_ptr parent_node(commit_data.node); + if(parent_node == header){ + NodeTraits::set_parent(header, new_node); + NodeTraits::set_right(header, new_node); + NodeTraits::set_left(header, new_node); + } + else if(commit_data.link_left){ + NodeTraits::set_left(parent_node, new_node); + if(parent_node == NodeTraits::get_left(header)) + NodeTraits::set_left(header, new_node); + } + else{ + NodeTraits::set_right(parent_node, new_node); + if(parent_node == NodeTraits::get_right(header)) + NodeTraits::set_right(header, new_node); + } + NodeTraits::set_parent(new_node, parent_node); + NodeTraits::set_right(new_node, node_ptr()); + NodeTraits::set_left(new_node, node_ptr()); + } + + //Fix header and own's parent data when replacing x with own, providing own's old data with parent + static void set_child(const node_ptr & header, const node_ptr & new_child, const node_ptr & new_parent, const bool link_left) + { + if(new_parent == header) + NodeTraits::set_parent(header, new_child); + else if(link_left) + NodeTraits::set_left(new_parent, new_child); + else + NodeTraits::set_right(new_parent, new_child); + } + + // rotate p to left (no header and p's parent fixup) + static void rotate_left_no_parent_fix(const node_ptr & p, const node_ptr &p_right) + { + node_ptr p_right_left(NodeTraits::get_left(p_right)); + NodeTraits::set_right(p, p_right_left); + if(p_right_left){ + NodeTraits::set_parent(p_right_left, p); + } + NodeTraits::set_left(p_right, p); + NodeTraits::set_parent(p, p_right); + } + + // rotate p to left (with header and p's parent fixup) + static void rotate_left(const node_ptr & p, const node_ptr & p_right, const node_ptr & p_parent, const node_ptr & header) + { + const bool p_was_left(NodeTraits::get_left(p_parent) == p); + rotate_left_no_parent_fix(p, p_right); + NodeTraits::set_parent(p_right, p_parent); + set_child(header, p_right, p_parent, p_was_left); + } + + // rotate p to right (no header and p's parent fixup) + static void rotate_right_no_parent_fix(const node_ptr & p, const node_ptr &p_left) + { + node_ptr p_left_right(NodeTraits::get_right(p_left)); + NodeTraits::set_left(p, p_left_right); + if(p_left_right){ + NodeTraits::set_parent(p_left_right, p); + } + NodeTraits::set_right(p_left, p); + NodeTraits::set_parent(p, p_left); + } + + // rotate p to right (with header and p's parent fixup) + static void rotate_right(const node_ptr & p, const node_ptr & p_left, const node_ptr & p_parent, const node_ptr & header) + { + const bool p_was_left(NodeTraits::get_left(p_parent) == p); + rotate_right_no_parent_fix(p, p_left); + NodeTraits::set_parent(p_left, p_parent); + set_child(header, p_left, p_parent, p_was_left); + } + + private: + + static void subtree_to_vine(node_ptr vine_tail, std::size_t &size) + { + //Inspired by LibAVL: + //It uses a clever optimization for trees with parent pointers. + //No parent pointer is updated when transforming a tree to a vine as + //most of them will be overriten during compression rotations. + //A final pass must be made after the rebalancing to updated those + //pointers not updated by tree_to_vine + compression calls + std::size_t len = 0; + node_ptr remainder = NodeTraits::get_right(vine_tail); + while(remainder){ + node_ptr tempptr = NodeTraits::get_left(remainder); + if(!tempptr){ //move vine-tail down one + vine_tail = remainder; + remainder = NodeTraits::get_right(remainder); + ++len; + } + else{ //rotate + NodeTraits::set_left(remainder, NodeTraits::get_right(tempptr)); + NodeTraits::set_right(tempptr, remainder); + remainder = tempptr; + NodeTraits::set_right(vine_tail, tempptr); + } + } + size = len; + } + + static void compress_subtree(node_ptr scanner, std::size_t count) + { + while(count--){ //compress "count" spine nodes in the tree with pseudo-root scanner + node_ptr child = NodeTraits::get_right(scanner); + node_ptr child_right = NodeTraits::get_right(child); + NodeTraits::set_right(scanner, child_right); + //Avoid setting the parent of child_right + scanner = child_right; + node_ptr scanner_left = NodeTraits::get_left(scanner); + NodeTraits::set_right(child, scanner_left); + if(scanner_left) + NodeTraits::set_parent(scanner_left, child); + NodeTraits::set_left(scanner, child); + NodeTraits::set_parent(child, scanner); + } + } + + static void vine_to_subtree(const node_ptr & super_root, std::size_t count) + { + const std::size_t one_szt = 1u; + std::size_t leaf_nodes = count + one_szt - std::size_t(one_szt << detail::floor_log2(count + one_szt)); + compress_subtree(super_root, leaf_nodes); //create deepest leaves + std::size_t vine_nodes = count - leaf_nodes; + while(vine_nodes > 1){ + vine_nodes /= 2; + compress_subtree(super_root, vine_nodes); + } + + //Update parents of nodes still in the in the original vine line + //as those have not been updated by subtree_to_vine or compress_subtree + for ( node_ptr q = super_root, p = NodeTraits::get_right(super_root) + ; p + ; q = p, p = NodeTraits::get_right(p)){ + NodeTraits::set_parent(p, q); + } + } + + //! Requires: "n" must be a node inserted in a tree. + //! + //! Effects: Returns a pointer to the header node of the tree. + //! + //! Complexity: Logarithmic. + //! + //! Throws: Nothing. + static node_ptr get_root(const node_ptr & node) + { + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT((!inited(node))); + node_ptr x = NodeTraits::get_parent(node); + if(x){ + while(!is_header(x)){ + x = NodeTraits::get_parent(x); + } + return x; + } + else{ + return node; + } + } + + template + static node_ptr clone_subtree + (const const_node_ptr &source_parent, const node_ptr &target_parent + , Cloner cloner, Disposer disposer + , node_ptr &leftmost_out, node_ptr &rightmost_out + ) + { + node_ptr target_sub_root = target_parent; + node_ptr source_root = NodeTraits::get_parent(source_parent); + if(!source_root){ + leftmost_out = rightmost_out = source_root; + } + else{ + //We'll calculate leftmost and rightmost nodes while iterating + node_ptr current = source_root; + node_ptr insertion_point = target_sub_root = cloner(current); + + //We'll calculate leftmost and rightmost nodes while iterating + node_ptr leftmost = target_sub_root; + node_ptr rightmost = target_sub_root; + + //First set the subroot + NodeTraits::set_left(target_sub_root, node_ptr()); + NodeTraits::set_right(target_sub_root, node_ptr()); + NodeTraits::set_parent(target_sub_root, target_parent); + + dispose_subtree_disposer rollback(disposer, target_sub_root); + while(true) { + //First clone left nodes + if( NodeTraits::get_left(current) && + !NodeTraits::get_left(insertion_point)) { + current = NodeTraits::get_left(current); + node_ptr temp = insertion_point; + //Clone and mark as leaf + insertion_point = cloner(current); + NodeTraits::set_left (insertion_point, node_ptr()); + NodeTraits::set_right (insertion_point, node_ptr()); + //Insert left + NodeTraits::set_parent(insertion_point, temp); + NodeTraits::set_left (temp, insertion_point); + //Update leftmost + if(rightmost == target_sub_root) + leftmost = insertion_point; + } + //Then clone right nodes + else if( NodeTraits::get_right(current) && + !NodeTraits::get_right(insertion_point)){ + current = NodeTraits::get_right(current); + node_ptr temp = insertion_point; + //Clone and mark as leaf + insertion_point = cloner(current); + NodeTraits::set_left (insertion_point, node_ptr()); + NodeTraits::set_right (insertion_point, node_ptr()); + //Insert right + NodeTraits::set_parent(insertion_point, temp); + NodeTraits::set_right (temp, insertion_point); + //Update rightmost + rightmost = insertion_point; + } + //If not, go up + else if(current == source_root){ + break; + } + else{ + //Branch completed, go up searching more nodes to clone + current = NodeTraits::get_parent(current); + insertion_point = NodeTraits::get_parent(insertion_point); + } + } + rollback.release(); + leftmost_out = leftmost; + rightmost_out = rightmost; + } + return target_sub_root; + } + + template + static void dispose_subtree(node_ptr x, Disposer disposer) + { + while (x){ + node_ptr save(NodeTraits::get_left(x)); + if (save) { + // Right rotation + NodeTraits::set_left(x, NodeTraits::get_right(save)); + NodeTraits::set_right(save, x); + } + else { + save = NodeTraits::get_right(x); + init(x); + disposer(x); + } + x = save; + } + } + + template + static node_ptr lower_bound_loop + (node_ptr x, node_ptr y, const KeyType &key, KeyNodePtrCompare comp) + { + while(x){ + if(comp(x, key)){ + x = NodeTraits::get_right(x); + } + else{ + y = x; + x = NodeTraits::get_left(x); + } + } + return y; + } + + template + static node_ptr upper_bound_loop + (node_ptr x, node_ptr y, const KeyType &key, KeyNodePtrCompare comp) + { + while(x){ + if(comp(key, x)){ + y = x; + x = NodeTraits::get_left(x); + } + else{ + x = NodeTraits::get_right(x); + } + } + return y; + } + + template + static void check_subtree(const const_node_ptr& node, Checker checker, typename Checker::return_type& check_return) + { + const_node_ptr left = NodeTraits::get_left(node); + const_node_ptr right = NodeTraits::get_right(node); + typename Checker::return_type check_return_left; + typename Checker::return_type check_return_right; + if (left) + { + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_parent(left) == node); + check_subtree(left, checker, check_return_left); + } + if (right) + { + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_parent(right) == node); + check_subtree(right, checker, check_return_right); + } + checker(node, check_return_left, check_return_right, check_return); + } +}; + +/// @cond + +template +struct get_algo +{ + typedef bstree_algorithms type; +}; + +template +struct get_node_checker +{ + typedef detail::bstree_node_checker type; +}; + +/// @endcond + +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_BSTREE_ALGORITHMS_HPP diff --git a/contrib/autoboost/autoboost/intrusive/circular_list_algorithms.hpp b/contrib/autoboost/autoboost/intrusive/circular_list_algorithms.hpp new file mode 100644 index 000000000..882f05261 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/circular_list_algorithms.hpp @@ -0,0 +1,507 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Olaf Krzikalla 2004-2006. +// (C) Copyright Ion Gaztanaga 2006-2014 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP +#define AUTOBOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { + +//! circular_list_algorithms provides basic algorithms to manipulate nodes +//! forming a circular doubly linked list. An empty circular list is formed by a node +//! whose pointers point to itself. +//! +//! circular_list_algorithms is configured with a NodeTraits class, which encapsulates the +//! information about the node to be manipulated. NodeTraits must support the +//! following interface: +//! +//! Typedefs: +//! +//! node: The type of the node that forms the circular list +//! +//! node_ptr: A pointer to a node +//! +//! const_node_ptr: A pointer to a const node +//! +//! Static functions: +//! +//! static node_ptr get_previous(const_node_ptr n); +//! +//! static void set_previous(node_ptr n, node_ptr prev); +//! +//! static node_ptr get_next(const_node_ptr n); +//! +//! static void set_next(node_ptr n, node_ptr next); +template +class circular_list_algorithms +{ + public: + typedef typename NodeTraits::node node; + typedef typename NodeTraits::node_ptr node_ptr; + typedef typename NodeTraits::const_node_ptr const_node_ptr; + typedef NodeTraits node_traits; + + //! Effects: Constructs an non-used list element, so that + //! inited(this_node) == true + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static void init(const node_ptr &this_node) + { + const node_ptr null_node((node_ptr())); + NodeTraits::set_next(this_node, null_node); + NodeTraits::set_previous(this_node, null_node); + } + + //! Effects: Returns true is "this_node" is in a non-used state + //! as if it was initialized by the "init" function. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static bool inited(const const_node_ptr &this_node) + { return !NodeTraits::get_next(this_node); } + + //! Effects: Constructs an empty list, making this_node the only + //! node of the circular list: + //! NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node) + //! == this_node. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static void init_header(const node_ptr &this_node) + { + NodeTraits::set_next(this_node, this_node); + NodeTraits::set_previous(this_node, this_node); + } + + + //! Requires: this_node must be in a circular list or be an empty circular list. + //! + //! Effects: Returns true is "this_node" is the only node of a circular list: + //! return NodeTraits::get_next(this_node) == this_node + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static bool unique(const const_node_ptr &this_node) + { + node_ptr next = NodeTraits::get_next(this_node); + return !next || next == this_node; + } + + //! Requires: this_node must be in a circular list or be an empty circular list. + //! + //! Effects: Returns the number of nodes in a circular list. If the circular list + //! is empty, returns 1. + //! + //! Complexity: Linear + //! + //! Throws: Nothing. + static std::size_t count(const const_node_ptr &this_node) + { + std::size_t result = 0; + const_node_ptr p = this_node; + do{ + p = NodeTraits::get_next(p); + ++result; + }while (p != this_node); + return result; + } + + //! Requires: this_node must be in a circular list or be an empty circular list. + //! + //! Effects: Unlinks the node from the circular list. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static node_ptr unlink(const node_ptr &this_node) + { + node_ptr next(NodeTraits::get_next(this_node)); + node_ptr prev(NodeTraits::get_previous(this_node)); + NodeTraits::set_next(prev, next); + NodeTraits::set_previous(next, prev); + return next; + } + + //! Requires: b and e must be nodes of the same circular list or an empty range. + //! + //! Effects: Unlinks the node [b, e) from the circular list. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static void unlink(const node_ptr &b, const node_ptr &e) + { + if (b != e) { + node_ptr prevb(NodeTraits::get_previous(b)); + NodeTraits::set_previous(e, prevb); + NodeTraits::set_next(prevb, e); + } + } + + //! Requires: nxt_node must be a node of a circular list. + //! + //! Effects: Links this_node before nxt_node in the circular list. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static void link_before(const node_ptr &nxt_node, const node_ptr &this_node) + { + node_ptr prev(NodeTraits::get_previous(nxt_node)); + NodeTraits::set_previous(this_node, prev); + NodeTraits::set_next(this_node, nxt_node); + //nxt_node might be an alias for prev->next_ + //so use it before NodeTraits::set_next(prev, ...) + //is called and the reference changes it's value + NodeTraits::set_previous(nxt_node, this_node); + NodeTraits::set_next(prev, this_node); + } + + //! Requires: prev_node must be a node of a circular list. + //! + //! Effects: Links this_node after prev_node in the circular list. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static void link_after(const node_ptr &prev_node, const node_ptr &this_node) + { + node_ptr next(NodeTraits::get_next(prev_node)); + NodeTraits::set_previous(this_node, prev_node); + NodeTraits::set_next(this_node, next); + //prev_node might be an alias for next->next_ + //so use it before update it before NodeTraits::set_previous(next, ...) + //is called and the reference changes it's value + NodeTraits::set_next(prev_node, this_node); + NodeTraits::set_previous(next, this_node); + } + + //! Requires: this_node and other_node must be nodes inserted + //! in circular lists or be empty circular lists. + //! + //! Effects: Swaps the position of the nodes: this_node is inserted in + //! other_nodes position in the second circular list and the other_node is inserted + //! in this_node's position in the first circular list. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. +/* + static void swap_nodes(const node_ptr &this_node, const node_ptr &other_node) + { + + if (other_node == this_node) + return; + bool empty1 = unique(this_node); + bool empty2 = unique(other_node); + + node_ptr next_this(NodeTraits::get_next(this_node)); + node_ptr prev_this(NodeTraits::get_previous(this_node)); + node_ptr next_other(NodeTraits::get_next(other_node)); + node_ptr prev_other(NodeTraits::get_previous(other_node)); + + //Do the swap + NodeTraits::set_next(this_node, next_other); + NodeTraits::set_next(other_node, next_this); + + NodeTraits::set_previous(this_node, prev_other); + NodeTraits::set_previous(other_node, prev_this); + + if (empty2){ + init(this_node); + } + else{ + NodeTraits::set_next(prev_other, this_node); + NodeTraits::set_previous(next_other, this_node); + } + if (empty1){ + init(other_node); + } + else{ + NodeTraits::set_next(prev_this, other_node); + NodeTraits::set_previous(next_this, other_node); + } + } +*/ + + //Watanabe version + private: + static void swap_prev(const node_ptr &this_node, const node_ptr &other_node) + { + node_ptr temp(NodeTraits::get_previous(this_node)); + NodeTraits::set_previous(this_node, NodeTraits::get_previous(other_node)); + NodeTraits::set_previous(other_node, temp); + } + static void swap_next(const node_ptr &this_node, const node_ptr &other_node) + { + node_ptr temp(NodeTraits::get_next(this_node)); + NodeTraits::set_next(this_node, NodeTraits::get_next(other_node)); + NodeTraits::set_next(other_node, temp); + } + + public: + static void swap_nodes(const node_ptr &this_node, const node_ptr &other_node) + { + if (other_node == this_node) + return; + bool this_inited = inited(this_node); + bool other_inited = inited(other_node); + if(this_inited){ + init_header(this_node); + } + if(other_inited){ + init_header(other_node); + } + + node_ptr next_this(NodeTraits::get_next(this_node)); + node_ptr prev_this(NodeTraits::get_previous(this_node)); + node_ptr next_other(NodeTraits::get_next(other_node)); + node_ptr prev_other(NodeTraits::get_previous(other_node)); + //these first two swaps must happen before the other two + swap_prev(next_this, next_other); + swap_next(prev_this, prev_other); + swap_next(this_node, other_node); + swap_prev(this_node, other_node); + + if(this_inited){ + init(other_node); + } + if(other_inited){ + init(this_node); + } + } + + //! Requires: b and e must be nodes of the same circular list or an empty range. + //! and p must be a node of a different circular list or may not be an iterator in + // [b, e). + //! + //! Effects: Removes the nodes from [b, e) range from their circular list and inserts + //! them before p in p's circular list. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static void transfer(const node_ptr &p, const node_ptr &b, const node_ptr &e) + { + if (b != e) { + node_ptr prev_p(NodeTraits::get_previous(p)); + node_ptr prev_b(NodeTraits::get_previous(b)); + node_ptr prev_e(NodeTraits::get_previous(e)); + NodeTraits::set_next(prev_e, p); + NodeTraits::set_previous(p, prev_e); + NodeTraits::set_next(prev_b, e); + NodeTraits::set_previous(e, prev_b); + NodeTraits::set_next(prev_p, b); + NodeTraits::set_previous(b, prev_p); + } + } + + //! Requires: i must a node of a circular list + //! and p must be a node of a different circular list. + //! + //! Effects: Removes the node i from its circular list and inserts + //! it before p in p's circular list. + //! If p == i or p == NodeTraits::get_next(i), this function is a null operation. + //! + //! Complexity: Constant + //! + //! Throws: Nothing. + static void transfer(const node_ptr &p, const node_ptr &i) + { + node_ptr n(NodeTraits::get_next(i)); + if(n != p && i != p){ + node_ptr prev_p(NodeTraits::get_previous(p)); + node_ptr prev_i(NodeTraits::get_previous(i)); + NodeTraits::set_next(prev_p, i); + NodeTraits::set_previous(i, prev_p); + NodeTraits::set_next(i, p); + NodeTraits::set_previous(p, i); + NodeTraits::set_previous(n, prev_i); + NodeTraits::set_next(prev_i, n); + + } + } + + //! Effects: Reverses the order of elements in the list. + //! + //! Throws: Nothing. + //! + //! Complexity: This function is linear time. + static void reverse(const node_ptr &p) + { + node_ptr f(NodeTraits::get_next(p)); + node_ptr i(NodeTraits::get_next(f)), e(p); + + while(i != e) { + node_ptr n = i; + i = NodeTraits::get_next(i); + transfer(f, n, i); + f = n; + } + } + + //! Effects: Moves the node p n positions towards the end of the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the number of moved positions. + static void move_backwards(const node_ptr &p, std::size_t n) + { + //Null shift, nothing to do + if(!n) return; + node_ptr first = NodeTraits::get_next(p); + //size() == 0 or 1, nothing to do + if(first == NodeTraits::get_previous(p)) return; + unlink(p); + //Now get the new first node + while(n--){ + first = NodeTraits::get_next(first); + } + link_before(first, p); + } + + //! Effects: Moves the node p n positions towards the beginning of the list. + //! + //! Throws: Nothing. + //! + //! Complexity: Linear to the number of moved positions. + static void move_forward(const node_ptr &p, std::size_t n) + { + //Null shift, nothing to do + if(!n) return; + node_ptr last = NodeTraits::get_previous(p); + //size() == 0 or 1, nothing to do + if(last == NodeTraits::get_next(p)) return; + + unlink(p); + //Now get the new last node + while(n--){ + last = NodeTraits::get_previous(last); + } + link_after(last, p); + } + + //! Requires: f and l must be in a circular list. + //! + //! Effects: Returns the number of nodes in the range [f, l). + //! + //! Complexity: Linear + //! + //! Throws: Nothing. + static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l) + { + const_node_ptr i(f); + std::size_t result = 0; + while(i != l){ + i = NodeTraits::get_next(i); + ++result; + } + return result; + } + + struct stable_partition_info + { + std::size_t num_1st_partition; + std::size_t num_2nd_partition; + node_ptr beg_2st_partition; + }; + + template + static void stable_partition(node_ptr beg, const node_ptr &end, Pred pred, stable_partition_info &info) + { + node_ptr bcur = node_traits::get_previous(beg); + node_ptr cur = beg; + node_ptr new_f = end; + + std::size_t num1 = 0, num2 = 0; + while(cur != end){ + if(pred(cur)){ + ++num1; + bcur = cur; + cur = node_traits::get_next(cur); + } + else{ + ++num2; + node_ptr last_to_remove = bcur; + new_f = cur; + bcur = cur; + cur = node_traits::get_next(cur); + AUTOBOOST_TRY{ + //Main loop + while(cur != end){ + if(pred(cur)){ //Might throw + ++num1; + //Process current node + node_traits::set_next (last_to_remove, cur); + node_traits::set_previous(cur, last_to_remove); + last_to_remove = cur; + node_ptr nxt = node_traits::get_next(cur); + node_traits::set_next (bcur, nxt); + node_traits::set_previous(nxt, bcur); + cur = nxt; + } + else{ + ++num2; + bcur = cur; + cur = node_traits::get_next(cur); + } + } + } + AUTOBOOST_CATCH(...){ + node_traits::set_next (last_to_remove, new_f); + node_traits::set_previous(new_f, last_to_remove); + throw; + } + AUTOBOOST_CATCH_END + node_traits::set_next(last_to_remove, new_f); + node_traits::set_previous(new_f, last_to_remove); + break; + } + } + info.num_1st_partition = num1; + info.num_2nd_partition = num2; + info.beg_2st_partition = new_f; + } +}; + +/// @cond + +template +struct get_algo +{ + typedef circular_list_algorithms type; +}; + +/// @endcond + +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP diff --git a/contrib/autoboost/boost/intrusive/circular_slist_algorithms.hpp b/contrib/autoboost/autoboost/intrusive/circular_slist_algorithms.hpp similarity index 96% rename from contrib/autoboost/boost/intrusive/circular_slist_algorithms.hpp rename to contrib/autoboost/autoboost/intrusive/circular_slist_algorithms.hpp index 855b33e31..263cd1902 100644 --- a/contrib/autoboost/boost/intrusive/circular_slist_algorithms.hpp +++ b/contrib/autoboost/autoboost/intrusive/circular_slist_algorithms.hpp @@ -11,18 +11,18 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP -#define BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP +#ifndef AUTOBOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP +#define AUTOBOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP #if defined(_MSC_VER) # pragma once #endif #include -#include -#include -#include -#include +#include +#include +#include +#include namespace autoboost { @@ -64,7 +64,7 @@ class circular_slist_algorithms typedef typename NodeTraits::const_node_ptr const_node_ptr; typedef NodeTraits node_traits; - #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) + #if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) //! Effects: Constructs an non-used list element, putting the next //! pointer to null: @@ -133,7 +133,7 @@ class circular_slist_algorithms //! Throws: Nothing. static void transfer_after(node_ptr p, node_ptr b, node_ptr e); - #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) + #endif //#if defined(AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED) //! Effects: Constructs an empty list, making this_node the only //! node of the circular list: @@ -402,6 +402,6 @@ struct get_algo } //namespace intrusive } //namespace autoboost -#include +#include -#endif //BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP +#endif //AUTOBOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/algo_type.hpp b/contrib/autoboost/autoboost/intrusive/detail/algo_type.hpp similarity index 87% rename from contrib/autoboost/boost/intrusive/detail/algo_type.hpp rename to contrib/autoboost/autoboost/intrusive/detail/algo_type.hpp index 727d1fd7e..602cb4c12 100644 --- a/contrib/autoboost/boost/intrusive/detail/algo_type.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/algo_type.hpp @@ -10,8 +10,8 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP -#define BOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP #if defined(_MSC_VER) # pragma once @@ -43,4 +43,4 @@ struct get_node_checker; } //namespace intrusive } //namespace autoboost -#endif //BOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_ALGO_TYPE_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/array_initializer.hpp b/contrib/autoboost/autoboost/intrusive/detail/array_initializer.hpp similarity index 83% rename from contrib/autoboost/boost/intrusive/detail/array_initializer.hpp rename to contrib/autoboost/autoboost/intrusive/detail/array_initializer.hpp index 57deeff00..9c59f3964 100644 --- a/contrib/autoboost/boost/intrusive/detail/array_initializer.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/array_initializer.hpp @@ -10,14 +10,14 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_ARRAY_INITIALIZER_HPP -#define BOOST_INTRUSIVE_DETAIL_ARRAY_INITIALIZER_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_ARRAY_INITIALIZER_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_ARRAY_INITIALIZER_HPP #if defined(_MSC_VER) # pragma once #endif -#include +#include namespace autoboost { namespace intrusive { @@ -30,7 +30,7 @@ union max_align short short_; int int_; long long_; - #ifdef BOOST_HAS_LONG_LONG + #ifdef AUTOBOOST_HAS_LONG_LONG long long long_long_; #endif float float_; @@ -48,20 +48,20 @@ class array_initializer { char *init_buf = (char*)rawbuf; std::size_t i = 0; - BOOST_TRY{ + AUTOBOOST_TRY{ for(; i != N; ++i){ new(init_buf)T(init); init_buf += sizeof(T); } } - BOOST_CATCH(...){ + AUTOBOOST_CATCH(...){ while(i--){ init_buf -= sizeof(T); ((T*)init_buf)->~T(); } - BOOST_RETHROW; + AUTOBOOST_RETHROW; } - BOOST_CATCH_END + AUTOBOOST_CATCH_END } operator T* () @@ -87,4 +87,4 @@ class array_initializer } //namespace intrusive{ } //namespace autoboost{ -#endif //BOOST_INTRUSIVE_DETAIL_ARRAY_INITIALIZER_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_ARRAY_INITIALIZER_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/assert.hpp b/contrib/autoboost/autoboost/intrusive/detail/assert.hpp new file mode 100644 index 000000000..ec6db9850 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/assert.hpp @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2006-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_ASSERT_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_ASSERT_HPP + +#if defined(_MSC_VER) +#pragma once +#endif + +#if !defined(AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT) + #include + #define AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT AUTOBOOST_ASSERT +#elif defined(AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT_INCLUDE) + #include AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT_INCLUDE +#endif + +#if !defined(AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT) + #include + #define AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT AUTOBOOST_ASSERT +#elif defined(AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE) + #include AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE +#endif + +#if !defined(AUTOBOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT) + #include + #define AUTOBOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT AUTOBOOST_ASSERT +#elif defined(AUTOBOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE) + #include AUTOBOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE +#endif + +#endif //AUTOBOOST_INTRUSIVE_DETAIL_ASSERT_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/avltree_node.hpp b/contrib/autoboost/autoboost/intrusive/detail/avltree_node.hpp new file mode 100644 index 000000000..e7101fcae --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/avltree_node.hpp @@ -0,0 +1,188 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2007-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_AVLTREE_NODE_HPP +#define AUTOBOOST_INTRUSIVE_AVLTREE_NODE_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { + +///////////////////////////////////////////////////////////////////////////// +// // +// Generic node_traits for any pointer type // +// // +///////////////////////////////////////////////////////////////////////////// + +//This is the compact representation: 3 pointers +template +struct compact_avltree_node +{ + typedef typename pointer_rebind >::type node_ptr; + typedef typename pointer_rebind >::type const_node_ptr; + enum balance { negative_t, zero_t, positive_t }; + node_ptr parent_, left_, right_; +}; + +//This is the normal representation: 3 pointers + enum +template +struct avltree_node +{ + typedef typename pointer_rebind >::type node_ptr; + typedef typename pointer_rebind >::type const_node_ptr; + enum balance { negative_t, zero_t, positive_t }; + node_ptr parent_, left_, right_; + balance balance_; +}; + +//This is the default node traits implementation +//using a node with 3 generic pointers plus an enum +template +struct default_avltree_node_traits_impl +{ + typedef avltree_node node; + typedef typename node::node_ptr node_ptr; + typedef typename node::const_node_ptr const_node_ptr; + + typedef typename node::balance balance; + + static node_ptr get_parent(const const_node_ptr & n) + { return n->parent_; } + + static node_ptr get_parent(const node_ptr & n) + { return n->parent_; } + + static void set_parent(const node_ptr & n, const node_ptr & p) + { n->parent_ = p; } + + static node_ptr get_left(const const_node_ptr & n) + { return n->left_; } + + static node_ptr get_left(const node_ptr & n) + { return n->left_; } + + static void set_left(const node_ptr & n, const node_ptr & l) + { n->left_ = l; } + + static node_ptr get_right(const const_node_ptr & n) + { return n->right_; } + + static node_ptr get_right(const node_ptr & n) + { return n->right_; } + + static void set_right(const node_ptr & n, const node_ptr & r) + { n->right_ = r; } + + static balance get_balance(const const_node_ptr & n) + { return n->balance_; } + + static balance get_balance(const node_ptr & n) + { return n->balance_; } + + static void set_balance(const node_ptr & n, balance b) + { n->balance_ = b; } + + static balance negative() + { return node::negative_t; } + + static balance zero() + { return node::zero_t; } + + static balance positive() + { return node::positive_t; } +}; + +//This is the compact node traits implementation +//using a node with 3 generic pointers +template +struct compact_avltree_node_traits_impl +{ + typedef compact_avltree_node node; + typedef typename node::node_ptr node_ptr; + typedef typename node::const_node_ptr const_node_ptr; + typedef typename node::balance balance; + + typedef pointer_plus_bits ptr_bit; + + static node_ptr get_parent(const const_node_ptr & n) + { return ptr_bit::get_pointer(n->parent_); } + + static void set_parent(const node_ptr & n, const node_ptr & p) + { ptr_bit::set_pointer(n->parent_, p); } + + static node_ptr get_left(const const_node_ptr & n) + { return n->left_; } + + static void set_left(const node_ptr & n, const node_ptr & l) + { n->left_ = l; } + + static node_ptr get_right(const const_node_ptr & n) + { return n->right_; } + + static void set_right(const node_ptr & n, const node_ptr & r) + { n->right_ = r; } + + static balance get_balance(const const_node_ptr & n) + { return (balance)ptr_bit::get_bits(n->parent_); } + + static void set_balance(const node_ptr & n, balance b) + { ptr_bit::set_bits(n->parent_, (std::size_t)b); } + + static balance negative() + { return node::negative_t; } + + static balance zero() + { return node::zero_t; } + + static balance positive() + { return node::positive_t; } +}; + +//Dispatches the implementation based on the boolean +template +struct avltree_node_traits_dispatch + : public default_avltree_node_traits_impl +{}; + +template +struct avltree_node_traits_dispatch + : public compact_avltree_node_traits_impl +{}; + +//Inherit from rbtree_node_traits_dispatch depending on the embedding capabilities +template +struct avltree_node_traits + : public avltree_node_traits_dispatch + < VoidPointer + , OptimizeSize && + max_pointer_plus_bits + < VoidPointer + , detail::alignment_of >::value + >::value >= 2u + > +{}; + +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_AVLTREE_NODE_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/common_slist_algorithms.hpp b/contrib/autoboost/autoboost/intrusive/detail/common_slist_algorithms.hpp similarity index 91% rename from contrib/autoboost/boost/intrusive/detail/common_slist_algorithms.hpp rename to contrib/autoboost/autoboost/intrusive/detail/common_slist_algorithms.hpp index 1589f2eff..b2c23771d 100644 --- a/contrib/autoboost/boost/intrusive/detail/common_slist_algorithms.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/common_slist_algorithms.hpp @@ -10,17 +10,17 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP -#define BOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP +#ifndef AUTOBOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP +#define AUTOBOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include -#include -#include +#include +#include +#include +#include #include namespace autoboost { @@ -43,7 +43,7 @@ class common_slist_algorithms ; p = p_next){ //Logic error: possible use of linear lists with //operations only permitted with lists - BOOST_INTRUSIVE_INVARIANT_ASSERT(p); + AUTOBOOST_INTRUSIVE_INVARIANT_ASSERT(p); } return p; } @@ -122,7 +122,7 @@ class common_slist_algorithms new_f = cur; bcur = cur; cur = node_traits::get_next(cur); - BOOST_TRY{ + AUTOBOOST_TRY{ //Main loop while(cur != end){ if(pred(cur)){ //Might throw @@ -141,11 +141,11 @@ class common_slist_algorithms } } } - BOOST_CATCH(...){ + AUTOBOOST_CATCH(...){ node_traits::set_next(last_to_remove, new_f); throw; } - BOOST_CATCH_END + AUTOBOOST_CATCH_END node_traits::set_next(last_to_remove, new_f); break; } @@ -191,4 +191,4 @@ struct get_algo } //namespace intrusive } //namespace autoboost -#endif //BOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP +#endif //AUTOBOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/config_begin.hpp b/contrib/autoboost/autoboost/intrusive/detail/config_begin.hpp new file mode 100644 index 000000000..fc87d2a9e --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/config_begin.hpp @@ -0,0 +1,51 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2006-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_CONFIG_HPP +#include +#endif + +#ifdef AUTOBOOST_MSVC + + #pragma warning (push) + // + //'function' : resolved overload was found by argument-dependent lookup + //A function found by argument-dependent lookup (Koenig lookup) was eventually + //chosen by overload resolution. + // + //In Visual C++ .NET and earlier compilers, a different function would have + //been called. To pick the original function, use an explicitly qualified name. + // + + //warning C4275: non dll-interface class 'x' used as base for + //dll-interface class 'Y' + #pragma warning (disable : 4275) + //warning C4251: 'x' : class 'y' needs to have dll-interface to + //be used by clients of class 'z' + #pragma warning (disable : 4251) + #pragma warning (disable : 4675) + #pragma warning (disable : 4996) + #pragma warning (disable : 4503) + #pragma warning (disable : 4284) // odd return type for operator-> + #pragma warning (disable : 4244) // possible loss of data + #pragma warning (disable : 4521) ////Disable "multiple copy constructors specified" + #pragma warning (disable : 4522) + #pragma warning (disable : 4146) + #pragma warning (disable : 4267) //conversion from 'X' to 'Y', possible loss of data + #pragma warning (disable : 4127) //conditional expression is constant + #pragma warning (disable : 4706) //assignment within conditional expression + #pragma warning (disable : 4541) //'typeid' used on polymorphic type 'autoboost::exception' with /GR- + #pragma warning (disable : 4512) //'typeid' used on polymorphic type 'autoboost::exception' with /GR- +#endif + +//#define AUTOBOOST_INTRUSIVE_USE_ITERATOR_FACADE +//#define AUTOBOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE diff --git a/contrib/autoboost/autoboost/intrusive/detail/config_end.hpp b/contrib/autoboost/autoboost/intrusive/detail/config_end.hpp new file mode 100644 index 000000000..77e9b1c86 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/config_end.hpp @@ -0,0 +1,15 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2006-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#if defined AUTOBOOST_MSVC + #pragma warning (pop) +#endif diff --git a/contrib/autoboost/boost/intrusive/detail/default_header_holder.hpp b/contrib/autoboost/autoboost/intrusive/detail/default_header_holder.hpp similarity index 86% rename from contrib/autoboost/boost/intrusive/detail/default_header_holder.hpp rename to contrib/autoboost/autoboost/intrusive/detail/default_header_holder.hpp index 2d5841a6c..4dd6aad4c 100644 --- a/contrib/autoboost/boost/intrusive/detail/default_header_holder.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/default_header_holder.hpp @@ -10,15 +10,15 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_DEFAULT_HEADER_HOLDER_HPP -#define BOOST_INTRUSIVE_DETAIL_DEFAULT_HEADER_HOLDER_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_DEFAULT_HEADER_HOLDER_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_DEFAULT_HEADER_HOLDER_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include +#include +#include namespace autoboost { namespace intrusive { @@ -62,4 +62,4 @@ struct get_header_holder_type< Value_Traits, void > } //namespace intrusive } //namespace autoboost -#endif //BOOST_INTRUSIVE_DETAIL_DEFAULT_HEADER_HOLDER_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_DEFAULT_HEADER_HOLDER_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/ebo_functor_holder.hpp b/contrib/autoboost/autoboost/intrusive/detail/ebo_functor_holder.hpp similarity index 88% rename from contrib/autoboost/boost/intrusive/detail/ebo_functor_holder.hpp rename to contrib/autoboost/autoboost/intrusive/detail/ebo_functor_holder.hpp index 3f77f9e9b..40e973d8d 100644 --- a/contrib/autoboost/boost/intrusive/detail/ebo_functor_holder.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/ebo_functor_holder.hpp @@ -11,27 +11,27 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP -#define BOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP #if defined(_MSC_VER) # pragma once #endif -#include +#include namespace autoboost { namespace intrusive { namespace detail { -#if defined(BOOST_MSVC) || defined(__BORLANDC_) -#define BOOST_INTRUSIVE_TT_DECL __cdecl +#if defined(AUTOBOOST_MSVC) || defined(__BORLANDC_) +#define AUTOBOOST_INTRUSIVE_TT_DECL __cdecl #else -#define BOOST_INTRUSIVE_TT_DECL +#define AUTOBOOST_INTRUSIVE_TT_DECL #endif #if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64) && !defined(_M_ARM) && !defined(UNDER_CE) -#define BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS +#define AUTOBOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS #endif template @@ -40,7 +40,7 @@ struct is_unary_or_binary_function_impl // see boost ticket #4094 // avoid duplicate definitions of is_unary_or_binary_function_impl -#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS +#ifndef AUTOBOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS template struct is_unary_or_binary_function_impl @@ -50,7 +50,7 @@ template struct is_unary_or_binary_function_impl { static const bool value = true; }; -#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS +#else // AUTOBOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS template struct is_unary_or_binary_function_impl @@ -76,7 +76,7 @@ struct is_unary_or_binary_function_impl // see boost ticket #4094 // avoid duplicate definitions of is_unary_or_binary_function_impl -#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS +#ifndef AUTOBOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS template struct is_unary_or_binary_function_impl @@ -86,7 +86,7 @@ template struct is_unary_or_binary_function_impl { static const bool value = true; }; -#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS +#else // AUTOBOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS template struct is_unary_or_binary_function_impl @@ -112,7 +112,7 @@ struct is_unary_or_binary_function_impl // see boost ticket #4094 // avoid duplicate definitions of is_unary_or_binary_function_impl -#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS +#ifndef AUTOBOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS template struct is_unary_or_binary_function_impl @@ -122,7 +122,7 @@ template struct is_unary_or_binary_function_impl { static const bool value = true; }; -#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS +#else // AUTOBOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS template struct is_unary_or_binary_function_impl @@ -223,4 +223,4 @@ class ebo_functor_holder } //namespace intrusive { } //namespace autoboost { -#endif //#ifndef BOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP +#endif //#ifndef AUTOBOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/empty_node_checker.hpp b/contrib/autoboost/autoboost/intrusive/detail/empty_node_checker.hpp new file mode 100644 index 000000000..ed51caf6a --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/empty_node_checker.hpp @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2014-2014 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_EMPTY_NODE_CHECKER_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_EMPTY_NODE_CHECKER_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +namespace autoboost { +namespace intrusive { +namespace detail { + +template +struct empty_node_checker +{ + typedef ValueTraits value_traits; + typedef typename value_traits::node_traits node_traits; + typedef typename node_traits::const_node_ptr const_node_ptr; + + struct return_type {}; + + void operator () (const const_node_ptr&, const return_type&, const return_type&, return_type&) {} +}; + +} //namespace detail{ +} //namespace intrusive{ +} //namespace autoboost{ + +#endif //AUTOBOOST_INTRUSIVE_DETAIL_EMPTY_NODE_CHECKER_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/equal_to_value.hpp b/contrib/autoboost/autoboost/intrusive/detail/equal_to_value.hpp similarity index 84% rename from contrib/autoboost/boost/intrusive/detail/equal_to_value.hpp rename to contrib/autoboost/autoboost/intrusive/detail/equal_to_value.hpp index 3fc676dc6..51faab1e2 100644 --- a/contrib/autoboost/boost/intrusive/detail/equal_to_value.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/equal_to_value.hpp @@ -10,8 +10,8 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP -#define BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP #if defined(_MSC_VER) # pragma once @@ -41,4 +41,4 @@ class equal_to_value } //namespace intrusive{ } //namespace autoboost{ -#endif //BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/exception_disposer.hpp b/contrib/autoboost/autoboost/intrusive/detail/exception_disposer.hpp similarity index 91% rename from contrib/autoboost/boost/intrusive/detail/exception_disposer.hpp rename to contrib/autoboost/autoboost/intrusive/detail/exception_disposer.hpp index 5b3a81a6c..db6dfd9e8 100644 --- a/contrib/autoboost/boost/intrusive/detail/exception_disposer.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/exception_disposer.hpp @@ -10,8 +10,8 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_EXCEPTION_DISPOSER_HPP -#define BOOST_INTRUSIVE_DETAIL_EXCEPTION_DISPOSER_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_EXCEPTION_DISPOSER_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_EXCEPTION_DISPOSER_HPP #if defined(_MSC_VER) # pragma once @@ -81,4 +81,4 @@ class exception_array_disposer } //namespace intrusive{ } //namespace autoboost{ -#endif //BOOST_INTRUSIVE_DETAIL_EXCEPTION_DISPOSER_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_EXCEPTION_DISPOSER_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/function_detector.hpp b/contrib/autoboost/autoboost/intrusive/detail/function_detector.hpp similarity index 89% rename from contrib/autoboost/boost/intrusive/detail/function_detector.hpp rename to contrib/autoboost/autoboost/intrusive/detail/function_detector.hpp index 8533c6eb8..09422382d 100644 --- a/contrib/autoboost/boost/intrusive/detail/function_detector.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/function_detector.hpp @@ -19,8 +19,8 @@ // provided that this copyright notice appears on all copies of the software. /////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP -#define BOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP #if defined(_MSC_VER) # pragma once @@ -44,7 +44,7 @@ namespace function_detector { } //namespace intrusive { } //namespace function_detector { -#define BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(Identifier, InstantiationKey) \ +#define AUTOBOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(Identifier, InstantiationKey) \ namespace autoboost { \ namespace intrusive { \ namespace function_detector { \ @@ -78,11 +78,11 @@ namespace function_detector { };\ }}} //namespace autoboost::intrusive::function_detector { -#define BOOST_INTRUSIVE_DETECT_FUNCTION(Class, InstantiationKey, ReturnType, Identifier, Params) \ +#define AUTOBOOST_INTRUSIVE_DETECT_FUNCTION(Class, InstantiationKey, ReturnType, Identifier, Params) \ ::autoboost::intrusive::function_detector::DetectMember_##InstantiationKey_##Identifier< Class,\ ReturnType (Class::*)Params,\ ReturnType (Class::*)Params const,\ ReturnType (*)Params \ >::check -#endif //@ifndef BOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP +#endif //@ifndef AUTOBOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/generic_hook.hpp b/contrib/autoboost/autoboost/intrusive/detail/generic_hook.hpp similarity index 89% rename from contrib/autoboost/boost/intrusive/detail/generic_hook.hpp rename to contrib/autoboost/autoboost/intrusive/detail/generic_hook.hpp index ccff88491..1b1158200 100644 --- a/contrib/autoboost/boost/intrusive/detail/generic_hook.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/generic_hook.hpp @@ -10,19 +10,19 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_GENERIC_HOOK_HPP -#define BOOST_INTRUSIVE_GENERIC_HOOK_HPP +#ifndef AUTOBOOST_INTRUSIVE_GENERIC_HOOK_HPP +#define AUTOBOOST_INTRUSIVE_GENERIC_HOOK_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace autoboost { namespace intrusive { @@ -40,7 +40,7 @@ void destructor_impl(Hook &hook, detail::link_dispatch) { //If this assertion raises, you might have destroyed an object //while it was still inserted in a container that is alive. //If so, remove the object from the container before destroying it. - (void)hook; BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT(!hook.is_linked()); + (void)hook; AUTOBOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT(!hook.is_linked()); } template @@ -196,13 +196,13 @@ class generic_hook bool is_linked() const { //is_linked() can be only used in safe-mode or auto-unlink - BOOST_STATIC_ASSERT(( hooktags::safemode_or_autounlink )); + AUTOBOOST_STATIC_ASSERT(( hooktags::safemode_or_autounlink )); return !node_algorithms::unique(this->this_ptr()); } void unlink() { - BOOST_STATIC_ASSERT(( (int)hooktags::link_mode == (int)auto_unlink )); + AUTOBOOST_STATIC_ASSERT(( (int)hooktags::link_mode == (int)auto_unlink )); node_ptr n(this->this_ptr()); if(!node_algorithms::inited(n)){ node_algorithms::unlink(n); @@ -214,4 +214,4 @@ class generic_hook } //namespace intrusive } //namespace autoboost -#endif //BOOST_INTRUSIVE_GENERIC_HOOK_HPP +#endif //AUTOBOOST_INTRUSIVE_GENERIC_HOOK_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/get_value_traits.hpp b/contrib/autoboost/autoboost/intrusive/detail/get_value_traits.hpp similarity index 90% rename from contrib/autoboost/boost/intrusive/detail/get_value_traits.hpp rename to contrib/autoboost/autoboost/intrusive/detail/get_value_traits.hpp index 6f0ce7ffe..3a633e28e 100644 --- a/contrib/autoboost/boost/intrusive/detail/get_value_traits.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/get_value_traits.hpp @@ -10,21 +10,21 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_GET_VALUE_TRAITS_HPP -#define BOOST_INTRUSIVE_DETAIL_GET_VALUE_TRAITS_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_GET_VALUE_TRAITS_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_GET_VALUE_TRAITS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include -#include +#include +#include +#include namespace autoboost { namespace intrusive { -#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED +#ifndef AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED template struct is_default_hook_tag @@ -97,8 +97,8 @@ struct get_member_value_traits typedef typename MemberHook::member_value_traits type; }; -BOOST_INTRUSIVE_INTERNAL_STATIC_BOOL_IS_TRUE(internal_any_hook, is_any_hook) -BOOST_INTRUSIVE_INTERNAL_STATIC_BOOL_IS_TRUE(internal_base_hook, hooktags::is_base_hook) +AUTOBOOST_INTRUSIVE_INTERNAL_STATIC_BOOL_IS_TRUE(internal_any_hook, is_any_hook) +AUTOBOOST_INTRUSIVE_INTERNAL_STATIC_BOOL_IS_TRUE(internal_base_hook, hooktags::is_base_hook) template struct internal_member_value_traits @@ -208,11 +208,11 @@ struct get_node_traits } //namespace detail{ -#endif //BOOST_INTRUSIVE_DOXYGEN_INVOKED +#endif //AUTOBOOST_INTRUSIVE_DOXYGEN_INVOKED } //namespace intrusive { } //namespace autoboost { -#include +#include -#endif //#ifndef BOOST_INTRUSIVE_DETAIL_GET_VALUE_TRAITS_HPP +#endif //#ifndef AUTOBOOST_INTRUSIVE_DETAIL_GET_VALUE_TRAITS_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/has_member_function_callable_with.hpp b/contrib/autoboost/autoboost/intrusive/detail/has_member_function_callable_with.hpp new file mode 100644 index 000000000..31439eca3 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/has_member_function_callable_with.hpp @@ -0,0 +1,372 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2011-2014. 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/libs/intrusive for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +// sample.h + +#if !defined(AUTOBOOST_PP_IS_ITERATING) + + #ifndef AUTOBOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_DETAILS_INCLUDED + #define AUTOBOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_DETAILS_INCLUDED + + #include + #include + #include + + + //Mark that we don't support 0 arg calls due to compiler ICE in GCC 3.4/4.0/4.1 and + //wrong SFINAE for GCC 4.2/4.3 + #if defined(__GNUC__) && !defined(__clang__) && ((__GNUC__*100 + __GNUC_MINOR__*10) >= 340) && ((__GNUC__*100 + __GNUC_MINOR__*10) <= 430) + #define AUTOBOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED + #elif defined(AUTOBOOST_INTEL) && (AUTOBOOST_INTEL < 1200 ) + #define AUTOBOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED + #endif + + namespace autoboost_intrusive_has_member_function_callable_with { + + struct dont_care + { + dont_care(...); + }; + + template + struct make_dontcare + { + typedef autoboost_intrusive_has_member_function_callable_with::dont_care type; + }; + + struct private_type + { + static private_type p; + private_type const &operator,(int) const; + }; + + typedef char yes_type; // sizeof(yes_type) == 1 + struct no_type{ char dummy[2]; }; // sizeof(no_type) == 2 + + template + no_type is_private_type(T const &); + yes_type is_private_type(private_type const &); + + } //boost_intrusive_has_member_function_callable_with + + #if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + #define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_SINGLE_ITERATION + #endif + + #endif //AUTOBOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_DETAILS_INCLUDED + +#else //!AUTOBOOST_PP_IS_ITERATING + + #ifndef AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME + #error "AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME not defined!" + #endif + + #ifndef AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN + #error "AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN not defined!" + #endif + + #ifndef AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END + #error "AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END not defined!" + #endif + + #if AUTOBOOST_PP_ITERATION_START() > AUTOBOOST_PP_ITERATION_FINISH() + #error "AUTOBOOST_PP_ITERATION_START() must be <= AUTOBOOST_PP_ITERATION_FINISH()" + #endif + + #if AUTOBOOST_PP_ITERATION() == AUTOBOOST_PP_ITERATION_START() + + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN + + template + class AUTOBOOST_PP_CAT(has_member_function_named_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + { + struct BaseMixin + { + void AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME(); + }; + + struct Base : public ::autoboost::intrusive::detail::remove_cv::type, public BaseMixin { Base(); }; + template class Helper{}; + + template + static autoboost_intrusive_has_member_function_callable_with::no_type deduce + (U*, Helper* = 0); + static autoboost_intrusive_has_member_function_callable_with::yes_type deduce(...); + + public: + static const bool value = + sizeof(autoboost_intrusive_has_member_function_callable_with::yes_type) == sizeof(deduce((Base*)(0))); + }; + + #if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + template + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME), _impl); + //! + + template + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME), _impl) + + { + static const bool value = false; + }; + //! + + #else //!defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + template + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl); + + template + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) + + { + static const bool value = false; + }; + + #ifdef AUTOBOOST_NO_CXX11_DECLTYPE + + //Special case for 0 args + template< class F + , std::size_t N = + sizeof((autoboost::move_detail::declval(). + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME (), 0))> + struct AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + { + autoboost_intrusive_has_member_function_callable_with::yes_type dummy; + AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)(int); + }; + + //For buggy compilers like MSVC 7.1+ ((F*)0)->func() does not + //SFINAE-out the zeroarg_checker_ instantiation but sizeof yields to 0. + template + struct AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + { + autoboost_intrusive_has_member_function_callable_with::no_type dummy; + AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)(int); + }; + + #endif //#ifdef AUTOBOOST_NO_CXX11_DECLTYPE + + template + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) + + { + #ifndef AUTOBOOST_NO_CXX11_DECLTYPE + template().AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME()) > + static autoboost_intrusive_has_member_function_callable_with::yes_type Test(U*); + #else + template + static AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + Test(AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)*); + #endif + + template + static autoboost_intrusive_has_member_function_callable_with::no_type Test(...); + + static const bool value = sizeof(Test< Fun >(0)) + == sizeof(autoboost_intrusive_has_member_function_callable_with::yes_type); + }; + + template + struct AUTOBOOST_PP_CAT( AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME), _impl) + + { + + template + struct FunWrapTmpl : Fun + { + FunWrapTmpl(); + using Fun::AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME; + + autoboost_intrusive_has_member_function_callable_with::private_type + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME + ( DontCares...) const; + }; + + typedef FunWrapTmpl::type...> FunWrap; + + static bool const value = (sizeof(autoboost_intrusive_has_member_function_callable_with::no_type) == + sizeof(autoboost_intrusive_has_member_function_callable_with::is_private_type + ( (::autoboost::move_detail::declval< FunWrap >(). + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME + ( ::autoboost::move_detail::declval()... ), 0) ) + ) + ); + }; + + template + struct AUTOBOOST_PP_CAT( has_member_function_callable_with_ + , AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + : public AUTOBOOST_PP_CAT( AUTOBOOST_PP_CAT(has_member_function_callable_with_ + , AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) + < Fun + , AUTOBOOST_PP_CAT( has_member_function_named_ + , AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME )::value + , Args... > + {}; + + #endif //defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END + + #endif //AUTOBOOST_PP_ITERATION() == AUTOBOOST_PP_ITERATION_START() + + #if AUTOBOOST_PP_ITERATION() == 0 + + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN + + #if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + #if !defined(_MSC_VER) || (_MSC_VER < 1600) + + #if defined(AUTOBOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED) + + template + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) + + { + //Mark that we don't support 0 arg calls due to compiler ICE in GCC 3.4/4.0/4.1 and + //wrong SFINAE for GCC 4.2/4.3 + static const bool value = true; + }; + + #else //defined(AUTOBOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED) + + //Special case for 0 args + template< class F + , std::size_t N = + sizeof((autoboost::move_detail::declval(). + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME (), 0))> + struct AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + { + autoboost_intrusive_has_member_function_callable_with::yes_type dummy; + AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)(int); + }; + + //For buggy compilers like MSVC 7.1+ ((F*)0)->func() does not + //SFINAE-out the zeroarg_checker_ instantiation but sizeof yields to 0. + template + struct AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + { + autoboost_intrusive_has_member_function_callable_with::no_type dummy; + AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)(int); + }; + + template + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) + + { + template + static AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + Test(AUTOBOOST_PP_CAT(zeroarg_checker_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)*); + + template + static autoboost_intrusive_has_member_function_callable_with::no_type Test(...); + + static const bool value = sizeof(Test< Fun >(0)) + == sizeof(autoboost_intrusive_has_member_function_callable_with::yes_type); + }; + #endif //defined(AUTOBOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED) + + #else //#if !defined(_MSC_VER) || (_MSC_VER < 1600) + template + struct AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) + + { + template + static decltype( autoboost::move_detail::declval().AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME() + , autoboost_intrusive_has_member_function_callable_with::yes_type()) + Test(U*); + + template + static autoboost_intrusive_has_member_function_callable_with::no_type Test(...); + + static const bool value = sizeof(Test(0)) + == sizeof(autoboost_intrusive_has_member_function_callable_with::yes_type); + }; + #endif //#if !defined(_MSC_VER) || (_MSC_VER < 1600) + + #else //#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + #endif //#if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END + + #else //AUTOBOOST_PP_ITERATION() == 0 + + #if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN + + template + struct AUTOBOOST_PP_CAT( AUTOBOOST_PP_CAT(has_member_function_callable_with_ + , AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) + + { + struct FunWrap : Fun + { + FunWrap(); + + using Fun::AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME; + autoboost_intrusive_has_member_function_callable_with::private_type + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME + ( AUTOBOOST_PP_ENUM(AUTOBOOST_PP_ITERATION() + , AUTOBOOST_INTRUSIVE_PP_IDENTITY + , autoboost_intrusive_has_member_function_callable_with::dont_care)) const; + }; + + static bool const value = + (sizeof(autoboost_intrusive_has_member_function_callable_with::no_type) == + sizeof(autoboost_intrusive_has_member_function_callable_with::is_private_type + ( (autoboost::move_detail::declval(). + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME + ( AUTOBOOST_PP_ENUM( AUTOBOOST_PP_ITERATION(), AUTOBOOST_INTRUSIVE_PP_DECLVAL, _) ), 0 + ) + ) + ) + ); + }; + + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END + #endif //#if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + #endif //AUTOBOOST_PP_ITERATION() == 0 + + #if AUTOBOOST_PP_ITERATION() == AUTOBOOST_PP_ITERATION_FINISH() + + #if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN + + template + struct AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME) + : public AUTOBOOST_PP_CAT(AUTOBOOST_PP_CAT(has_member_function_callable_with_, AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME), _impl) + ::value + AUTOBOOST_PP_ENUM_TRAILING_PARAMS(AUTOBOOST_PP_ITERATION_FINISH(), P) > + {}; + + AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END + + #endif //#if defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) + + #undef AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME + #undef AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN + #undef AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END + + #endif //#if AUTOBOOST_PP_ITERATION() == AUTOBOOST_PP_ITERATION_FINISH() + +#endif //!AUTOBOOST_PP_IS_ITERATING diff --git a/contrib/autoboost/boost/intrusive/detail/hook_traits.hpp b/contrib/autoboost/autoboost/intrusive/detail/hook_traits.hpp similarity index 94% rename from contrib/autoboost/boost/intrusive/detail/hook_traits.hpp rename to contrib/autoboost/autoboost/intrusive/detail/hook_traits.hpp index 7ce818d2e..89c9150d3 100644 --- a/contrib/autoboost/boost/intrusive/detail/hook_traits.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/hook_traits.hpp @@ -10,19 +10,19 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_HOOK_TRAITS_HPP -#define BOOST_INTRUSIVE_DETAIL_HOOK_TRAITS_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_HOOK_TRAITS_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_HOOK_TRAITS_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace autoboost { namespace intrusive { @@ -179,4 +179,4 @@ struct fhtraits } //namespace intrusive } //namespace autoboost -#endif //BOOST_INTRUSIVE_DETAIL_HOOK_TRAITS_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_HOOK_TRAITS_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/iiterator.hpp b/contrib/autoboost/autoboost/intrusive/detail/iiterator.hpp similarity index 94% rename from contrib/autoboost/boost/intrusive/detail/iiterator.hpp rename to contrib/autoboost/autoboost/intrusive/detail/iiterator.hpp index 31c27cd92..3c5193348 100644 --- a/contrib/autoboost/boost/intrusive/detail/iiterator.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/iiterator.hpp @@ -10,17 +10,17 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_IITERATOR_HPP -#define BOOST_INTRUSIVE_DETAIL_IITERATOR_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_IITERATOR_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_IITERATOR_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -71,7 +71,7 @@ struct iterator_traits template struct value_traits_pointers { - typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT + typedef AUTOBOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT (autoboost::intrusive::detail:: , ValueTraits, value_traits_ptr , typename pointer_traits::template @@ -224,4 +224,4 @@ typename iterator_traits::difference_type iterator_distance(InputIt fir } //namespace intrusive } //namespace autoboost -#endif //BOOST_INTRUSIVE_DETAIL_IITERATOR_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_IITERATOR_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/is_stateful_value_traits.hpp b/contrib/autoboost/autoboost/intrusive/detail/is_stateful_value_traits.hpp new file mode 100644 index 000000000..a9deeb479 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/is_stateful_value_traits.hpp @@ -0,0 +1,77 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2009-2013. +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#if defined(_MSC_VER) && (_MSC_VER <= 1310) + +#include + +namespace autoboost { +namespace intrusive { +namespace detail { + +template +struct is_stateful_value_traits +{ + static const bool value = !detail::is_empty_class::value; +}; + +}}} + +#else + +#include + +AUTOBOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_node_ptr, boost_intrusive) +AUTOBOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_value_ptr, boost_intrusive) + +namespace autoboost { +namespace intrusive { +namespace detail { + +template +struct is_stateful_value_traits +{ + typedef typename ValueTraits::node_ptr node_ptr; + typedef typename ValueTraits::pointer pointer; + typedef typename ValueTraits::value_type value_type; + typedef typename ValueTraits::const_node_ptr const_node_ptr; + typedef typename ValueTraits::const_pointer const_pointer; + + typedef ValueTraits value_traits; + + static const bool value = + (autoboost::intrusive::function_detector::NonStaticFunction == + (AUTOBOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, node_ptr, to_node_ptr, (value_type&) ))) + || + (autoboost::intrusive::function_detector::NonStaticFunction == + (AUTOBOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, pointer, to_value_ptr, (node_ptr) ))) + || + (autoboost::intrusive::function_detector::NonStaticFunction == + (AUTOBOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_node_ptr, to_node_ptr, (const value_type&) ))) + || + (autoboost::intrusive::function_detector::NonStaticFunction == + (AUTOBOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_pointer, to_value_ptr, (const_node_ptr) ))) + ; +}; + +}}} + +#endif + +#endif //@ifndef AUTOBOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/key_nodeptr_comp.hpp b/contrib/autoboost/autoboost/intrusive/detail/key_nodeptr_comp.hpp similarity index 88% rename from contrib/autoboost/boost/intrusive/detail/key_nodeptr_comp.hpp rename to contrib/autoboost/autoboost/intrusive/detail/key_nodeptr_comp.hpp index cb3093465..ce3f318d3 100644 --- a/contrib/autoboost/boost/intrusive/detail/key_nodeptr_comp.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/key_nodeptr_comp.hpp @@ -10,15 +10,15 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP -#define BOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP #if defined(_MSC_VER) # pragma once #endif -#include -#include +#include +#include namespace autoboost { namespace intrusive { @@ -69,4 +69,4 @@ struct key_nodeptr_comp } //namespace intrusive{ } //namespace autoboost{ -#endif //BOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/list_iterator.hpp b/contrib/autoboost/autoboost/intrusive/detail/list_iterator.hpp new file mode 100644 index 000000000..17d14550f --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/list_iterator.hpp @@ -0,0 +1,129 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Olaf Krzikalla 2004-2006. +// (C) Copyright Ion Gaztanaga 2006-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_LIST_ITERATOR_HPP +#define AUTOBOOST_INTRUSIVE_LIST_ITERATOR_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include + +namespace autoboost { +namespace intrusive { + +// list_iterator provides some basic functions for a +// node oriented bidirectional iterator: +template +class list_iterator +{ + protected: + typedef iiterator + types_t; + + static const bool stateful_value_traits = types_t::stateful_value_traits; + + typedef ValueTraits value_traits; + typedef typename types_t::node_traits node_traits; + + typedef typename types_t::node node; + typedef typename types_t::node_ptr node_ptr; + typedef typename types_t::const_value_traits_ptr const_value_traits_ptr; + + public: + typedef typename types_t::iterator_traits::difference_type difference_type; + typedef typename types_t::iterator_traits::value_type value_type; + typedef typename types_t::iterator_traits::pointer pointer; + typedef typename types_t::iterator_traits::reference reference; + typedef typename types_t::iterator_traits::iterator_category iterator_category; + + list_iterator() + {} + + explicit list_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr) + : members_(nodeptr, traits_ptr) + {} + + list_iterator(list_iterator const& other) + : members_(other.pointed_node(), other.get_value_traits()) + {} + + const node_ptr &pointed_node() const + { return members_.nodeptr_; } + + list_iterator &operator=(const node_ptr &node) + { members_.nodeptr_ = node; return static_cast(*this); } + + const_value_traits_ptr get_value_traits() const + { return members_.get_ptr(); } + + public: + list_iterator& operator++() + { + node_ptr p = node_traits::get_next(members_.nodeptr_); + members_.nodeptr_ = p; + return static_cast (*this); + } + + list_iterator operator++(int) + { + list_iterator result (*this); + members_.nodeptr_ = node_traits::get_next(members_.nodeptr_); + return result; + } + + list_iterator& operator--() + { + members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_); + return static_cast (*this); + } + + list_iterator operator--(int) + { + list_iterator result (*this); + members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_); + return result; + } + + friend bool operator== (const list_iterator& l, const list_iterator& r) + { return l.pointed_node() == r.pointed_node(); } + + friend bool operator!= (const list_iterator& l, const list_iterator& r) + { return !(l == r); } + + reference operator*() const + { return *operator->(); } + + pointer operator->() const + { return this->operator_arrow(detail::bool_()); } + + list_iterator unconst() const + { return list_iterator(this->pointed_node(), this->get_value_traits()); } + + private: + pointer operator_arrow(detail::false_) const + { return ValueTraits::to_value_ptr(members_.nodeptr_); } + + pointer operator_arrow(detail::true_) const + { return this->get_value_traits()->to_value_ptr(members_.nodeptr_); } + + iiterator_members members_; +}; + +} //namespace intrusive +} //namespace autoboost + +#endif //AUTOBOOST_INTRUSIVE_LIST_ITERATOR_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/list_node.hpp b/contrib/autoboost/autoboost/intrusive/detail/list_node.hpp new file mode 100644 index 000000000..6cf905f3f --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/list_node.hpp @@ -0,0 +1,67 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Olaf Krzikalla 2004-2006. +// (C) Copyright Ion Gaztanaga 2006-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_LIST_NODE_HPP +#define AUTOBOOST_INTRUSIVE_LIST_NODE_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include + +namespace autoboost { +namespace intrusive { + +// list_node_traits can be used with circular_list_algorithms and supplies +// a list_node holding the pointers needed for a double-linked list +// it is used by list_derived_node and list_member_node + +template +struct list_node +{ + typedef typename pointer_rebind::type node_ptr; + node_ptr next_; + node_ptr prev_; +}; + +template +struct list_node_traits +{ + typedef list_node node; + typedef typename node::node_ptr node_ptr; + typedef typename pointer_rebind::type const_node_ptr; + + static node_ptr get_previous(const const_node_ptr & n) + { return n->prev_; } + + static node_ptr get_previous(const node_ptr & n) + { return n->prev_; } + + static void set_previous(const node_ptr & n, const node_ptr & prev) + { n->prev_ = prev; } + + static node_ptr get_next(const const_node_ptr & n) + { return n->next_; } + + static node_ptr get_next(const node_ptr & n) + { return n->next_; } + + static void set_next(const node_ptr & n, const node_ptr & next) + { n->next_ = next; } +}; + +} //namespace intrusive +} //namespace autoboost + +#endif //AUTOBOOST_INTRUSIVE_LIST_NODE_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/math.hpp b/contrib/autoboost/autoboost/intrusive/detail/math.hpp new file mode 100644 index 000000000..625f832e2 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/math.hpp @@ -0,0 +1,271 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2014-2014 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_MATH_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_MATH_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +namespace autoboost { +namespace intrusive { +namespace detail { + +/////////////////////////// +// floor_log2 Dispatcher +//////////////////////////// + +#if defined(_MSC_VER) && (_MSC_VER >= 1300) + + }}} //namespace autoboost::intrusive::detail + + //Use _BitScanReverseXX intrinsics + + #if defined(_M_X64) || defined(_M_AMD64) || defined(_M_IA64) //64 bit target + #define AUTOBOOST_INTRUSIVE_BSR_INTRINSIC_64_BIT + #endif + + #ifndef __INTRIN_H_ // Avoid including any windows system header + #ifdef __cplusplus + extern "C" { + #endif // __cplusplus + + #if defined(AUTOBOOST_INTRUSIVE_BSR_INTRINSIC_64_BIT) //64 bit target + unsigned char _BitScanReverse64(unsigned long *index, unsigned __int64 mask); + #pragma intrinsic(_BitScanReverse64) + #else //32 bit target + unsigned char _BitScanReverse(unsigned long *index, unsigned long mask); + #pragma intrinsic(_BitScanReverse) + #endif + + #ifdef __cplusplus + } + #endif // __cplusplus + #endif // __INTRIN_H_ + + #ifdef AUTOBOOST_INTRUSIVE_BSR_INTRINSIC_64_BIT + #define AUTOBOOST_INTRUSIVE_BSR_INTRINSIC _BitScanReverse64 + #undef AUTOBOOST_INTRUSIVE_BSR_INTRINSIC_64_BIT + #else + #define AUTOBOOST_INTRUSIVE_BSR_INTRINSIC _BitScanReverse + #endif + + namespace autoboost { + namespace intrusive { + namespace detail { + + inline std::size_t floor_log2 (std::size_t x) + { + unsigned long log2; + AUTOBOOST_INTRUSIVE_BSR_INTRINSIC( &log2, (unsigned long)x ); + return log2; + } + + #undef AUTOBOOST_INTRUSIVE_BSR_INTRINSIC + +#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) //GCC >=3.4 + + //Compile-time error in case of missing specialization + template + struct builtin_clz_dispatch; + + #if defined(AUTOBOOST_HAS_LONG_LONG) + template<> + struct builtin_clz_dispatch + { + static unsigned long long call(unsigned long long n) + { return __builtin_clzll(n); } + }; + #endif + + template<> + struct builtin_clz_dispatch + { + static unsigned long call(unsigned long n) + { return __builtin_clzl(n); } + }; + + template<> + struct builtin_clz_dispatch + { + static unsigned int call(unsigned int n) + { return __builtin_clz(n); } + }; + + inline std::size_t floor_log2(std::size_t n) + { + return sizeof(std::size_t)*CHAR_BIT - std::size_t(1) - builtin_clz_dispatch::call(n); + } + +#else //Portable methods + +//////////////////////////// +// Generic method +//////////////////////////// + + inline std::size_t floor_log2_get_shift(std::size_t n, true_ )//power of two size_t + { return n >> 1; } + + inline std::size_t floor_log2_get_shift(std::size_t n, false_ )//non-power of two size_t + { return (n >> 1) + ((n & 1u) & (n != 1)); } + + template + inline std::size_t floor_log2 (std::size_t x, integer) + { + const std::size_t Bits = N; + const bool Size_t_Bits_Power_2= !(Bits & (Bits-1)); + + std::size_t n = x; + std::size_t log2 = 0; + + std::size_t remaining_bits = Bits; + std::size_t shift = floor_log2_get_shift(remaining_bits, bool_()); + while(shift){ + std::size_t tmp = n >> shift; + if (tmp){ + log2 += shift, n = tmp; + } + shift = floor_log2_get_shift(shift, bool_()); + } + + return log2; + } + + //////////////////////////// + // DeBruijn method + //////////////////////////// + + //Taken from: + //http://stackoverflow.com/questions/11376288/fast-computing-of-log2-for-64-bit-integers + //Thanks to Desmond Hume + + inline std::size_t floor_log2 (std::size_t v, integer) + { + static const int MultiplyDeBruijnBitPosition[32] = + { + 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, + 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 + }; + + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + + return MultiplyDeBruijnBitPosition[(std::size_t)(v * 0x07C4ACDDU) >> 27]; + } + + inline std::size_t floor_log2 (std::size_t v, integer) + { + static const std::size_t MultiplyDeBruijnBitPosition[64] = { + 63, 0, 58, 1, 59, 47, 53, 2, + 60, 39, 48, 27, 54, 33, 42, 3, + 61, 51, 37, 40, 49, 18, 28, 20, + 55, 30, 34, 11, 43, 14, 22, 4, + 62, 57, 46, 52, 38, 26, 32, 41, + 50, 36, 17, 19, 29, 10, 13, 21, + 56, 45, 25, 31, 35, 16, 9, 12, + 44, 24, 15, 8, 23, 7, 6, 5}; + + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v |= v >> 32; + return MultiplyDeBruijnBitPosition[((std::size_t)((v - (v >> 1))*0x07EDD5E59A4E28C2ULL)) >> 58]; + } + + + inline std::size_t floor_log2 (std::size_t x) + { + const std::size_t Bits = sizeof(std::size_t)*CHAR_BIT; + return floor_log2(x, integer()); + } + +#endif + +//Thanks to Laurent de Soras in +//http://www.flipcode.com/archives/Fast_log_Function.shtml +inline float fast_log2 (float val) +{ + union caster_t + { + unsigned x; + float val; + } caster; + + caster.val = val; + unsigned x = caster.x; + const int log_2 = int((x >> 23) & 255) - 128; + x &= ~(unsigned(255u) << 23u); + x += unsigned(127) << 23u; + caster.x = x; + val = caster.val; + //1+log2(m), m ranging from 1 to 2 + //3rd degree polynomial keeping first derivate continuity. + //For less precision the line can be commented out + val = ((-1.f/3.f) * val + 2.f) * val - (2.f/3.f); + return val + static_cast(log_2); +} + +inline std::size_t ceil_log2 (std::size_t x) +{ + return static_cast((x & (x-1)) != 0) + floor_log2(x); +} + +template +struct numbits_eq +{ + static const bool value = sizeof(SizeType)*CHAR_BIT == N; +}; + +template +struct sqrt2_pow_max; + +template +struct sqrt2_pow_max >::type> +{ + static const SizeType value = 0xb504f334; + static const std::size_t pow = 31; +}; + +#ifndef AUTOBOOST_NO_INT64_T + +template +struct sqrt2_pow_max >::type> +{ + static const SizeType value = 0xb504f333f9de6484ull; + static const std::size_t pow = 63; +}; + +#endif //AUTOBOOST_NO_INT64_T + +// Returns floor(pow(sqrt(2), x * 2 + 1)). +// Defined for X from 0 up to the number of bits in size_t minus 1. +inline std::size_t sqrt2_pow_2xplus1 (std::size_t x) +{ + const std::size_t value = (std::size_t)sqrt2_pow_max::value; + const std::size_t pow = (std::size_t)sqrt2_pow_max::pow; + return (value >> (pow - x)) + 1; +} + +} //namespace detail +} //namespace intrusive +} //namespace autoboost + +#endif //AUTOBOOST_INTRUSIVE_DETAIL_MATH_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/memory_util.hpp b/contrib/autoboost/autoboost/intrusive/detail/memory_util.hpp new file mode 100644 index 000000000..cb89d2d9e --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/memory_util.hpp @@ -0,0 +1,92 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Pablo Halpern 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) +// +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2011-2014. 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/libs/intrusive for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_ALLOCATOR_MEMORY_UTIL_HPP +#define AUTOBOOST_INTRUSIVE_ALLOCATOR_MEMORY_UTIL_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { +namespace detail { + +template +inline T* addressof(T& obj) +{ + return static_cast + (static_cast + (const_cast + (&reinterpret_cast(obj)) + ) + ); +} + +template +struct LowPriorityConversion +{ + // Convertible from T with user-defined-conversion rank. + LowPriorityConversion(const T&) { } +}; + +}}} //namespace autoboost::intrusive::detail + +#include + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME pointer_to +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace intrusive { namespace detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (1, 1, )) +#include AUTOBOOST_PP_ITERATE() + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME static_cast_from +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace intrusive { namespace detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (1, 1, )) +#include AUTOBOOST_PP_ITERATE() + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME const_cast_from +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace intrusive { namespace detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (1, 1, )) +#include AUTOBOOST_PP_ITERATE() + +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME dynamic_cast_from +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace autoboost { namespace intrusive { namespace detail { +#define AUTOBOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}} +#define AUTOBOOST_PP_ITERATION_PARAMS_1 (3, (1, 1, )) +#include AUTOBOOST_PP_ITERATE() + +namespace autoboost { +namespace intrusive { +namespace detail { + +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(element_type) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(difference_type) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(reference) +AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(value_traits_ptr) + +} //namespace detail { +} //namespace intrusive { +} //namespace autoboost { + +#endif // ! defined(AUTOBOOST_INTRUSIVE_ALLOCATOR_MEMORY_UTIL_HPP) diff --git a/contrib/autoboost/autoboost/intrusive/detail/mpl.hpp b/contrib/autoboost/autoboost/intrusive/detail/mpl.hpp new file mode 100644 index 000000000..73caf0f92 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/mpl.hpp @@ -0,0 +1,376 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2006-2014 +// (C) Copyright Microsoft Corporation 2014 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_MPL_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_MPL_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +namespace autoboost { +namespace intrusive { +namespace detail { + +template +struct is_same +{ + static const bool value = false; +}; + +template +struct is_same +{ + static const bool value = true; +}; + +template +struct add_const +{ typedef const T type; }; + +template +struct remove_const +{ typedef T type; }; + +template +struct remove_const +{ typedef T type; }; + +template +struct remove_cv +{ typedef T type; }; + +template +struct remove_cv +{ typedef T type; }; + +template +struct remove_cv +{ typedef T type; }; + +template +struct remove_cv +{ typedef T type; }; + +template +struct remove_reference +{ + typedef T type; +}; + +template +struct remove_reference +{ + typedef T type; +}; + +template +struct remove_pointer +{ + typedef T type; +}; + +template +struct remove_pointer +{ + typedef T type; +}; + +template +struct add_pointer +{ + typedef T *type; +}; + +typedef char one; +struct two {one _[2];}; + +template< bool C_ > +struct bool_ +{ + static const bool value = C_; +}; + +template< class Integer, Integer Value > +struct integer +{ + static const Integer value = Value; +}; + +typedef bool_ true_; +typedef bool_ false_; + +typedef true_ true_type; +typedef false_ false_type; + +typedef char yes_type; +struct no_type +{ + char padding[8]; +}; + +template +struct enable_if_c { + typedef T type; +}; + +template +struct enable_if_c {}; + +template +struct enable_if : public enable_if_c{}; + +template +struct apply +{ + typedef typename F::template apply::type type; +}; + +#if defined(_MSC_VER) && (_MSC_VER >= 1400) + +template +struct is_convertible +{ + static const bool value = __is_convertible_to(T, U); +}; + +#else + +template +class is_convertible +{ + typedef char true_t; + class false_t { char dummy[2]; }; + //use any_conversion as first parameter since in MSVC + //overaligned types can't go through ellipsis + static false_t dispatch(...); + static true_t dispatch(U); + static typename remove_reference::type &trigger(); + public: + static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t); +}; + +#endif + +template< + bool C + , typename T1 + , typename T2 + > +struct if_c +{ + typedef T1 type; +}; + +template< + typename T1 + , typename T2 + > +struct if_c +{ + typedef T2 type; +}; + +template< + typename C + , typename T1 + , typename T2 + > +struct if_ +{ + typedef typename if_c<0 != C::value, T1, T2>::type type; +}; + +template< + bool C + , typename F1 + , typename F2 + > +struct eval_if_c + : if_c::type +{}; + +template< + typename C + , typename T1 + , typename T2 + > +struct eval_if + : if_::type +{}; + +// identity is an extension: it is not part of the standard. +template +struct identity +{ + typedef T type; +}; + +template +struct add_const_if_c +{ + typedef typename if_c + < Add + , typename add_const::type + , T + >::type type; +}; + + +//autoboost::alignment_of yields to 10K lines of preprocessed code, so we +//need an alternative +template struct alignment_of; + +template +struct alignment_of_hack +{ + char c; + T t; + alignment_of_hack(); +}; + +template +struct alignment_logic +{ + static const std::size_t value = A < S ? A : S; +}; + +template< typename T > +struct alignment_of +{ + static const std::size_t value = alignment_logic + < sizeof(alignment_of_hack) - sizeof(T) + , sizeof(T) + >::value; +}; + +template +class is_empty_class +{ + template + struct empty_helper_t1 : public T + { + empty_helper_t1(); + int i[256]; + }; + + struct empty_helper_t2 + { int i[256]; }; + + public: + static const bool value = sizeof(empty_helper_t1) == sizeof(empty_helper_t2); +}; + +template +struct ls_zeros +{ + static const std::size_t value = (S & std::size_t(1)) ? 0 : (1 + ls_zeros<(S>>1u)>::value); +}; + +template<> +struct ls_zeros<0> +{ + static const std::size_t value = 0; +}; + +template<> +struct ls_zeros<1> +{ + static const std::size_t value = 0; +}; + +template struct unvoid_ref { typedef T &type; }; +template <> struct unvoid_ref { struct type_impl { }; typedef type_impl & type; }; +template <> struct unvoid_ref { struct type_impl { }; typedef type_impl & type; }; + +// Infrastructure for providing a default type for T::TNAME if absent. +#define AUTOBOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(TNAME) \ + template \ + struct boost_intrusive_default_type_ ## TNAME \ + { \ + template \ + static char test(int, typename X::TNAME*); \ + \ + template \ + static int test(...); \ + \ + struct DefaultWrap { typedef DefaultType TNAME; }; \ + \ + static const bool value = (1 == sizeof(test(0, 0))); \ + \ + typedef typename \ + ::autoboost::intrusive::detail::if_c \ + ::type::TNAME type; \ + }; \ + \ + template \ + struct boost_intrusive_eval_default_type_ ## TNAME \ + { \ + template \ + static char test(int, typename X::TNAME*); \ + \ + template \ + static int test(...); \ + \ + struct DefaultWrap \ + { typedef typename DefaultType::type TNAME; }; \ + \ + static const bool value = (1 == sizeof(test(0, 0))); \ + \ + typedef typename \ + ::autoboost::intrusive::detail::eval_if_c \ + < value \ + , ::autoboost::intrusive::detail::identity \ + , ::autoboost::intrusive::detail::identity \ + >::type::TNAME type; \ + }; \ +// + +#define AUTOBOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(INSTANTIATION_NS_PREFIX, T, TNAME, TIMPL) \ + typename INSTANTIATION_NS_PREFIX \ + boost_intrusive_default_type_ ## TNAME< T, TIMPL >::type \ +// + +#define AUTOBOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(INSTANTIATION_NS_PREFIX, T, TNAME, TIMPL) \ + typename INSTANTIATION_NS_PREFIX \ + boost_intrusive_eval_default_type_ ## TNAME< T, TIMPL >::type \ +// + +#define AUTOBOOST_INTRUSIVE_INTERNAL_STATIC_BOOL_IS_TRUE(TRAITS_PREFIX, TYPEDEF_TO_FIND) \ +template \ +struct TRAITS_PREFIX##_bool\ +{\ + template\ + struct two_or_three {one _[2 + Add];};\ + template static one test(...);\ + template static two_or_three test (int);\ + static const std::size_t value = sizeof(test(0));\ +};\ +\ +template \ +struct TRAITS_PREFIX##_bool_is_true\ +{\ + static const bool value = TRAITS_PREFIX##_bool::value > sizeof(one)*2;\ +};\ +// + +} //namespace detail +} //namespace intrusive +} //namespace autoboost + +#include + +#endif //AUTOBOOST_INTRUSIVE_DETAIL_MPL_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/node_cloner_disposer.hpp b/contrib/autoboost/autoboost/intrusive/detail/node_cloner_disposer.hpp new file mode 100644 index 000000000..12fc1b6eb --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/node_cloner_disposer.hpp @@ -0,0 +1,109 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2014-2014 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_NODE_CLONER_DISPOSER_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_NODE_CLONER_DISPOSER_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include +#include +#include + +namespace autoboost { +namespace intrusive { +namespace detail { + +template +struct node_cloner + : private ebo_functor_holder +{ + typedef ValueTraits value_traits; + typedef typename value_traits::node_traits node_traits; + typedef typename node_traits::node_ptr node_ptr; + typedef ebo_functor_holder base_t; + typedef typename get_algo< AlgoType + , node_traits>::type node_algorithms; + static const bool safemode_or_autounlink = + is_safe_autounlink::value; + typedef typename value_traits::value_type value_type; + typedef typename value_traits::pointer pointer; + typedef typename node_traits::node node; + typedef typename value_traits::const_node_ptr const_node_ptr; + typedef typename value_traits::reference reference; + typedef typename value_traits::const_reference const_reference; + + node_cloner(F f, const ValueTraits *traits) + : base_t(f), traits_(traits) + {} + + // tree-based containers use this method, which is proxy-reference friendly + node_ptr operator()(const node_ptr & p) + { + const_reference v = *traits_->to_value_ptr(p); + node_ptr n = traits_->to_node_ptr(*base_t::get()(v)); + //Cloned node must be in default mode if the linking mode requires it + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(n)); + return n; + } + + // hashtables use this method, which is proxy-reference unfriendly + node_ptr operator()(const node &to_clone) + { + const value_type &v = + *traits_->to_value_ptr + (pointer_traits::pointer_to(to_clone)); + node_ptr n = traits_->to_node_ptr(*base_t::get()(v)); + //Cloned node must be in default mode if the linking mode requires it + if(safemode_or_autounlink) + AUTOBOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(n)); + return n; + } + + const ValueTraits * const traits_; +}; + +template +struct node_disposer + : private ebo_functor_holder +{ + typedef ValueTraits value_traits; + typedef typename value_traits::node_traits node_traits; + typedef typename node_traits::node_ptr node_ptr; + typedef ebo_functor_holder base_t; + typedef typename get_algo< AlgoType + , node_traits>::type node_algorithms; + static const bool safemode_or_autounlink = + is_safe_autounlink::value; + + node_disposer(F f, const ValueTraits *cont) + : base_t(f), traits_(cont) + {} + + void operator()(const node_ptr & p) + { + if(safemode_or_autounlink) + node_algorithms::init(p); + base_t::get()(traits_->to_value_ptr(p)); + } + const ValueTraits * const traits_; +}; + +} //namespace detail{ +} //namespace intrusive{ +} //namespace autoboost{ + +#endif //AUTOBOOST_INTRUSIVE_DETAIL_NODE_CLONER_DISPOSER_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/node_holder.hpp b/contrib/autoboost/autoboost/intrusive/detail/node_holder.hpp similarity index 81% rename from contrib/autoboost/boost/intrusive/detail/node_holder.hpp rename to contrib/autoboost/autoboost/intrusive/detail/node_holder.hpp index 208cf1453..07a7410dc 100644 --- a/contrib/autoboost/boost/intrusive/detail/node_holder.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/node_holder.hpp @@ -10,8 +10,8 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_NODE_HOLDER_HPP -#define BOOST_INTRUSIVE_DETAIL_NODE_HOLDER_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_NODE_HOLDER_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_NODE_HOLDER_HPP #if defined(_MSC_VER) # pragma once @@ -28,4 +28,4 @@ struct node_holder } //namespace intrusive{ } //namespace autoboost{ -#endif //BOOST_INTRUSIVE_DETAIL_NODE_HOLDER_HPP +#endif //AUTOBOOST_INTRUSIVE_DETAIL_NODE_HOLDER_HPP diff --git a/contrib/autoboost/autoboost/intrusive/detail/parent_from_member.hpp b/contrib/autoboost/autoboost/intrusive/detail/parent_from_member.hpp new file mode 100644 index 000000000..45308daf2 --- /dev/null +++ b/contrib/autoboost/autoboost/intrusive/detail/parent_from_member.hpp @@ -0,0 +1,120 @@ +///////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2007-2013 +// +// 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/libs/intrusive for documentation. +// +///////////////////////////////////////////////////////////////////////////// +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_PARENT_FROM_MEMBER_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_PARENT_FROM_MEMBER_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +#include +#include + +#if defined(AUTOBOOST_MSVC) || ((defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && defined(AUTOBOOST_INTEL)) + #define AUTOBOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER + #include +#endif + +namespace autoboost { +namespace intrusive { +namespace detail { + +template +inline std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_to_member) +{ + //The implementation of a pointer to member is compiler dependent. + #if defined(AUTOBOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER) + + //MSVC compliant compilers use their the first 32 bits as offset (even in 64 bit mode) + union caster_union + { + const Member Parent::* ptr_to_member; + int offset; + } caster; + + //MSVC ABI can use up to 3 int32 to represent pointer to member data + //with virtual base classes, in those cases there is no simple to + //obtain the address of the parent. So static assert to avoid runtime errors + AUTOBOOST_STATIC_ASSERT( sizeof(caster) == sizeof(int) ); + + caster.ptr_to_member = ptr_to_member; + return std::ptrdiff_t(caster.offset); + //Additional info on MSVC behaviour for the future. For 2/3 int ptr-to-member + //types dereference seems to be: + // + // vboffset = [compile_time_offset if 2-int ptr2memb] / + // [ptr2memb.i32[2] if 3-int ptr2memb]. + // vbtable = *(this + vboffset); + // adj = vbtable[ptr2memb.i32[1]]; + // var = adj + (this + vboffset) + ptr2memb.i32[0]; + // + //To reverse the operation we need to + // - obtain vboffset (in 2-int ptr2memb implementation only) + // - Go to Parent's vbtable and obtain adjustment at index ptr2memb.i32[1] + // - parent = member - adj - vboffset - ptr2memb.i32[0] + // + //Even accessing to RTTI we might not be able to obtain this information + //so anyone who thinks it's possible, please send a patch. + + //This works with gcc, msvc, ac++, ibmcpp + #elif defined(__GNUC__) || defined(__HP_aCC) || defined(AUTOBOOST_INTEL) || \ + defined(__IBMCPP__) || defined(__DECCXX) + const Parent * const parent = 0; + const char *const member = static_cast(static_cast(&(parent->*ptr_to_member))); + return std::ptrdiff_t(member - static_cast(static_cast(parent))); + #else + //This is the traditional C-front approach: __MWERKS__, __DMC__, __SUNPRO_CC + union caster_union + { + const Member Parent::* ptr_to_member; + std::ptrdiff_t offset; + } caster; + caster.ptr_to_member = ptr_to_member; + return caster.offset - 1; + #endif +} + +template +inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member) +{ + return static_cast + ( + static_cast + ( + static_cast(static_cast(member)) - offset_from_pointer_to_member(ptr_to_member) + ) + ); +} + +template +inline const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member) +{ + return static_cast + ( + static_cast + ( + static_cast(static_cast(member)) - offset_from_pointer_to_member(ptr_to_member) + ) + ); +} + +} //namespace detail { +} //namespace intrusive { +} //namespace autoboost { + +#ifdef AUTOBOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER +#undef AUTOBOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER +#endif + +#include + +#endif //#ifndef AUTOBOOST_INTRUSIVE_DETAIL_PARENT_FROM_MEMBER_HPP diff --git a/contrib/autoboost/boost/intrusive/detail/pointer_element.hpp b/contrib/autoboost/autoboost/intrusive/detail/pointer_element.hpp similarity index 93% rename from contrib/autoboost/boost/intrusive/detail/pointer_element.hpp rename to contrib/autoboost/autoboost/intrusive/detail/pointer_element.hpp index e4bd7dee1..346c4f92c 100644 --- a/contrib/autoboost/boost/intrusive/detail/pointer_element.hpp +++ b/contrib/autoboost/autoboost/intrusive/detail/pointer_element.hpp @@ -8,14 +8,14 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_POINTER_ELEMENT_HPP -#define BOOST_INTRUSIVE_DETAIL_POINTER_ELEMENT_HPP +#ifndef AUTOBOOST_INTRUSIVE_DETAIL_POINTER_ELEMENT_HPP +#define AUTOBOOST_INTRUSIVE_DETAIL_POINTER_ELEMENT_HPP #if defined(_MSC_VER) # pragma once #endif -#include +#include namespace autoboost { namespace intrusive { @@ -28,7 +28,7 @@ namespace detail{ template struct first_param { typedef void type; }; -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) +#if !defined(AUTOBOOST_NO_CXX11_VARIADIC_TEMPLATES) template