3.0.0
Freundlich's C++ toolkit
Public Member Functions
fcppt::cast::bad_dynamic Class Reference

Detailed Description

May be thrown by fcppt::cast::dynamic if the cast fails.

This class provides more type information than std::bad_cast does. It stores an std::type_index for the source and the destination type.

See also
fcppt::cast::dynamic
Inheritance diagram for fcppt::cast::bad_dynamic:
fcppt::exception

Public Member Functions

FCPPT_DETAIL_SYMBOL bad_dynamic (std::type_index const &source, std::type_index const &dest)
 Constructs a bad_dynamic_cast exception. More...
 
FCPPT_DETAIL_SYMBOL bad_dynamic (bad_dynamic const &)
 
FCPPT_DETAIL_SYMBOL bad_dynamic (bad_dynamic &&)
 
FCPPT_DETAIL_SYMBOL bad_dynamicoperator= (bad_dynamic const &)
 
FCPPT_DETAIL_SYMBOL bad_dynamicoperator= (bad_dynamic &&)
 
FCPPT_DETAIL_SYMBOL ~bad_dynamic () noexcept override
 
FCPPT_DETAIL_SYMBOL std::type_index const & source () const
 Returns the source type information. More...
 
FCPPT_DETAIL_SYMBOL std::type_index const & destination () const
 Returns the destination type information. More...
 
- Public Member Functions inherited from fcppt::exception
FCPPT_DETAIL_SYMBOL exception (fcppt::string &&what)
 Constructs an exception from a string. More...
 
FCPPT_DETAIL_SYMBOL exception (exception const &)
 
FCPPT_DETAIL_SYMBOL exception (exception &&)
 
fcppt::string const & string () const
 Returns the error message. More...
 
FCPPT_DETAIL_SYMBOL char const * what () const noexcept override
 Returns a generic error. More...
 
FCPPT_DETAIL_SYMBOL ~exception () noexcept override
 

Additional Inherited Members

- Public Attributes inherited from fcppt::exception
FCPPT_DETAIL_SYMBOL exception operator
 

Constructor & Destructor Documentation

◆ bad_dynamic() [1/3]

FCPPT_DETAIL_SYMBOL fcppt::cast::bad_dynamic::bad_dynamic ( std::type_index const &  source,
std::type_index const &  dest 
)

Constructs a bad_dynamic_cast exception.

Parameters
sourceThe source type information
destThe destination type information

◆ bad_dynamic() [2/3]

FCPPT_DETAIL_SYMBOL fcppt::cast::bad_dynamic::bad_dynamic ( bad_dynamic const &  )

◆ bad_dynamic() [3/3]

FCPPT_DETAIL_SYMBOL fcppt::cast::bad_dynamic::bad_dynamic ( bad_dynamic &&  )

◆ ~bad_dynamic()

FCPPT_DETAIL_SYMBOL fcppt::cast::bad_dynamic::~bad_dynamic ( )
overridenoexcept

Member Function Documentation

◆ destination()

FCPPT_DETAIL_SYMBOL std::type_index const& fcppt::cast::bad_dynamic::destination ( ) const

Returns the destination type information.

◆ operator=() [1/2]

FCPPT_DETAIL_SYMBOL bad_dynamic& fcppt::cast::bad_dynamic::operator= ( bad_dynamic const &  )

◆ operator=() [2/2]

◆ source()

FCPPT_DETAIL_SYMBOL std::type_index const& fcppt::cast::bad_dynamic::source ( ) const

Returns the source type information.