0

The rules at http://community.topcoder.com/tc?module=Static&d1=help&d2=ratedEvent specify that Library import statements (#include, imports, using, Imports) are exempted. But in C++, using statement is not for importing a library.

Can anybody please confirm that is using namespace std; exempted from the Excessive / Extra Code Rule, or not?

updogliu
  • 6,066
  • 7
  • 37
  • 50

1 Answers1

0

It can be disputed if using namespace std; would be excessive; it fulfils a function, but rather a syntactical one than a functional one.

Using it, though, is never such a good idea anyway (since it pollutes the current namespace), therefore I would recommend not to use it in any case. There's nothing wrong with a few std:: prefixes in your code, it's not that much to write and then at least one sees easily what comes from std namespace!

Community
  • 1
  • 1
codeling
  • 11,056
  • 4
  • 42
  • 71
  • 2
    It is reasonable to use it in Topcoder SRM. You know, every second counts there. By saving a dozen of `std::`s you may earn two more score. – updogliu Sep 12 '12 at 08:08