You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For methods marked 'delete', we should probably assure these are not picked up by Inline::CPP. Those marked 'default' we should detect and pick up, and then let C++ do the right thing.
We must also make sure to not interfere with pure virtuals (Currently I think this works, so we should do no harm):
We should begin supporting:
struct SomeType {
SomeType() = default; //The default constructor is explicitly stated.
struct NonCopyable {
NonCopyable() = default;
NonCopyable(const NonCopyable&) = delete;
For methods marked 'delete', we should probably assure these are not picked up by Inline::CPP. Those marked 'default' we should detect and pick up, and then let C++ do the right thing.
We must also make sure to not interfere with pure virtuals (Currently I think this works, so we should do no harm):
struct Interface {
~Interface() = 0;
Uniform Type Initialization:
struct AltStruct {
AltStruct(int x, double y) : x_{x}, y_{y} {}
Alternative Function Syntax
template<class Lhs, class Rhs>
auto adding_func(const Lhs &lhs, const Rhs &rhs) -> decltype(lhs+rhs) {return lhs + rhs;}
....or nominally (without templates)....
auto add ( int a, int b ) -> decltype(a+b) { return a + b; }
Constant expressions:
constexpr int get_five() {return 5;}
constexpr double earth_gravitational_acceleration = 9.8;
Explicit keyword:
class SomeClass {
public:
SomeClass() {}
explicit SomeClass(int new_value) : value(new_value) {}
Override and Final:
struct Derived : Base {
virtual void some_func(int) override; // ill-formed - doesn't override a base class method
};
struct Base1 final { };
struct Derived1 : Base1 { }; // ill-formed because the class Base1 has been marked final
struct Base2 {
virtual void f() final;
};
Enum class:
enum class Enumeration {
Val1,
Val2,
Val3 = 100,
Val4 // = 101
};
'explicit' type modifier:
explicit SomeClass(int new_value) : value(new_value) {}
long long int
long long int a { 1000 };
long long int a;
long long int a = 100;
long long int a(100);
(Minimum width is 64b)
In many cases we simply need to allow for these constructs in the grammar, and then rely on C++ doing the right thing.
The text was updated successfully, but these errors were encountered: