Consider the following toy code:
#include <boost/hana/transform.hpp>
#include <range/v3/view/transform.hpp>
auto constexpr f = [](auto) {
using namespace ranges::views;
auto xxx = transform;
};
void caller() {
using boost::hana::transform;
f(1);
}
It compiles fine with GCC and MS' compiler, which means that using boost::hana::transform;
is not affecting the names available in f
's body, so it's unambiguous that xxx
is ranges::views::transform
.
On the other hand, if I change using boost::hana::transform;
to using namespace boost::hana;
, then Visual Studio claims that transform
in f
's body is an ambiguous name.
Is this a bug in GCC or Visual Studio? Is it a known bug? What is it due to?
Here's a small example (run it):
#include <boost/hana/transform.hpp>
#include <range/v3/view/transform.hpp>
auto constexpr f = [](auto) {
using namespace ranges::views;
auto xxx = transform;
};
void caller() {
#if 1
using namespace boost::hana;
#else
using boost::hana::transform;
#endif
f(1);
}