HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- pointer in stl vector?
Operating System - OpenVMS
1827840
Members
1534
Online
109969
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
01-27-2005 10:01 PM
01-27-2005 10:01 PM
pointer in stl vector?
Hello,
I want to use the STL container class "vector" and I want to store in it objects of a specific type that I have created. Is it better to store pointers to my objects inside the vector or is it better to store the objects themselves?
thanx
I want to use the STL container class "vector" and I want to store in it objects of a specific type that I have created. Is it better to store pointers to my objects inside the vector or is it better to store the objects themselves?
thanx
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2005 10:08 PM
01-27-2005 10:08 PM
Re: pointer in stl vector?
Bessel, Welcome to the hp itrc VMS Forum. What version of VMS and what version of the C++ compiler are you using?
____________________
Purely Personal Opinion
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 09:57 PM
01-28-2005 09:57 PM
Re: pointer in stl vector?
Bassel,
First, welcome to the VMS forum.
Store pointers or objects, depends on yours implementation. You must know that, when you store an object in the vector, you realy store a copy of the object (the copy constructor CLASS (const CLASS &) is called) and when you remove an object in the midle of the vector the copy assignement operator (CLASS & operator = (const CLASS &))is called for objects which are stored after the removed object. If you store the same object more times in a vector or store the object in two different vectors, these are not the same objects, but copyes of the object.
(CLASS is meant as yours class)
When working with pointers, only pointers are moved and they always point to the same object.
Bojan
First, welcome to the VMS forum.
Store pointers or objects, depends on yours implementation. You must know that, when you store an object in the vector, you realy store a copy of the object (the copy constructor CLASS (const CLASS &) is called) and when you remove an object in the midle of the vector the copy assignement operator (CLASS & operator = (const CLASS &))is called for objects which are stored after the removed object. If you store the same object more times in a vector or store the object in two different vectors, these are not the same objects, but copyes of the object.
(CLASS is meant as yours class)
When working with pointers, only pointers are moved and they always point to the same object.
Bojan
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