Suppose I have a non-auto concept and a template that generates classes that
satisfy the concept:
concept Mungible<typename T> {
void T::Mung();
}
template<typename T>
class Widget {
public:
void Mung();
};
Am I permitted to have a templatized concept map, like this?
template<typename T> // all Widget instantiations are
concept_map Mungible<Widget<T>> {} // Mungible
If not, how do I express that all Widget instantiations are a model of Mungible?
Suppose that not quite all of the classes generated by the template model the
concept. This specialization, for example, does not:
template<>
class Widget<void> {
void Smack();
};
Will this compile, or is it contrary to the concept map above?
If the above compiles, what about the following?
Widget<void> w; // compiles? We now have an instance of
// a class that doesn't satisfy Mungible
If that compiles, what about this, which invokes a template that requires the
concept:
template<Mungible T>
void f(T thingToMung);
f(w); // compiles? w isn't Mungible
Assuming that at least something above fails to compile, we can presumably fix
it via a suitable concept map:
concept_map Mungible<Widget<void>> {
void T::Mung() { T::Smack(); }
}
Where would this have to be defined? Presumably after the declaration of the
concept, but before or after the templatized concept map (or whatever mechanism
is used to assert that all instantiations of a template satisfy a concept)?
Thanks,
Scott
PS - My attempts to get conceptgcc up and running on my Windows XP machine have
failed, and the conceptgcc mailing list seem to be offline. If you have
experience getting conceptgcc to work under WinXP and would be interested in
helping me coax life out of mine, please send me mail off-group:
smey...@aristeia.com. Thanks.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]