HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- vector initialization with
Operating System - Linux
1828227
Members
2673
Online
109975
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
07-08-2002 08:17 AM
07-08-2002 08:17 AM
vector initialization with
I'm using a stl::vector to maintain list.
Program fails during compilation time when the template class's overloaded address operator is private.
When it's made public files get compiled without a problem. However the same test program gets compiled with the VC compiler in Windows. Is this a stl implementation specific issue in HP-UX.
My test files are as follows
// Test.h: file
//
//////////////////////////////////////////////////////////////////////
#if !defined(_TEST_HDR_)
#define _TEST_HDR_
class CTest
{
public:
CTest();
virtual ~CTest();
private:
CTest * operator&();
};
#endif //
// Test.cpp: implementation of the CTest class.
//
//////////////////////////////////////////////////////////////////////
#include "Test.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CTest::CTest()
{
}
CTest::~CTest()
{
}
CTest * CTest::operator&()
{
return this;
}
///// mytest.h file
#ifndef __MYTEST_H__
#define __MYTEST_H__
#include
#include
#include "Test.h"
class mytest
{
public:
mytest();
int test(int a);
std::vector mNodeMap;
};
#endif //MYTEST
//mytest.cpp file
#include "mytest.h"
mytest::mytest()
{
mNodeMap.resize(30);
}
int mytest::test(int a)
{
return a;
}
version of aCC compiler I'm using is
A.03.33
Program fails during compilation time when the template class's overloaded address operator is private.
When it's made public files get compiled without a problem. However the same test program gets compiled with the VC compiler in Windows. Is this a stl implementation specific issue in HP-UX.
My test files are as follows
// Test.h: file
//
//////////////////////////////////////////////////////////////////////
#if !defined(_TEST_HDR_)
#define _TEST_HDR_
class CTest
{
public:
CTest();
virtual ~CTest();
private:
CTest * operator&();
};
#endif //
// Test.cpp: implementation of the CTest class.
//
//////////////////////////////////////////////////////////////////////
#include "Test.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CTest::CTest()
{
}
CTest::~CTest()
{
}
CTest * CTest::operator&()
{
return this;
}
///// mytest.h file
#ifndef __MYTEST_H__
#define __MYTEST_H__
#include
#include
#include "Test.h"
class mytest
{
public:
mytest();
int test(int a);
std::vector
};
#endif //MYTEST
//mytest.cpp file
#include "mytest.h"
mytest::mytest()
{
mNodeMap.resize(30);
}
int mytest::test(int a)
{
return a;
}
version of aCC compiler I'm using is
A.03.33
- Tags:
- vector
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 02:56 PM
03-09-2006 02:56 PM
Re: vector initialization with
It appears your T violates 23.1(3), it has to be CopyConstructable. Table 30 in 20.1.3(1) says that &t returns *T. And I assume it better not be private.
I've heard from Roguewave on this and he said sometimes there are changes that can be made to allow this but is isn't required by the Standard.
I've heard from Roguewave on this and he said sometimes there are changes that can be made to allow this but is isn't required by the Standard.
- Tags:
- containers
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP