fix bugs caught by clang++
This commit is contained in:
parent
2ba214819e
commit
4f146b93f1
5 changed files with 9 additions and 7 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
class abstract_thread;
|
class abstract_thread;
|
||||||
class void_t;
|
struct void_t;
|
||||||
class priority;
|
class priority;
|
||||||
class exception_ptr;
|
class exception_ptr;
|
||||||
class thread;
|
class thread;
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ namespace fc {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
value::value( T&& v ) {
|
value::value( T&& v ) {
|
||||||
new (holder) detail::value_holder();
|
new (holder) detail::value_holder();
|
||||||
fc::pack( *this, std::forward<T>(v) );
|
fc::pack( *this, fc::forward<T>(v) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@
|
||||||
#include <fc/tuple.hpp>
|
#include <fc/tuple.hpp>
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
|
template<typename T>
|
||||||
|
T value_cast( const value& v );
|
||||||
|
|
||||||
struct void_t{};
|
struct void_t{};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
@ -160,7 +163,7 @@ namespace fc {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static inline void unpack( const fc::value& jsv, T& v ) {
|
static inline void unpack( const fc::value& jsv, T& v ) {
|
||||||
if( strcmp( jsv.type(), "string" ) == 0 ) {
|
if( strcmp( jsv.type(), "string" ) == 0 ) {
|
||||||
v = fc::reflector<T>::from_string( value_cast<fc::string>(jsv).c_str() );
|
v = fc::reflector<T>::from_string( fc::value_cast<fc::string>(jsv).c_str() );
|
||||||
} else {
|
} else {
|
||||||
// throw if invalid int, by attempting to convert to string
|
// throw if invalid int, by attempting to convert to string
|
||||||
fc::reflector<T>::to_string( v = value_cast<int64_t>(jsv) );
|
fc::reflector<T>::to_string( v = value_cast<int64_t>(jsv) );
|
||||||
|
|
@ -269,7 +272,6 @@ namespace fc {
|
||||||
}
|
}
|
||||||
template<typename A, typename B, typename C, typename D>
|
template<typename A, typename B, typename C, typename D>
|
||||||
inline void unpack( const fc::value& val, tuple<A,B,C,D>& t ) {
|
inline void unpack( const fc::value& val, tuple<A,B,C,D>& t ) {
|
||||||
val = fc::value::array( tuple<A,B,C,D>::size );
|
|
||||||
t.visit( tuple_from_value_visitor(val) );
|
t.visit( tuple_from_value_visitor(val) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ namespace fc {
|
||||||
this->reserve( this->size()+1 );
|
this->reserve( this->size()+1 );
|
||||||
loc = this->begin() + pos;
|
loc = this->begin() + pos;
|
||||||
if( this->size() != 0 ) {
|
if( this->size() != 0 ) {
|
||||||
new (this->end()) T( fc::move(this->back()) );
|
new ((void*)this->end()) T( fc::move(this->back()) );
|
||||||
auto cur = this->back();
|
auto cur = this->back();
|
||||||
++this->_data->size;
|
++this->_data->size;
|
||||||
while( cur != loc ) {
|
while( cur != loc ) {
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
#else
|
#else
|
||||||
namespace fc {
|
namespace fc {
|
||||||
template<typename T> class vector;
|
template<typename T> class vector;
|
||||||
template<typename T> class reflector;
|
template<typename T> struct reflector;
|
||||||
template<typename T> class reflector< fc::vector<T> >;
|
template<typename T> struct reflector< fc::vector<T> >;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue