Skip to content

Commit 320c40d

Browse files
committed
extract->as when returning the user class
1 parent abe5c8f commit 320c40d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include/tao/json/value.hh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ namespace tao
3030
{
3131
namespace internal
3232
{
33-
template< typename, typename, typename = void > struct has_extract : std::false_type {};
34-
template< typename T, typename V > struct has_extract< T, V, decltype( T::extract( std::declval< const V & >() ), void() ) > : std::true_type {};
33+
template< typename, typename, typename = void > struct has_as : std::false_type {};
34+
template< typename T, typename V > struct has_as< T, V, decltype( T::as( std::declval< const V & >() ), void() ) > : std::true_type {};
3535

3636
// required work-around for GCC 6
3737
inline void rethrow()
@@ -319,22 +319,22 @@ namespace tao
319319
}
320320

321321
template< typename T >
322-
void as( T& v ) const
322+
void extract( T& v ) const
323323
{
324324
Traits< typename std::decay< T >::type >::extract( * this, v );
325325
}
326326

327327
template< typename T >
328-
typename std::enable_if< internal::has_extract< Traits< T >, basic_value >::value, T >::type as() const
328+
typename std::enable_if< internal::has_as< Traits< T >, basic_value >::value, T >::type as() const
329329
{
330-
return Traits< T >::extract( * this );
330+
return Traits< T >::as( * this );
331331
}
332332

333333
template< typename T >
334-
typename std::enable_if< ! internal::has_extract< Traits< T >, basic_value >::value, T >::type as() const
334+
typename std::enable_if< ! internal::has_as< Traits< T >, basic_value >::value, T >::type as() const
335335
{
336336
T nrv;
337-
as( nrv );
337+
extract( nrv );
338338
return nrv;
339339
}
340340

0 commit comments

Comments
 (0)