Indiana Unversity logo[ConceptGCC]

ConceptGCC :

compilation problem

From: Mark Zweers (zweers.mark_at_[hidden])
Date: 2009-07-10 12:27:26


Hey all,

Curious to the usage of the concepts in C++, I've installed conceptGCC on my
machine. However, when I try to compile the examples given on the website,
it doesn't work :

file concepts.cpp :

*********

#include <concepts>

template<std::CopyConstructible T>
  requires Addable<T>
  T sum(T array[], int n)
  {
    T result = 0;
    for (int i = 0; i < n; ++i)
      result = result + array[i];
    return result;
  }

********

results in the following error messages :

m_at_z:~/progs/conceptCPP/tests$ conceptg++ concepts.cpp
concepts.cpp:4: error: expected template-name before ‘<’ token
concepts.cpp:4: error: expected unqualified-id before ‘<’ token

It apparently does find the correct inclusion "concepts" and it does
recognize "std::Addable" , but it fails on the keyword "reguires" .

Could anybody help me with this (I think) simple but annoying problem?

Thanks a lot!

Mark