Namespaces-related open questions

187 views
Skip to first unread message

morw...@gmail.com

unread,
Dec 14, 2013, 6:01:10 PM12/14/13
to std-pr...@isocpp.org
One common pratice in C++ is to use nested namespaces such as:

namespace foo
{
    namespace bar
    {
        struct A {};
    }
}

But it's often kind of a pain to have to open and close all the nested namespaces when we want to add more things into them.
Would making something like this be legal cause any problem?

namespace foo::bar
{
    struct A {};
}

One restriction would be to have the namespaces foo and bar clearly defined as such (as in the first example) before.
There could also be something to allow thins kind of things with namespace alias:

namespace foo { namespace bar { /* ... */ } }
namespace foobar = foo::bar;

namespace foobar
{
    struct A {};
}

However, I think allowing this for namespace alias would only encourage namespace pollution...

Billy O'Neal

unread,
Dec 14, 2013, 6:02:34 PM12/14/13
to std-proposals
Has been proposed. No idea what happened to it though -> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1524.htm

Billy O'Neal
Malware Response Instructor - BleepingComputer.com


--
 
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

morw...@gmail.com

unread,
Dec 14, 2013, 7:18:41 PM12/14/13
to std-pr...@isocpp.org
Well, I guessed so but was unable to find any paper related (2003 is quite old). Thanks for the link :)

Troy Heron

unread,
Dec 14, 2013, 8:04:53 PM12/14/13
to std-pr...@isocpp.org
Would be interested to know why this old proposal wasn't accepted.....

hun.nem...@gmail.com

unread,
Dec 15, 2013, 12:11:42 PM12/15/13
to std-pr...@isocpp.org
In http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2869.html

This proposal is categorized as "Not ready for C++0x, but open to resubmit in future"

Peter

Troy Heron

unread,
Dec 15, 2013, 2:03:18 PM12/15/13
to std-pr...@isocpp.org
So it has to be resubmitted in order to be considered again or this list of proposals will be considered again regardless in future standardization process?

It seems like such a simple and helpful proposal in comparison to a lot of others.

chret...@gmail.com

unread,
Aug 1, 2014, 11:36:04 AM8/1/14
to std-pr...@isocpp.org
Papers in this category have been reviewed in EWG but for various reasons they have not been accepted for C++0x. This may have been a lack of time to finalise the issues, a lack of motivation compared to competing papers, or simply the authors being pulled in different directions. This list is retained as a potential working list for EWG to pick up for the next standard revision.

Whatever the reasons for not accepting the 2003 proposal, this was apparently re-opened recently ---> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4026.html

chret...@gmail.com

unread,
Aug 1, 2014, 11:40:16 AM8/1/14
to std-pr...@isocpp.org
There is also a dedicated post on this forum: https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/BIL8OQyfEk0


On Sunday, December 15, 2013 12:01:10 AM UTC+1, morw...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages