Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-09-28 12:13:32

"Doug Gregor" <dgregor_at_[hidden]> wrote in message
> On Sep 28, 2006, at 3:20 AM, Andy Little wrote:
>> And a Question to Doug Gregor Does ConceptGCC support decltype and
>> auto? Please
>> note: this is Not a feature request, just a simple question! :-)
> No, we don't have support for decltype or auto in ConceptGCC.
> Of course, you can fake decltype with concepts, if you want:
> auto concept Callable2<typename F, typename T1, typename T2> {
> typename result_type;
> result_type operator()(F, T1, T2);
> }
> Callable2<F, T1, T2>::result_type tells you the type returned by
> calling an object of type F with arguments of types T1 and T2.

I was just looking at the tutorial, wondering about whether I could do that...

...And if I couldnt, I was going to suggest that I should be able to. :-)

>> Of course if I really want it, then I guess I ought to try sorting
>> it out myself
>> though shouldnt I? :-)
> If be "sorting it out myself" you mean implementing decltype and auto
> in GCC, then "yes"! :)

hmm... (actually that Was a feature request... ;-) ) *Interesting* idea though,
trying to hack Gcc.... very foolhardy IMO, unwise, very unwise...


Am I right that I can add conditional Concept support to headers by :

 # ifdef __GXX_CONCEPTS__

... concept stuff


And what happens if I have for example a Numeric concept (float, int,
boost::numeric::interval) and I want to make Integer a 'member'( model?). How
would that work? And integer is also a fundamental type of course

Would I be able somehow to express that I don't want potentially 'lossy'
division. e.g int / int ?

Anyway I will have to see how well it works in my physical quantities library.
I'm glad I finally got round to trying it out :-)

Andy Little

Boost list run by bdawes at, gregod at, cpdaniel at, john at