boostorg / proto

Boost.org proto module
http://boost.org/libs/proto
21 stars 38 forks source link

Feature request for better safety while storing the generator #11

Open apolukhin opened 5 years ago

apolukhin commented 5 years ago

This issue is related to the https://github.com/boostorg/spirit/issues/436

The problem is that it is very simple to misuse the Spirit (or Proto) by storing a result that holds references to temporaries. @Kojoley noted that there may be a way to static assert such cases or store the input by value if the value is an rvalue.

Test case and some discussion available at https://github.com/boostorg/spirit/issues/436