Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: "ostream" is ambiguous

$
0
0
Such ambiguity is exactly the thing namespaces were created to solve, so if you "throw them away" with using statements you've exactly unsolved the problem. As stevetgates' reply suggests, a blanket using namespace std; is not a good idea for anything except trivial programs.

If constantly typing concurrency::streams::ostream is too much work, consider renaming the namespace, e.g., namespace crts = concurrency::streams; in files where you are using the concurrency::streams members. You can also write using statements in functions, such as
void use_members_of_long_namespace()
{
    using namespace concurrency::streams;  //<- only affects this function
    file_stream<uint8_t>::open_ostream(...).then(...);
    ...
}

Viewing all articles
Browse latest Browse all 4845

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>