1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
 
#include <cstdlib>
 
template <typename T>
class CriticalError {
private:
    virtual void showErrorReason() = 0;
 
public:
    T value;
 
    CriticalError(T err): value(err){}
    void showReasonAndQuit()
    {
        std::printf("\nCRITICAL ERROR! \n");
        showErrorReason();
        std::abort();
    }
};
cs

요렇게 하면 컴파일 에러를 뿜는데


Compiler Error C2930
 

'class' : type-class-id redefined as an enumerator of 'enum identifier'

You cannot use a generic or template class as a member of an enumeration.

This error can be caused if braces are improperly matched.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
 
#include <cstdlib>
 
template <typename T>
class ErrorCritical {
private:
    virtual void showErrorReason() = 0;
 
public:
    T value;
 
    ErrorCritical(T err): value(err){}
    void showReasonAndQuit()
    {
        std::printf("\nCRITICAL ERROR! \n");
        showErrorReason();
        std::abort();
    }
};
cs

이런 괴상한 이름으로 하면 안 뿜음

ㅡㅡ 

critical error가 졷간지 터지는데