LINUX.ORG.RU

История изменений

Исправление next_time, (текущая версия) :

using xy_type = unsigned long long;
template <xy_type x>
struct fact {
  static constexpr xy_type y = x * fact<x-1>().y;
};

template <>
struct fact<0> {
  static constexpr xy_type y = 1;
};

template<int x>
class Boo
{
public:
    Boo() {}
    ~Boo(){}
    ~Boo(){}
};



template<>
class Boo<fact<9>::y>
{
public:
    Boo() {}
    static_assert(false, "This is the answer");
    ~Boo(){}
    ~Boo(){}
};

Выхлоп компилятора: ../AG/main.cpp:282:5: error: static assertion failed: This is the answer static_assert(false, «This is the answer»); ^ ../AG/main.cpp:284:5: error: ‘Boo<362880>::~Boo()’ cannot be overloaded

Исходная версия next_time, :

using xy_type = unsigned long long;
template <xy_type x>
struct fact {
  static constexpr xy_type y = x * fact<x-1>().y;
};

template <>
struct fact<0> {
  static constexpr xy_type y = 1;
};

template<int x>
class Boo
{
public:
    Boo() {}
    ~Boo(){}
    ~Boo(){}
};



template<>
class Boo<fact<9>::y>
{
public:
    Boo() {}
    static_assert(false, "This is the answer");
    ~Boo(){}
    ~Boo(){}
};

Выхлоп компилятора: ../AG/main.cpp:282:5: error: static assertion failed: This is the answer static_assert(false, «This is the answer»); ^ ../AG/main.cpp:284:5: error: ‘Boo<362880>::~Boo()’ cannot be overloaded