>>105972869Here are a few I would have thought of:
1. Adding Java-style array declarations:
int[] a;
// instead of int a[]
// note that things like std::make_unique<int[]>(10) are already valid
2. Rust-style using statements:
using a::b; // equivalent to namespace b = a::b;
using std::*; // equivalent to using namespace std;
using std::a::{b::B, c::{C, D}, e::*, f::{self, F, G}}; // more complicated example
3. Java-style annotations syntax instead of the new upcoming reflection annotation syntax
using clap::{Help, Long, Short};
struct Args {
@Help("Name of the person to greet")
@Short
@Long
String name;
@Help("Number of times to greet")
@Short
@Long
int count = 1;
};
// original code:
struct Args {
[[=clap::Help("Name of the person to greet")]]
[[=clap::Short, =clap::Long]]
std::string name;
[[=clap::Help("Number of times to greet")]]
[[=clap::Short, =clap::Long]]
int count = 1;
};
4. Interfaces like C# and Java and an abstract keyword (because using pure virtual functions to declare abstract classes kind of sucks)
abstract class W { ... };
class X { ... };
class Y { ... };
interface IA { ... };
interface IB { ... };
class Z extends W, virtual X, virtual Y implements IA, IB { ... };
Anyway, nothing revolutionary, but still interesting to think about.