Boost logo

Boost :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2002-12-09 09:32:13


le Samedi 7 Décembre 2002 23:24, dave_at_[hidden] écrivit :
>> What about having
>>
>> BOOST_UNREACHABLE_RETURN(0)
>> or
>> BOOST_UNREACHABLE_RETURN("")
>
> I like it!
>
>> I think we need to "return" values for types other than int.
>
> Of course. My suggestion would have just been used thus:
>
> #ifdef BOOST_NO_NON_RETURN_PATH_COMPREHENSION
> return whatever;
> #endif
>
> But I like yours better.

the name is nicer, but the usage can be less self-documenting than the
ifdefed return.
for someone who doesn't know the macro, he cant be 100% sure what
preprocessing magic BOOST_UNREACHABLE_RETURN(0) will do, and so might need
to go find that macro's definition
(and when dozens of macro are designed and used like that, it gets painful
for a new user to read the code)

On the opposite hand, using the same kind of naming scheme,
#ifdef BOOST_NEED_UNREACHABLE_RETURN
     return whatever;
#endif

the purpose is 100% self-evident, and the random reader gets it instantly
(whatever the name of the macro)

it looks like the macro has now already been introduced, but I liked the
plain ifdefed return better..

Anyway, that's just my opinion on this rather esthetical matter, for what
it's worth.

my-0.02¤-ly y'rs,

-- 
Samuel

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk