fixed (everything is now back in place after #94)

This commit is contained in:
Michele Caini 2017-08-18 17:43:54 +02:00
parent 502870ed90
commit 97e0830794

View File

@ -17,6 +17,9 @@ namespace uvw {
*/
template<typename T, typename U>
class UnderlyingType {
template<typename, typename>
friend class UnderlyingType;
protected:
struct ConstructorAccess { explicit ConstructorAccess(int) {} };
@ -34,12 +37,22 @@ protected:
return reinterpret_cast<R *>(&resource);
}
template<typename R, typename... P>
auto get(UnderlyingType<P...> &other) noexcept {
return reinterpret_cast<R *>(&other.resource);
}
template<typename R>
auto get() const noexcept {
static_assert(not std::is_same<R, U>::value, "!");
return reinterpret_cast<const R *>(&resource);
}
template<typename R, typename... P>
auto get(const UnderlyingType<P...> &other) const noexcept {
return reinterpret_cast<const R *>(&other.resource);
}
public:
explicit UnderlyingType(ConstructorAccess, std::shared_ptr<Loop> ref) noexcept
: pLoop{std::move(ref)}, resource{}