mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 10:38:13 +00:00
GUI2: removed unused cast helper
std::static_pointer_cast or styled_widget::cast_config_to can be used instead.
This commit is contained in:
parent
dfa09cd9d9
commit
33f70ea32c
@ -73,22 +73,6 @@ resolution_definition_ptr;
|
|||||||
typedef std::shared_ptr<const resolution_definition>
|
typedef std::shared_ptr<const resolution_definition>
|
||||||
resolution_definition_const_ptr;
|
resolution_definition_const_ptr;
|
||||||
|
|
||||||
/**
|
|
||||||
* Casts a resolution_definition_const_ptr to another type.
|
|
||||||
*
|
|
||||||
* @tparam T The type to cast to, the non const version.
|
|
||||||
*
|
|
||||||
* @param ptr The pointer to cast.
|
|
||||||
*
|
|
||||||
* @returns A reference to type casted to.
|
|
||||||
*/
|
|
||||||
template <class T>
|
|
||||||
const T& cast(resolution_definition_const_ptr ptr)
|
|
||||||
{
|
|
||||||
std::shared_ptr<const T> conf = std::make_shared<const T>(ptr);
|
|
||||||
assert(conf);
|
|
||||||
return *conf;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct styled_widget_definition
|
struct styled_widget_definition
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user