S
Saeed Amrollahi
Dear All
Hi
AFAIK, A constexpr constructor is a simple constructor that it must
initialize the data members in the
member-initializer part and those initializations must involve only
potential constant expressions, and its body is empty.
The following class is compiled without error under g++ 4.5.0
// point.c++
struct Point {
int x, y;
constexpr point(int xx, int yy) : x(xx), y(yy) {}
constexpr point() { x = y = 0; } // constexpr constructor with non-
empty body
};
I used the following command for compilation:
g++ -c -std=c++0x point.c++ -o point
Is it a bug in g++?
-- Saeed Amrollahi
Hi
AFAIK, A constexpr constructor is a simple constructor that it must
initialize the data members in the
member-initializer part and those initializations must involve only
potential constant expressions, and its body is empty.
The following class is compiled without error under g++ 4.5.0
// point.c++
struct Point {
int x, y;
constexpr point(int xx, int yy) : x(xx), y(yy) {}
constexpr point() { x = y = 0; } // constexpr constructor with non-
empty body
};
I used the following command for compilation:
g++ -c -std=c++0x point.c++ -o point
Is it a bug in g++?
-- Saeed Amrollahi