diff --git a/include/fc/exception/exception.hpp b/include/fc/exception/exception.hpp index 3d728ed..e5b54a4 100644 --- a/include/fc/exception/exception.hpp +++ b/include/fc/exception/exception.hpp @@ -5,7 +5,6 @@ */ #include #include -#include #include #include #include @@ -167,10 +166,10 @@ namespace fc { #if defined(_MSC_VER) && (_MSC_VER < 1700) return std::make_shared( log_message(), - std::copy_exception(fc::forward(e)) ); + std::copy_exception(std::forward(e)) ); #else return std::make_shared( log_message(), - std::make_exception_ptr(fc::forward(e)) ); + std::make_exception_ptr(std::forward(e)) ); #endif } diff --git a/include/fc/fwd_impl.hpp b/include/fc/fwd_impl.hpp index 53a4440..df2f0f8 100644 --- a/include/fc/fwd_impl.hpp +++ b/include/fc/fwd_impl.hpp @@ -1,7 +1,7 @@ #pragma once -#include #include +#include #include #include #include @@ -41,10 +41,10 @@ namespace fc { template - auto operator + ( const fwd& x, U&& u ) -> typename detail::add::type { return *x+fc::forward(u); } + auto operator + ( const fwd& x, U&& u ) -> typename detail::add::type { return *x+std::forward(u); } template - auto operator - ( const fwd& x, U&& u ) -> typename detail::sub::type { return *x-fc::forward(u); } + auto operator - ( const fwd& x, U&& u ) -> typename detail::sub::type { return *x-std::forward(u); } template auto operator << ( U& u, const fwd& f ) -> typename detail::insert_op::type { return u << *f; } @@ -63,20 +63,20 @@ namespace fc { template fwd::fwd( U&& u ) { check_size(); - new (this) T( fc::forward(u) ); + new (this) T( std::forward(u) ); } template template fwd::fwd( U&& u, V&& v ) { check_size(); - new (this) T( fc::forward(u), fc::forward(v) ); + new (this) T( std::forward(u), std::forward(v) ); } template template fwd::fwd( U&& u, V&& v, X&& x, Y&& y ) { check_size(); - new (this) T( fc::forward(u), fc::forward(v), fc::forward(x), fc::forward(y) ); + new (this) T( std::forward(u), std::forward(v), std::forward(x), std::forward(y) ); } @@ -121,7 +121,7 @@ namespace fc { template template T& fwd::operator = ( U&& u ) { - return **this = fc::forward(u); + return **this = std::forward(u); } template diff --git a/include/fc/optional.hpp b/include/fc/optional.hpp index ff6c789..04145b4 100644 --- a/include/fc/optional.hpp +++ b/include/fc/optional.hpp @@ -1,9 +1,7 @@ #pragma once -#include #include #include - namespace fc { #ifdef _MSC_VER # pragma warning(push) @@ -81,14 +79,14 @@ namespace fc { optional( U&& u ) :_valid(true) { - new ((char*)ptr()) T( fc::forward(u) ); + new ((char*)ptr()) T( std::forward(u) ); } template optional& operator=( U&& u ) { reset(); - new (ptr()) T( fc::forward(u) ); + new (ptr()) T( std::forward(u) ); _valid = true; return *this; } diff --git a/include/fc/thread/future.hpp b/include/fc/thread/future.hpp index 40dd62f..4e98c3d 100644 --- a/include/fc/thread/future.hpp +++ b/include/fc/thread/future.hpp @@ -146,7 +146,7 @@ namespace fc { template void on_complete( CompletionHandler&& c ) { - _on_complete( new detail::completion_handler_impl(fc::forward(c)) ); + _on_complete( new detail::completion_handler_impl(std::forward(c)) ); } protected: promise( const char* desc ):promise_base(desc){} @@ -184,7 +184,7 @@ namespace fc { template void on_complete( CompletionHandler&& c ) { - _on_complete( new detail::completion_handler_impl(fc::forward(c)) ); + _on_complete( new detail::completion_handler_impl(std::forward(c)) ); } protected: promise( const char* desc ):promise_base(desc){} @@ -273,7 +273,7 @@ namespace fc { */ template void on_complete( CompletionHandler&& c ) { - m_prom->on_complete( fc::forward(c) ); + m_prom->on_complete( std::forward(c) ); } private: friend class thread; @@ -334,7 +334,7 @@ namespace fc { template void on_complete( CompletionHandler&& c ) { - m_prom->on_complete( fc::forward(c) ); + m_prom->on_complete( std::forward(c) ); } private: diff --git a/include/fc/thread/parallel.hpp b/include/fc/thread/parallel.hpp index 433dfbf..a1eece5 100644 --- a/include/fc/thread/parallel.hpp +++ b/include/fc/thread/parallel.hpp @@ -98,7 +98,7 @@ namespace fc { typedef decltype(f()) Result; typedef typename fc::deduce::type FunctorType; typename task::ptr tsk = - task::create( fc::forward(f), desc ); + task::create( std::forward(f), desc ); tsk->retain(); // HERE BE DRAFONS fc::future r( std::dynamic_pointer_cast< promise >(tsk) ); detail::get_worker_pool().post( tsk.get() ); diff --git a/include/fc/thread/task.hpp b/include/fc/thread/task.hpp index e29cd14..db5bc66 100644 --- a/include/fc/thread/task.hpp +++ b/include/fc/thread/task.hpp @@ -129,7 +129,7 @@ namespace fc { task( Functor&& f, const char* desc ):promise_base(desc), task_base(&_functor), promise(desc) { typedef typename fc::deduce::type FunctorType; static_assert( sizeof(f) <= sizeof(_functor), "sizeof(Functor) is larger than FunctorSize" ); - new ((char*)&_functor) FunctorType( fc::forward(f) ); + new ((char*)&_functor) FunctorType( std::forward(f) ); _destroy_functor = &detail::functor_destructor::destroy; _promise_impl = static_cast*>(this); @@ -157,7 +157,7 @@ namespace fc { task( Functor&& f, const char* desc ):promise_base(desc), task_base(&_functor), promise(desc) { typedef typename fc::deduce::type FunctorType; static_assert( sizeof(f) <= sizeof(_functor), "sizeof(Functor) is larger than FunctorSize" ); - new ((char*)&_functor) FunctorType( fc::forward(f) ); + new ((char*)&_functor) FunctorType( std::forward(f) ); _destroy_functor = &detail::functor_destructor::destroy; _promise_impl = static_cast*>(this); diff --git a/include/fc/thread/thread.hpp b/include/fc/thread/thread.hpp index a01dc20..eb54959 100644 --- a/include/fc/thread/thread.hpp +++ b/include/fc/thread/thread.hpp @@ -88,7 +88,7 @@ namespace fc { typedef decltype(f()) Result; typedef typename fc::deduce::type FunctorType; typename task::ptr tsk = - task::create( fc::forward(f), desc ); + task::create( std::forward(f), desc ); tsk->retain(); // HERE BE DRAFONS fc::future r( std::dynamic_pointer_cast< promise >(tsk) ); async_task(tsk.get(),prio); @@ -111,7 +111,7 @@ namespace fc { const char* desc FC_TASK_NAME_DEFAULT_ARG, priority prio = priority()) -> fc::future { typedef decltype(f()) Result; typename task::ptr tsk = - task::create( fc::forward(f), desc ); + task::create( std::forward(f), desc ); tsk->retain(); // HERE BE DRAFONS fc::future r( std::dynamic_pointer_cast< promise >(tsk) ); async_task(tsk.get(),prio,when); @@ -225,11 +225,11 @@ namespace fc { template auto async( Functor&& f, const char* desc FC_TASK_NAME_DEFAULT_ARG, priority prio = priority()) -> fc::future { - return fc::thread::current().async( fc::forward(f), desc, prio ); + return fc::thread::current().async( std::forward(f), desc, prio ); } template auto schedule( Functor&& f, const fc::time_point& t, const char* desc FC_TASK_NAME_DEFAULT_ARG, priority prio = priority()) -> fc::future { - return fc::thread::current().schedule( fc::forward(f), t, desc, prio ); + return fc::thread::current().schedule( std::forward(f), t, desc, prio ); } /** diff --git a/include/fc/utility.hpp b/include/fc/utility.hpp index 0bc4d45..c08160c 100644 --- a/include/fc/utility.hpp +++ b/include/fc/utility.hpp @@ -25,9 +25,6 @@ namespace fc { template struct deduce { typedef T type; }; template struct deduce{ typedef T type; }; - template - inline T&& forward( U&& u ) { return static_cast(u); } - struct true_type { enum _value { value = 1 }; }; struct false_type { enum _value { value = 0 }; }; diff --git a/include/fc/variant.hpp b/include/fc/variant.hpp index 4da4f52..58e54ad 100644 --- a/include/fc/variant.hpp +++ b/include/fc/variant.hpp @@ -350,7 +350,7 @@ namespace fc template variant& operator=( T&& v ) { - return *this = variant( fc::forward(v) ); + return *this = variant( std::forward(v) ); } template diff --git a/include/fc/variant_object.hpp b/include/fc/variant_object.hpp index cebc31f..477c1c9 100644 --- a/include/fc/variant_object.hpp +++ b/include/fc/variant_object.hpp @@ -70,7 +70,7 @@ namespace fc variant_object( string key, T&& val ) :_key_value( std::make_shared >() ) { - *this = variant_object( std::move(key), variant(forward(val)) ); + *this = variant_object( std::move(key), variant(std::forward(val)) ); } variant_object( const variant_object& ); variant_object( variant_object&& ); @@ -173,7 +173,7 @@ namespace fc mutable_variant_object& operator()( string key, T&& var, uint32_t max_depth ) { _FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" ); - set( std::move(key), variant( fc::forward(var), max_depth - 1 ) ); + set( std::move(key), variant( std::forward(var), max_depth - 1 ) ); return *this; } /** @@ -191,7 +191,7 @@ namespace fc explicit mutable_variant_object( T&& v ) :_key_value( new std::vector() ) { - *this = variant(fc::forward(v)).get_object(); + *this = variant(std::forward(v)).get_object(); } mutable_variant_object(); @@ -202,7 +202,7 @@ namespace fc mutable_variant_object( string key, T&& val ) :_key_value( new std::vector() ) { - set( std::move(key), variant(forward(val)) ); + set( std::move(key), variant(std::forward(val)) ); } mutable_variant_object( mutable_variant_object&& ); @@ -232,7 +232,7 @@ namespace fc optional v; try { - v = variant( fc::forward(var), _max_depth ); + v = variant( std::forward(var), _max_depth ); } catch( ... ) {