История изменений
Исправление KennyMinigun, (текущая версия) :
Там походу -std=gnu++11 (кто-то -pedantic забыл):
void * $() { // declaration of function named $ returning void *
[&](...) { // lambda(1) catching all symbols by reference and taking any arguments
$: // label named $
[]() { // empty lambda(2) with empty catch list
({ // scope opens
$: ; // another label named $
_: // label named _
[]() {}, // empty lambda(3) followed by the comma operator
""[ // empty null-terminated string with the subscript operator
+ // unary plus operator -- noop
- // unary minus operator
(&&$ < &&_ ) // logical operation on labels addresses (GCC extension)
]; // end of the subscript operator
}); // scope closes
}(); // end of lambda(2) and an immediate call with no arguments
}( // end of lambda(1) and an immediate call with single argument
[=](){} // empty lambda(4) catching all symbols by value
); // end of lambda(1) call parentheses
} // end of function named $
Вот g++ истолоковал
$ g++ -Wall -Wextra -std=c++11 -pedantic -c it.cpp it.cpp: In lambda function: it.cpp:3:9: warning: label ‘$’ defined but not used [-Wunused-label] $: [](){ ^ it.cpp: In function ‘void* $()’: it.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ elvenfighter /tmp/code $ g++ -Wall -Wextra -std=c++11 -pedantic -c it.cpp it.cpp: In lambda function: it.cpp:4:13: warning: ISO C++ forbids braced-groups within expressions [-Wpedantic] ({ ^ it.cpp:9:30: warning: taking the address of a label is non-standard [-Wpedantic] +-(&&$ < &&_ ) ^ it.cpp:9:36: warning: taking the address of a label is non-standard [-Wpedantic] +-(&&$ < &&_ ) ^ it.cpp: In lambda function: it.cpp:3:9: warning: label ‘$’ defined but not used [-Wunused-label] $: [](){ ^ it.cpp: In function ‘void* $()’: it.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] }
Исправление KennyMinigun, :
Там походу --std=gnu++11 (кто-то -pedantic забыл):
void * $() { // declaration of function named $ returning void *
[&](...) { // lambda(1) catching all symbols by reference and taking any arguments
$: // label named $
[]() { // empty lambda(2) with empty catch list
({ // scope opens
$: ; // another label named $
_: // label named _
[]() {}, // empty lambda(3) followed by the comma operator
""[ // empty null-terminated string with the subscript operator
+ // unary plus operator -- noop
- // unary minus operator
(&&$ < &&_ ) // logical operation on labels addresses (GCC extension)
]; // end of the subscript operator
}); // scope closes
}(); // end of lambda(2) and an immediate call with no arguments
}( // end of lambda(1) and an immediate call with single argument
[=](){} // empty lambda(4) catching all symbols by value
); // end of lambda(1) call parentheses
} // end of function named $
Вот g++ истолоковал
$ g++ -Wall -Wextra -std=c++11 -pedantic -c it.cpp it.cpp: In lambda function: it.cpp:3:9: warning: label ‘$’ defined but not used [-Wunused-label] $: [](){ ^ it.cpp: In function ‘void* $()’: it.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ elvenfighter /tmp/code $ g++ -Wall -Wextra -std=c++11 -pedantic -c it.cpp it.cpp: In lambda function: it.cpp:4:13: warning: ISO C++ forbids braced-groups within expressions [-Wpedantic] ({ ^ it.cpp:9:30: warning: taking the address of a label is non-standard [-Wpedantic] +-(&&$ < &&_ ) ^ it.cpp:9:36: warning: taking the address of a label is non-standard [-Wpedantic] +-(&&$ < &&_ ) ^ it.cpp: In lambda function: it.cpp:3:9: warning: label ‘$’ defined but not used [-Wunused-label] $: [](){ ^ it.cpp: In function ‘void* $()’: it.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] }
Исправление KennyMinigun, :
Там походу --std=gnu++11 (кто-то -pedantic забыл):
void * $() { // declaration of function named $ returning void *
[&](...) { // lambda(1) catching all symbols by reference and taking any arguments
$: // label named $
[]() { // empty lambda(2) with empty catch list
({ // scope opens
$: ; // another label named $
_: // label named _
[]() {}, // empty lambda(3) followed by the comma operator
""[ // empty null-terminated string with the subscript operator
+ // unary plus operator -- noop
- // unary minus operator
(&&$ < &&_ ) // logical operation on labels addresses (GCC extension)
]; // end of the subscript operator
}); // scope closes
}(); // end of lambda(2) and an immediate call with no arguments
}( // end of lambda(1) and an immediate call with single argument
[=](){} // empty lambda(4) catching all symbols by value
); // end of lambda(1) call parentheses
} // end of function named $
Вот g++ истолоковал
$ g++ -Wall -Wextra -std=c++11 -c it.cpp it.cpp: In lambda function: it.cpp:3:9: warning: label ‘$’ defined but not used [-Wunused-label] $: [](){ ^ it.cpp: In function ‘void* $()’: it.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ elvenfighter /tmp/code $ g++ -Wall -Wextra -std=c++11 -pedantic -c it.cpp it.cpp: In lambda function: it.cpp:4:13: warning: ISO C++ forbids braced-groups within expressions [-Wpedantic] ({ ^ it.cpp:9:30: warning: taking the address of a label is non-standard [-Wpedantic] +-(&&$ < &&_ ) ^ it.cpp:9:36: warning: taking the address of a label is non-standard [-Wpedantic] +-(&&$ < &&_ ) ^ it.cpp: In lambda function: it.cpp:3:9: warning: label ‘$’ defined but not used [-Wunused-label] $: [](){ ^ it.cpp: In function ‘void* $()’: it.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] }
Исходная версия KennyMinigun, :
Там походу --std=gnu++11 (кто-то -pedantic забыл):
void * $() { // declaration of function named $ returning void *
[&](...) { // lambda(1) catching all symbols by reference and taking any arguments
$: // label named $
[]() { // empty lambda(2) with empty catch list
({ // scope opens
$: ; // another label named $
_: // label named _
[]() {}, // empty lambda(3) followed by the comma operator
""[ // empty null-terminated string with the subscript operator
+ // unary plus operator -- noop
- // unary minus operator
(&&$ < &&_ ) // logical operation on labels addresses (GCC extension)
]; // end of the subscript operator
}); // scope closes
}(); // end of lambda(2) and an immediate call with no arguments
}( // end of lambda(1) and an immediate call with single argument
[=](){} // empty lambda(4) catching all symbols by value
); // end of lambda(1) call parentheses
} // end of function named $
Вот g++ истолоковал
it.cpp: In lambda function: it.cpp:3:9: warning: label ‘$’ defined but not used [-Wunused-label] $: [](){ ^ it.cpp: In function ‘void* $()’: it.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ elvenfighter /tmp/code $ g++ -Wall -Wextra -std=c++11 -pedantic -c it.cpp it.cpp: In lambda function: it.cpp:4:13: warning: ISO C++ forbids braced-groups within expressions [-Wpedantic] ({ ^ it.cpp:9:30: warning: taking the address of a label is non-standard [-Wpedantic] +-(&&$ < &&_ ) ^ it.cpp:9:36: warning: taking the address of a label is non-standard [-Wpedantic] +-(&&$ < &&_ ) ^ it.cpp: In lambda function: it.cpp:3:9: warning: label ‘$’ defined but not used [-Wunused-label] $: [](){ ^ it.cpp: In function ‘void* $()’: it.cpp:14:1: warning: no return statement in function returning non-void [-Wreturn-type] }