python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Definition of static data member without repeating its type
When I have a class with a static const or constexpr data member, defining that variable reqires me to repeat stuff:
/// my_class.hpp
class my_class { constexpr static int x = 1; };
/// my_class.cpp
...
Quirin F. Schroll
Votes: 0
Answers: 3
Is use in an unused default member initializer still an odr-use?
Is use in a default member initializer still an odr-use, even if the default member initializer is not used by any constructor?
For example, is this program ill-formed because g<A> is odr-used a...
user17732522
Votes: 0
Answers: 1
Enable warnings for one definition rule violations
There's a particular ODR violation that results from innocent enough code.
// TU1.cpp
struct Foo
{
int Bar() { return 1; }
};
// TU2.cpp
struct Foo
{
int Bar() { return 2; }
};
These two cla...
Adam
Votes: 0
Answers: 0
How to prevent ODR violations in this case?
disclaimer: this question is about prevention of unintended naming collisions, and make sure the following code fail to compile/link.
[edit] actually I'd be happy with something preventing this to com...
ThreeStarProgrammer57
Votes: 0
Answers: 1