Vector ambiguity

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

Vector ambiguity

Vincent K. Mu
Hi, all.
I was doing some tasks with Ublas library on Visual Studio and I found that when I wanted to define some vector, it has some ambiguity problem with STL vector and Ublas vector. I'm not sure what causes the problem since I only included Ublas vector.  Currently I'm aliasing an alternate namespace to  "boost::numeric::ublas" but I would like to know if there is any other solution to the above question.

Regards,
Kaide Mu

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

Re: Vector ambiguity

David Bellot
Hi,

yes it's a problem as both std::vector and ublas::vector have the same name. I recommend not including the full boost::numeric::ublas namespace. The STL vector is included boost/numeric/ublas/detail/vector_assign.hpp, which is itself included in vector.hpp
If you call it, let's say, ublas::vector with the right using directives, it should work.

Best,
David

On Thu, Mar 5, 2015 at 4:56 PM, Vincent K. Mu <[hidden email]> wrote:
Hi, all.
I was doing some tasks with Ublas library on Visual Studio and I found that when I wanted to define some vector, it has some ambiguity problem with STL vector and Ublas vector. I'm not sure what causes the problem since I only included Ublas vector.  Currently I'm aliasing an alternate namespace to  "boost::numeric::ublas" but I would like to know if there is any other solution to the above question.

Regards,
Kaide Mu

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


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