use a reinterpret_cast to return the correct type

This commit is contained in:
Konstantin Käfer
2015-02-12 13:03:40 -08:00
committed by Konstantin Käfer
parent d62bf415f0
commit 8408dc9e4d
2 changed files with 2 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ public:
template<typename T, typename ...Args>
static inline const T &Set(Args&& ...args) {
Backend = util::make_unique<T>(::std::forward<Args>(args)...);
return *dynamic_cast<T *>(Backend.get());
return *reinterpret_cast<T *>(Backend.get());
}
private: