Skip to content

Commit

Permalink
Apply naming recomendations from mailing list discussion: unsafe=>rel…
Browse files Browse the repository at this point in the history
…axed, safe=>strict
  • Loading branch information
apolukhin committed Dec 10, 2014
1 parent 46250fa commit cbf4bbf
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 112 deletions.
20 changes: 10 additions & 10 deletions doc/reference/get.xml
Expand Up @@ -26,7 +26,7 @@
</method>
</class>

<overloaded-function name="unsafe_get">
<overloaded-function name="relaxed_get">
<signature>
<template>
<template-type-parameter name="U"/>
Expand Down Expand Up @@ -94,7 +94,7 @@
<purpose>
<simpara>Retrieves a value of a specified type from a given
<code><classname>variant</classname></code>. </simpara>
<simpara>Unlike <functionname>safe_get</functionname> does not assert at compile time
<simpara>Unlike <functionname>strict_get</functionname> does not assert at compile time
that type <code>U</code> is one of the types that can be stored in variant.</simpara>
</purpose>

Expand All @@ -105,8 +105,8 @@
only if the content is of the specified type <code>U</code>, with
failure indicated as described below.</simpara>
<simpara><emphasis role="bold">Recomendation</emphasis>: Use
<functionname>get</functionname> or <functionname>safe_get</functionname> in new code.
<functionname>safe_get</functionname>
<functionname>get</functionname> or <functionname>strict_get</functionname> in new code.
<functionname>strict_get</functionname>
provides more compile time checks and it's behavior is closer to <code>std::get</code>
from C++ Standard Library.</simpara>
<simpara><emphasis role="bold">Warning</emphasis>: After either
Expand Down Expand Up @@ -155,7 +155,7 @@
</rationale>
</overloaded-function>

<overloaded-function name="safe_get">
<overloaded-function name="strict_get">
<signature>
<template>
<template-type-parameter name="U"/>
Expand Down Expand Up @@ -226,7 +226,7 @@
</purpose>

<description>
<simpara>Acts exactly like <functionname>unsafe_get</functionname> but does a compile time check
<simpara>Acts exactly like <functionname>relaxed_get</functionname> but does a compile time check
that type <code>U</code> is one of the types that can be stored in variant.</simpara>
</description>
</overloaded-function>
Expand Down Expand Up @@ -302,13 +302,13 @@
</purpose>

<description>
<simpara>Evaluates to <functionname>safe_get</functionname> if <code>BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT</code>
is not defined. If <code>BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT</code>
is defined then evaluates to <functionname>safe_get</functionname>. </simpara>
<simpara>Evaluates to <functionname>strict_get</functionname> if <code>BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT</code>
is not defined. If <code>BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT</code>
is defined then evaluates to <functionname>strict_get</functionname>. </simpara>

<simpara><emphasis role="bold">Recomendation</emphasis>: Use
<functionname>get</functionname> in new code without defining
<code>BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT</code>. In that way <functionname>get</functionname>
<code>BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT</code>. In that way <functionname>get</functionname>
provides more compile time checks and it's behavior is closer to <code>std::get</code>
from C++ Standard Library.</simpara>
</description>
Expand Down
22 changes: 11 additions & 11 deletions doc/reference/polymorphic_get.xml
Expand Up @@ -26,7 +26,7 @@
</method>
</class>

<overloaded-function name="polymorphic_unsafe_get">
<overloaded-function name="polymorphic_relaxed_get">
<signature>
<template>
<template-type-parameter name="U"/>
Expand Down Expand Up @@ -94,7 +94,7 @@
<purpose>
<simpara>Retrieves a value of a specified type from a given
<code><classname>variant</classname></code>.</simpara>
<simpara>Unlike <functionname>polymorphic_safe_get</functionname> does not assert at compile time
<simpara>Unlike <functionname>polymorphic_strict_get</functionname> does not assert at compile time
that type <code>U</code> is one of the types that can be stored in variant.</simpara>
</purpose>

Expand All @@ -106,9 +106,9 @@
derived from type <code>U</code>, with
failure indicated as described below.</simpara>
<simpara><emphasis role="bold">Recomendation</emphasis>: Use
<functionname>polymorphic_get</functionname> or <functionname>polymorphic_safe_get</functionname>
<functionname>polymorphic_get</functionname> or <functionname>polymorphic_strict_get</functionname>
in new code.
<functionname>polymorphic_safe_get</functionname>
<functionname>polymorphic_strict_get</functionname>
provides more compile time checks and it's behavior is closer to <code>std::get</code>
from C++ Standard Library.</simpara>
<simpara><emphasis role="bold">Warning</emphasis>: After either
Expand Down Expand Up @@ -162,7 +162,7 @@



<overloaded-function name="polymorphic_safe_get">
<overloaded-function name="polymorphic_strict_get">
<signature>
<template>
<template-type-parameter name="U"/>
Expand Down Expand Up @@ -233,7 +233,7 @@
</purpose>

<description>
<simpara>Acts exactly like <functionname>polymorphic_unsafe_get</functionname> but does a compile time check
<simpara>Acts exactly like <functionname>polymorphic_relaxed_get</functionname> but does a compile time check
that type <code>U</code> is one of the types that can be stored in variant.</simpara>
</description>
</overloaded-function>
Expand Down Expand Up @@ -309,14 +309,14 @@
</purpose>

<description>
<simpara>Evaluates to <functionname>polymorphic_safe_get</functionname>
if <code>BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT</code>
is not defined. If <code>BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT</code>
is defined then evaluates to <functionname>polymorphic_safe_get</functionname>. </simpara>
<simpara>Evaluates to <functionname>polymorphic_strict_get</functionname>
if <code>BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT</code>
is not defined. If <code>BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT</code>
is defined then evaluates to <functionname>polymorphic_strict_get</functionname>. </simpara>

<simpara><emphasis role="bold">Recomendation</emphasis>: Use
<functionname>polymorphic_get</functionname> in new code without defining
<code>BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT</code>. In that way
<code>BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT</code>. In that way
<functionname>polymorphic_get</functionname>
provides more compile time checks and it's behavior is closer to <code>std::get</code>
from C++ Standard Library.</simpara>
Expand Down
56 changes: 28 additions & 28 deletions include/boost/variant/get.hpp
Expand Up @@ -97,12 +97,12 @@ struct get_visitor
#endif

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// unsafe_get<U>(variant) methods
// relaxed_get<U>(variant) methods
//
template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
typename add_pointer<U>::type
unsafe_get(
relaxed_get(
boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
) BOOST_NOEXCEPT
Expand All @@ -117,7 +117,7 @@ unsafe_get(
template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
typename add_pointer<const U>::type
unsafe_get(
relaxed_get(
const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
) BOOST_NOEXCEPT
Expand All @@ -132,13 +132,13 @@ unsafe_get(
template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
typename add_reference<U>::type
unsafe_get(
relaxed_get(
boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& operand
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
)
{
typedef typename add_pointer<U>::type U_ptr;
U_ptr result = unsafe_get<U>(&operand);
U_ptr result = relaxed_get<U>(&operand);

if (!result)
boost::throw_exception(bad_get());
Expand All @@ -148,13 +148,13 @@ unsafe_get(
template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
typename add_reference<const U>::type
unsafe_get(
relaxed_get(
const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& operand
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
)
{
typedef typename add_pointer<const U>::type U_ptr;
U_ptr result = unsafe_get<const U>(&operand);
U_ptr result = relaxed_get<const U>(&operand);

if (!result)
boost::throw_exception(bad_get());
Expand All @@ -164,12 +164,12 @@ unsafe_get(


/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// safe_get<U>(variant) methods
// strict_get<U>(variant) methods
//
template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
typename add_pointer<U>::type
safe_get(
strict_get(
boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
) BOOST_NOEXCEPT
Expand All @@ -180,13 +180,13 @@ safe_get(
"call to boost::get<U>(boost::variant<T...>*) will always return NULL"
);

return unsafe_get<U>(operand);
return relaxed_get<U>(operand);
}

template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
typename add_pointer<const U>::type
safe_get(
strict_get(
const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
) BOOST_NOEXCEPT
Expand All @@ -197,13 +197,13 @@ safe_get(
"call to boost::get<U>(const boost::variant<T...>*) will always return NULL"
);

return unsafe_get<U>(operand);
return relaxed_get<U>(operand);
}

template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
typename add_reference<U>::type
safe_get(
strict_get(
boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& operand
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
)
Expand All @@ -214,13 +214,13 @@ safe_get(
"call to boost::get<U>(boost::variant<T...>&) will always throw boost::bad_get exception"
);

return unsafe_get<U>(operand);
return relaxed_get<U>(operand);
}

template <typename U, BOOST_VARIANT_ENUM_PARAMS(typename T) >
inline
typename add_reference<const U>::type
safe_get(
strict_get(
const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& operand
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
)
Expand All @@ -231,7 +231,7 @@ safe_get(
"call to boost::get<U>(const boost::variant<T...>&) will always throw boost::bad_get exception"
);

return unsafe_get<U>(operand);
return relaxed_get<U>(operand);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -246,10 +246,10 @@ get(
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
) BOOST_NOEXCEPT
{
#ifdef BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT
return unsafe_get<U>(operand);
#ifdef BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT
return relaxed_get<U>(operand);
#else
return safe_get<U>(operand);
return strict_get<U>(operand);
#endif

}
Expand All @@ -262,10 +262,10 @@ get(
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
) BOOST_NOEXCEPT
{
#ifdef BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT
return unsafe_get<U>(operand);
#ifdef BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT
return relaxed_get<U>(operand);
#else
return safe_get<U>(operand);
return strict_get<U>(operand);
#endif
}

Expand All @@ -277,10 +277,10 @@ get(
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
)
{
#ifdef BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT
return unsafe_get<U>(operand);
#ifdef BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT
return relaxed_get<U>(operand);
#else
return safe_get<U>(operand);
return strict_get<U>(operand);
#endif
}

Expand All @@ -292,10 +292,10 @@ get(
BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U)
)
{
#ifdef BOOST_VARIANT_USE_UNSAFE_GET_BY_DEFAULT
return unsafe_get<U>(operand);
#ifdef BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT
return relaxed_get<U>(operand);
#else
return safe_get<U>(operand);
return strict_get<U>(operand);
#endif
}

Expand Down

0 comments on commit cbf4bbf

Please sign in to comment.