• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Error on overloading IOStream operators in C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error on overloading IOStream operators in C++


  • Subject: Re: Error on overloading IOStream operators in C++
  • From: John Daniel <email@hidden>
  • Date: Fri, 9 Feb 2007 09:01:07 -0600

I wouldn't either. Personally, I always use "std::" on all my standard objects. But I've never heard of anyone else who does that. They all just do a "using namespace std;" and I don't try to fight them. People very rarely use enough of the standard library to cause any problems by issuing a "using namespace std;".

However, if you are just defining function declarations using iostream types, you can sometimes get away with:

#include <iosfwd>

But once you start using them, you will almost always need the full #include <iostream>

John

On Feb 9, 2007, at 8:13 AM, Thomas Engelmeier wrote:

I wouldn't recommend that.
Additional iostream operators are potentially declared in an header file, and this will "poison" all files #including the header. If one really feels the urgent need to use a using directive,


using std::istream;
using std::ostream;
using std::iostream;
using std::endl;

is at least partially cleaner.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40etresoft.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Error on overloading IOStream operators in C++
      • From: Howard Hinnant <email@hidden>
References: 
 >Error on overloading IOStream operators in C++ (From: Adam Spooner <email@hidden>)
 >Re: Error on overloading IOStream operators in C++ (From: John Daniel <email@hidden>)
 >Re: Error on overloading IOStream operators in C++ (From: Thomas Engelmeier <email@hidden>)

  • Prev by Date: Re: Error on overloading IOStream operators in C++
  • Next by Date: Not Hitting Breakpoints in Reloaded Shared Library
  • Previous by thread: Re: Error on overloading IOStream operators in C++
  • Next by thread: Re: Error on overloading IOStream operators in C++
  • Index(es):
    • Date
    • Thread