[cfe-dev] Feature Idea: Error Message Replacing
Douglas Gregor
dgregor at apple.com
Wed Jun 10 14:28:06 PDT 2009
>> We could do the same kind of thing through an extension
>> to static_assert:
>>
>> template<typename T>
>> struct path_of {
>> static_assert(always_false<T>::value, "you need to specialize
>> 'boost::property_tree::path_of' for %0 in order to use it as a
>> property tree key", T);
>> };
>>
>> A couple years back, I prototyped something like this for GCC, using
>> some gross hacks in the G++ front end and a poor approximation of
>> static_assert. The results looked promising, because the custom
>> diagnostic can give much better information than the generic error
>> message, especially if it can refer to your own instantiation.
> This is awesome. We should totally forget about my proposal and
> implement this instead.
:)
- Doug
More information about the cfe-dev
mailing list