Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
3
Impact
~963 people reached

  • 0 posts edited
  • 0 helpful flags
  • 5 votes cast
Sep
24
awarded  Autobiographer
Aug
17
comment Using captured non-local variables in C++ closures
@Giorgio: In other languages like Python you don't get the chance to capture a "variable" by reference. They are always captured by value. The difference is that these variables just store adresses of heap-allocated objects and not the objects themselves. This would be somewhat equivalent to creating a non-local shared_ptr and capturing it by value. So, the difference really boils down to C++ not forcing an additional level of indirection onto you.
Aug
16
awarded  Teacher
Aug
16
comment Using captured non-local variables in C++ closures
@Giorgio: The code would invoke undefined behaviour. But how often is it that you don't know what the called function does with your passed functor?
Aug
16
answered Using captured non-local variables in C++ closures
Feb
10
comment Worst practices in C++, common mistakes
At least this is getting better with the new rather restrictive rules on implicit generation of copy/move operations in C++0x. In many of the rule-of-three violating cases the implicit generation of copy operations is going to be deprecated and should produce a warning.
Feb
10
awarded  Supporter