Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22458

`return_if(cond, val)` without resorting to macros

$
0
0

I'd like to create a return_if(cond, val) without resorting to macros, for using in non-static member functions. It should be equivalent to

{    //do some stuff on non-static data members here    if (cond) return val; //and don't return otherwise}

I don't mind using GCC extensions. It will appear frequently in the code, so I'd like a terse thing.


Viewing all articles
Browse latest Browse all 22458

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>