This commit is contained in:
Antony Polukhin
2014-08-02 16:15:00 +04:00
parent 7b04caa160
commit 99f58714d1
8 changed files with 16 additions and 16 deletions

View File

@ -274,7 +274,7 @@ Issues with cross module type comparison on a bugged compilers are bypassed by d
[section Making a custom type_index]
Sometimes there may be a need to create your own type info system. This may be usefull if you wish to store some more info about types (PODness, size of a type, pointers to common functions...) or if you have an idea of a more compact types representations.
Sometimes there may be a need to create your own type info system. This may be useful if you wish to store some more info about types (PODness, size of a type, pointers to common functions...) or if you have an idea of a more compact types representations.
[import ../examples/user_defined_typeinfo.hpp]
[import ../examples/user_defined_typeinfo.cpp]
@ -378,7 +378,7 @@ function signature including template parameters.
If the output of `boost::typeindex::ctti_type_index::type_id<int>().name()`
* returns not just `int` but also a lot of text around the `int`
* or does not return type at all
then you are usng a compiler that was not tested with this library and you need to setup the
then you are using a compiler that was not tested with this library and you need to setup the
[macroref BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING] macro.
Here is a short instruction:
@ -394,7 +394,7 @@ Here is a short instruction:
* `skip_at_begin` is equal to `skip_at_begin` at step 2
* `skip_at_end` is equal to `skip_at_end` at step 2
* `"T = "` is equal to characters that are right before the `int` in output
# (optional, but highly recomended) [@http://www.boost.org/support/bugs.html create ticket] with
# (optional, but highly recommended) [@http://www.boost.org/support/bugs.html create ticket] with
feature request to add your compiler to supported compilers list. Include
parameters provided to `BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING` macro.
@ -415,7 +415,7 @@ Another example:
`boost::typeindex::ctti_type_index::type_id<int>().raw_name()` returns
"static const char *boost::detail::ctti<int>::n() [T = int]"". Then you shall set
`skip_at_begin` to `sizeof("static const char *boost::detail::ctti<") - 1`
and `skip_at_end` to `sizeof("]") - 1` and last parameter of macto to "T = ".
and `skip_at_end` to `sizeof("]") - 1` and last parameter of macro to "T = ".
``
#define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING (39, 1, true, "T = ")

View File

@ -50,7 +50,7 @@ int main() {
int i = 100;
// An attempt to convert stored function to a function accepting reference
func.call<int&>(i); // Will throw, because types `int&` and `int` missmatch
func.call<int&>(i); // Will throw, because types `int&` and `int` mismatch
assert(false);
} catch (const std::runtime_error& /*e*/) {}

View File

@ -78,10 +78,10 @@ int main() {
[[In ns3::{anonymous}::ns4 namespace][`N3ns312_GLOBAL__N_13ns412in_anon_typeE`] [`ns3::(anonymous namespace)::ns4::in_anon_type`] [`ns3::{anonymous}::ns4::in_anon_type]`] ]
[[Template class][`5templIsiE`] [`templ<short, int>`] [`templ<short int, int>]`] ]
[[Template class (full specialization)][`5templIiiE`] [`templ<int, int>`] [`templ<int, int>]`] ]
[[Template class with templae classes][`5templIS_IcaES_Ii17user_defined_typeEE`] [`templ<templ<char, signed char>, templ<int, user_defined_type> >`] [`templ<templ<char, signed char>, templ<int, user_defined_type> >]`] ]
[[Template class with template classes][`5templIS_IcaES_Ii17user_defined_typeEE`] [`templ<templ<char, signed char>, templ<int, user_defined_type> >`] [`templ<templ<char, signed char>, templ<int, user_defined_type> >]`] ]
]
We have not show the "noRTTI & pretty_name" column in the table becuse it is almost equal
We have not show the "noRTTI & pretty_name" column in the table because it is almost equal
to "noRTTI & raw_name" column.
[warning With RTTI off different classes with same names in anonymous namespace may collapse. See 'RTTI emulation limitations'. ]

View File

@ -35,10 +35,10 @@ namespace boost { namespace typeindex {
namespace detail {
// That's the most trickiest part of the TypeIndex library:
// 1) we do not whant to give user ability to manually construct and compare `struct-that-represents-type`
// 2) we need to distinguish beteween `struct-that-represents-type` and `const char*`
// 1) we do not want to give user ability to manually construct and compare `struct-that-represents-type`
// 2) we need to distinguish between `struct-that-represents-type` and `const char*`
// 3) we need a thread-safe way to have references to instances `struct-that-represents-type`
// 4) we need a compile-time control to make shure that user does not copy or
// 4) we need a compile-time control to make sure that user does not copy or
// default construct `struct-that-represents-type`
//
// Solution would be the following:
@ -72,7 +72,7 @@ private:
} // namespace detail
/// Helper method for getting detail::ctti_data of a tempalte patameter T.
/// Helper method for getting detail::ctti_data of a template parameter T.
template <class T>
inline const detail::ctti_data& ctti_construct() BOOST_NOEXCEPT {
// Standard C++11, 5.2.10 Reinterpret cast:

View File

@ -107,7 +107,7 @@ namespace boost { namespace detail {
/// Noncopyable type_info that does not require RTTI.
/// CTTI == Compile Time Type Info.
/// This name must be as short as posible, to avoid code bloat
/// This name must be as short as possible, to avoid code bloat
template <class T>
struct ctti {

View File

@ -228,7 +228,7 @@ inline stl_type_index stl_type_index::type_id() BOOST_NOEXCEPT {
|| (defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 744)
// Old EDG-based compilers seem to mistakenly distinguish 'integral' from 'signed integral'
// in typeid() expressions. Full temaplte specialization for 'integral' fixes that issue:
// in typeid() expressions. Full template specialization for 'integral' fixes that issue:
typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_<
boost::is_signed<no_cvr_prefinal_t>,
boost::make_signed<no_cvr_prefinal_t>,

View File

@ -70,13 +70,13 @@ public:
typedef TypeInfo type_info_t;
/// \b Override: This function \b may be redefined in Derived class. Overrides \b must not throw.
/// \return Name of a type. By default retuns Derived::raw_name().
/// \return Name of a type. By default returns Derived::raw_name().
inline const char* name() const BOOST_NOEXCEPT {
return derived().raw_name();
}
/// \b Override: This function \b may be redefined in Derived class. Overrides may throw.
/// \return Human redable type name. By default retuns Derived::name().
/// \return Human readable type name. By default returns Derived::name().
inline std::string pretty_name() const {
return derived().name();
}

View File

@ -117,7 +117,7 @@ static void test_with_modofiers() {
BOOST_CHECK(t1 < t2.type_info() || t2 < t1.type_info());
BOOST_CHECK(t1 > t2.type_info() || t2 > t1.type_info());
// Chaecking that comparisom operators overloads compile
// Chaecking that comparison operators overloads compile
BOOST_CHECK(t1 <= t2 || t2 <= t1);
BOOST_CHECK(t1 >= t2 || t2 >= t1);
BOOST_CHECK(t1.type_info() <= t2 || t2.type_info() <= t1);