
20 Oct
2009
20 Oct
'09
11:04 p.m.
AMDG mobi phil wrote:
I forgot to put in my question that I am looking for a macro and not template if possible, and for a solution as elegant as BOOST_FOREACH, where you have to code as less as possible. It not (only :) ) that I am lazy to write, but I think the resulting code would be easier to read.
furthermore: 1. exception... throwing the exception removes the complexity of writing but introduces the complexity of exception (writing code + runtime).
2. pointer... use cases I would like to avoid pointers, as I have other constraints to work with const references.
Why? What's wrong with if(const data_type* data = get_value(map, key)) { processResult(*data); } In Christ, Steven Watanabe