Clang and concepts

I have been following the development of Clang for some time and I am very pleased to find that it is being used to implement concepts in C++.

I have now installed the modified version of Clang and run a few examples. I see that unlike conceptgcc, there is no need to use a header , it knows about them anyway.

Is there any defined constant in the modified Clang which I can use to detect a concepts enabled clang++ ? e.g. CLANG_CONCEPTS

I would like this to enable conditional compilation in my examples.

Thanks

John

Dr John P. Fletcher Tel: (44) 121 204 3389 (direct line), FAX: (44) 121 204 3678

Chemical Engineering and Applied Chemistry (CEAC),

Associate Dean - External Relations,

School of Engineering and Applied Science (EAS),

Aston University, Aston Triangle, BIRMINGHAM B4 7ET U.K.

Dear John –

It’s always nice to hear a few words of encouragement. :slight_smile:

As you may have noticed, ConceptClang is completely conceptualized for the moment.
The intention is to add a compiler flag at some point that allows one to move between conceptualized and non-conceptualized versions of clang. When this is done, certainly we could provide such a constant or related.

The only thing standing in the way at the moment is our focus on pushing out some most pressing features:
Associated types, concept based overloading, and concept map templates.

I think we got associated types this morning, so we’re moving onto concept-based overloading…

I hope this helps.

Best,
– Larisse.

By the way, the macro CLANG_CONCEPTS has been defined with the latest version, which also supports associated types:

http://zalewski.indefero.net/p/clang/downloads/11/

Thanks,

– Larisse.

By the way, the macro CLANG_CONCEPTS has been defined with the latest version, which also supports associated types:

http://zalewski.indefero.net/p/clang/downloads/11/

Please don’t define a special macro for concepts. The Clang way to detect features is by extending __has_feature, described here:

http://clang.llvm.org/docs/LanguageExtensions.html#feature_check

  • Doug

Oops. Sorry about that.
The corrected version has been uploaded:

http://zalewski.indefero.net/p/clang/downloads/12/

The feature “clang_concepts” has thus been defined.

Thanks,
– Larisse.