#include <iostream>


#include <type_traits>


#define rigid                   constexpr


template< class T >

rigid   typename std::remove_reference< T >::type   dref( T && t )

{

    return  t;

}


#define is_rigid( c )           noexcept( dref( c ) )


using namespace std;


int main()

{

    int a = 0;

    const int b = 0;

    constexpr int c = 0;

    const int d = a;


    cout << boolalpha;


    cout << is_rigid( a ) << endl;

    cout << is_rigid( b ) << endl;

    cout << is_rigid( c ) << endl;

    cout << is_rigid( d ) << endl;

    

    return 0;

}


결과는

false

true

true

false


어제 쓴 리터럴 상수 이야기를 코드로 표현해봄.