namespace

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

namespace

Boost - uBLAS mailing list
By the way, can I open a flame war on this list? :-D

What's about getting ublas out of the namespace numeric. The sub-namespace numeric has never been used as expected in the early days:
- in most of the code I saw so far, people are doing a using namespace boost::numeric.
- you can't seriously type boost::numeric::ublas::fct(x,y) like you type std::fct(x,y). I mean, std is 3 characters only.
- can we find a way to inject a new boost::ublas into boost::numeric to keep backward compatibility

As ublas is going through massive changes and improvements (thanks Cem, Stefan, Paul, Thomas, <put your name here>,...), it's about time to think about these little details too which would give ublas a new face and simplify users' life.

Cheers,
David

_______________________________________________
ublas mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: namespace

Boost - uBLAS mailing list


On 2019-05-30 8:07 p.m., David Bellot via ublas wrote:
By the way, can I open a flame war on this list? :-D

I doubt it. If you want a flame war, go to the boost list ! ;-)

What's about getting ublas out of the namespace numeric. The sub-namespace numeric has never been used as expected in the early days:
- in most of the code I saw so far, people are doing a using namespace boost::numeric.
- you can't seriously type boost::numeric::ublas::fct(x,y) like you type std::fct(x,y). I mean, std is 3 characters only.
- can we find a way to inject a new boost::ublas into boost::numeric to keep backward compatibility

As ublas is going through massive changes and improvements (thanks Cem, Stefan, Paul, Thomas, <put your name here>,...), it's about time to think about these little details too which would give ublas a new face and simplify users' life.

+1

Stefan
-- 

      ...ich hab' noch einen Koffer in Berlin...

_______________________________________________
ublas mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: namespace

Boost - uBLAS mailing list
I never tried with complicated structures, but as far as I know, we can simply do something like:

namespace boost::ublas
{
   bla bla bla...
}

namespace boost::numeric::ublas
{
     using namespace boost::ublas;
}

I just wonder why none of gcc and clang complain about that. I'm obviously missing something because the recursion should be infinite,shouldn't it? https://en.cppreference.com/w/cpp/language/namespace#Using-directives


On Fri, May 31, 2019 at 10:30 AM Stefan Seefeld via ublas <[hidden email]> wrote:


On 2019-05-30 8:07 p.m., David Bellot via ublas wrote:
By the way, can I open a flame war on this list? :-D

I doubt it. If you want a flame war, go to the boost list ! ;-)

What's about getting ublas out of the namespace numeric. The sub-namespace numeric has never been used as expected in the early days:
- in most of the code I saw so far, people are doing a using namespace boost::numeric.
- you can't seriously type boost::numeric::ublas::fct(x,y) like you type std::fct(x,y). I mean, std is 3 characters only.
- can we find a way to inject a new boost::ublas into boost::numeric to keep backward compatibility

As ublas is going through massive changes and improvements (thanks Cem, Stefan, Paul, Thomas, <put your name here>,...), it's about time to think about these little details too which would give ublas a new face and simplify users' life.

+1

Stefan
-- 

      ...ich hab' noch einen Koffer in Berlin...
_______________________________________________
ublas mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]

_______________________________________________
ublas mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: namespace

Boost - uBLAS mailing list


On 2019-05-31 12:35 a.m., David Bellot wrote:
I never tried with complicated structures, but as far as I know, we can simply do something like:

namespace boost::ublas
{
   bla bla bla...
}

namespace boost::numeric::ublas
{
     using namespace boost::ublas;
}

I just wonder why none of gcc and clang complain about that. I'm obviously missing something because the recursion should be infinite,shouldn't it? https://en.cppreference.com/w/cpp/language/namespace#Using-directives

There is no recursion, as far as I can see, just an alias.

But yes, something like that could work. In fact, I suppose we should start from the opposite end: introduce

namespace boost
{
namespace ublas = numeric::ublas;
}

so users can start using boost::ublas::...

Then we can incrementally substitute the original code to rid ourselves from boost::numeric.

Stefan
-- 

      ...ich hab' noch einen Koffer in Berlin...

_______________________________________________
ublas mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]