- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- using "std" as an explicit namespace qualifier
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 04:01 AM
04-11-2002 04:01 AM
The following code is a small test case that shows the problem:
// test.cpp
#include
int main () {
std::cout << "Hello world\n";
return 0;
}
$ aCC -o test test.cpp
Error 24: "test.cpp", line 4 # ':' expected instead of '::'.
std::cout << "Hello world\n";
^^
Warning 612: "test.cpp", line 4 # Label 'std' has no uses.
std::cout << "Hello world\n";
^^^^^
Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 04:13 AM
04-11-2002 04:13 AM
Re: using "std" as an explicit namespace qualifier
// test.cpp
#include
int main () {
std::cout << "Hello world\n";
return 0;
}
If you've got Stroustrup's latest edition of 'The C++ Programming Language', have a read of section B.3.1 which talks about this change.
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 04:15 AM
04-11-2002 04:15 AM
Re: using "std" as an explicit namespace qualifier
#include
int main () {
cout << "Hello world\n";
return 0;
}
change std::out to cout
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 04:53 AM
04-11-2002 04:53 AM
Re: using "std" as an explicit namespace qualifier
I tried
I searched /usr/include and /opt/aCC/include but didn't find it.
I have to keep the code the way it is because it is shared among several platforms.
Any ideas where is might be?
Thanks in advance for any help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 05:08 AM
04-11-2002 05:08 AM
Solutionhttp://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,1743,00.html#11
I don't have access to a system with aCC on it at present but a few months ago we were running A.03.30 and it definitely had the new std namespace aware iostream header file.
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 05:53 AM
04-11-2002 05:53 AM
Re: using "std" as an explicit namespace qualifier
Hi,
If you want to use
have to use the option -AA to the compiler.
When using #include
may also be changed to this:
#include
using namespace std;
int main () {
cout << "Hello world\n";
return 0;
}
Regards
Olav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 06:58 AM
04-11-2002 06:58 AM
Re: using "std" as an explicit namespace qualifier
As I understand the -AA option is not available for aCC A.03.25, so probably as Steve pointed out I have to upgrade my compiler before trying anything.
Because the actual code is shared I have to keep the changes at a minimum to have a lower impact on other platforms that use the same code. That's why I prefer to keep the "std::" qualifier. Is there anything in the new standard that says I should not use it? Why?
Ed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 07:13 AM
04-11-2002 07:13 AM
Re: using "std" as an explicit namespace qualifier
Regards,
Steve