cnova/cppcast_quickfixes.cpp [4:34]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
enum class Num { ONE = 1, TWO, THREE };

struct Base {
    virtual ~Base() {}
};

struct Derived: Base {
    virtual void name() {}
};

int answer() { return 42; }

void static_cast_sample() {
    Num n = Num::TWO;
    int one = static_cast<int>(n);
}

void dynamic_cast_sample() {
    Base *b = new Base;
    if (Derived *d = dynamic_cast<Derived *>(b)) {
        d->name();
    }
}

void reinterpret_cast_sample() {
    void (*fun_pointer)() = reinterpret_cast<void (*)(void)>(answer);
}

void const_cast_sample() {
    const int j = 42;
    int* pj = const_cast<int *>(&j);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



cpp/cppcast_quickfixes.cpp [4:34]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
enum class Num { ONE = 1, TWO, THREE };

struct Base {
    virtual ~Base() {}
};

struct Derived: Base {
    virtual void name() {}
};

int answer() { return 42; }

void static_cast_sample() {
    Num n = Num::TWO;
    int one = static_cast<int>(n);
}

void dynamic_cast_sample() {
    Base *b = new Base;
    if (Derived *d = dynamic_cast<Derived *>(b)) {
        d->name();
    }
}

void reinterpret_cast_sample() {
    void (*fun_pointer)() = reinterpret_cast<void (*)(void)>(answer);
}

void const_cast_sample() {
    const int j = 42;
    int* pj = const_cast<int *>(&j);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



