B
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7b54f11d26d0d79603718cb78403996e
macro_rules! rand {
()=> { {
enum Foo { Bar() };
Foo::Bar as usize
}
};
}
fn main() {
println!("{} {}", rand!(), rand!())
}
Size: a a a
B
macro_rules! rand {
()=> { {
enum Foo { Bar() };
Foo::Bar as usize
}
};
}
fn main() {
println!("{} {}", rand!(), rand!())
}
B
ΑZ
macro_rules! rand {
()=> { {
enum Foo { Bar() };
Foo::Bar as usize
}
};
}
fn main() {
println!("{} {}", rand!(), rand!())
}
p
p
p
CD
KR
KR
KR
SP
С
ΑZ
p
ΑZ
B
B
CD
cpp_gcc
void f() {}
constexpr int g() {
return reinterpret_cast<long long>(&f);
}
int x[g()];
423316089/source.cpp:5:10: error: size of array ‘x’ is not an integral constant-expression
int x[g()];
^
CD
CD
cpp_gcc
void f() {}
template <decltype(&f) A> struct some{};
some<&f> x; //это другое
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status