Louis Dionne
unread,Jul 14, 2017, 4:28:19 PM7/14/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to refle...@isocpp.org, e...@lists.isocpp.org, David Vandevoorde, Peter Bindels
I think we already have a similar problem with the currently proposed
reflexpr (per P0194):
// a.h
using X = reflexpr(int);
void foo(X*);
// a.cc
#include "a.h"
void foo(X*) { }
// b.cc
#include "a.h"
int main() {
foo(nullptr); // does that link?
}
I think this can be clarified by making sure that a type resulting from
`reflexpr` can never appear in the signature of a function with external
linkage, etc.. I think this problem is similar to what we run into when
we try to make lambdas appear in an unevaluated context, and we could
probably apply a similar fix.
For our approach (and the problem you raised with it), we could probably
just mandate that one can't create a `std::meta::type` outside of a
constexpr context, and that a `std::meta::type` can't escape a constexpr
context. Peter’s solution may also work. In any case, I don’t think it’s
a deal breaker at this stage in the design (but we should certainly tackle
this when we get to wording).
Louis
Note: I’m confused why there’s both
refle...@isocpp.org and
e...@lists.isocpp.org
in the recipients of the original message. I’m replying to both, just in case.
> To unsubscribe from this group and stop receiving emails from it, send an email to
reflection+...@isocpp.org.