Closed mpadge closed 5 years ago
Hi Mark,
Thanks for reporting this. The point is make_unique() was not standard in C++11 and that's the version this code is aiming at. My own implementation is not in std:: namespace so I am a bit confused as to why it would be ambiguous. Could it be that one of the headers or compile units has "using namespace std;" in it? Wouldn't this make std::make_unique() the preferred version though... Or could it be that your unique_ptr defines make_unique() in global namespace? I am a bit confused here. Anyhow, the easiest solution is to remove my definition of make_unique altogether if you are aiming for C++14 and above. Alternatively you could put it inside some sort of #ifdef. I am open to suggestions/patches/pull requests, etc.
Cheers,
-- Stanislaw
Thanks for the quick response, and yes, it seems that you're right. There is no "using namespace std", but what you say otherwise makes sense. I'll have a play and hope to close myself asap. Cheers!
Thanks @sadaszewski, simply enforcing -std=c++11
does the trick. It would likely be helpful for others is you make this need clear on your README.
the best way is putting your make_unique into a namespace , like not_std,
Great work translating this to C++ - thanks! It'd be even better if you could fix this:
produces the following:
That should be entirely reproducible. Thanks!