4 Replies - 8411 Views - Last Post: 07 July 2002 - 08:01 PM Rate Topic: -----

Poll: Opinion: Using Namespace Std (12 member(s) have cast votes)

Opinion: Using Namespace Std

  1. i always use it it makes it easier (3 votes [27.27%])

    Percentage of vote: 27.27%

  2. i sometimes use it when im lazy (1 votes [9.09%])

    Percentage of vote: 9.09%

  3. i only use it when it is necessary (1 votes [9.09%])

    Percentage of vote: 9.09%

  4. i never use it (4 votes [36.36%])

    Percentage of vote: 36.36%

  5. using namespace std;? whats that? (2 votes [18.18%])

    Percentage of vote: 18.18%

Vote Guests cannot vote

#1 runtime error  Icon User is offline

  • Lucky.Code
  • member icon

Reputation: 3
  • View blog
  • Posts: 629
  • Joined: 19-March 01

Opinion: Using Namespace Std

Posted 29 June 2002 - 11:26 PM

Ok i have heard mixed comments about this. in books and my teacher say use it but i have heard a couple of people on boards that say don't use it. or the just use using std::whatever? so whats your opinion?
Is This A Good Question/Topic? 0
  • +

Replies To: Opinion: Using Namespace Std

#2 Null and Void  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 204
  • Joined: 29-April 01

Re: Opinion: Using Namespace Std

Posted 30 June 2002 - 01:34 PM

It doesn't really matter what type of using directives you use, as long as they're not in headers. If you create a library and distribute it to other people, and in one of your headers you write 'using namespace std;', then the entire std namespace is at global scope for anyone who includes that header. If someone uses your library and they have a class called 'list' (there's also a 'list' class in the std namespace, for those that don't know), there will be a name collision because of that using directive. Personally, I never use 'using' except at a confined scope (like in a function), and I don't think I've ever used using to pull the standard stuff out of the std namespace, I simply type 'std::' infront of everything I use from it.
Was This Post Helpful? 0
  • +
  • -

#3 Null and Void  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 204
  • Joined: 29-April 01

Re: Opinion: Using Namespace Std

Posted 02 July 2002 - 06:14 PM

Some other people's opinions on this (so far they all state what I basically feel, but more opinions may be posted):
http://www.gamedev.n...topic_id=102417
Was This Post Helpful? 0
  • +
  • -

#4 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4503
  • View blog
  • Posts: 28,409
  • Joined: 21-March 01

Re: Opinion: Using Namespace Std

Posted 07 July 2002 - 05:48 PM

i use it, just because i think it's better to do that then to go back to using iostream.h

i've never used it in a header before and that's good to know it's better off not using it. thanks. :)
Was This Post Helpful? 0
  • +
  • -

#5 runtime error  Icon User is offline

  • Lucky.Code
  • member icon

Reputation: 3
  • View blog
  • Posts: 629
  • Joined: 19-March 01

Re: Opinion: Using Namespace Std

Posted 07 July 2002 - 08:01 PM

well the alternative, just so you know, is kind of like this:

using std::cin;
using std::cout;



...and so on
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1