fork download
#include <iostream>

template<typename To, typename From>
union Reinterpret_Cast
{
    Reinterpret_Cast(From f) : f(f)
    {
    }
    operator To()
    {
        return t;
    }
private:
    From f;
    To t;
};

int main()
{
    double d = 0.1;
    unsigned long long n = Reinterpret_Cast<unsigned long long, double>(d);
    std::cout << n << std::endl;
}
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
4591870180066957722