C++2011: inline namespaces

Milian Wolff mail at milianw.de
Tue Jul 5 19:19:37 UTC 2011


Hey there!

I would like to get some help on implementing inline namespaces in the 
KDevelop Cpp plugin. The parser handles them now properly (c++0x branch of 
kdevelop) but I am lost when it comes to implementing the lookup changes.

See also: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm

Foremost it would help me if we could come up with a list of examples I can 
use for writing unit tests. A simple one is probably:

inline namespace A { int i = 1; }
int b = i + 2;

according to the new spec this works due to the implicit using declaration of 
namespace A in the global namespace.

Then regarding explicit instantiation (see 14.7.2/6):

inline namespace N {
template<class T> class > { void mf() {} };
}
template class Y<int>;

this should now work contrary to a not-inlined namespace if I'm not 
mistaken...

Same for explicit specialization (compare to 14.7.3/8):

inline namespace N {
  template<class T> class Y {};
}

template<> class Y<double> {};

So far so good. But I'm not so sure about the implications - and where to 
change what code. Furthermore the point about explicit qualification is unclear 
to me.

Hence, please help me and give me a hand in getting this done.

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110705/40c20718/attachment.sig>


More information about the KDevelop-devel mailing list