|
by: SerGioGio |
last post by:
Hello !
When a ref. counted smart pointer (template) class is available (like
boost::shared_ptr), is there any (semantic) reason to still use
std::auto_ptr rather than this smart pointer ? Or should one use shared_ptr
for every cases ?
Thanks in advance for your remarks !
SerGioGio
|
by: bucher |
last post by:
Hi,
I want to push a const auto_ptr into a vector, but the compile reports
errors.
Below is the code.
class Folder;
class Result;
class Results
{
public:
int size(){return _Items.size();}
|
by: puzzlecracker |
last post by:
I am using pointers in my program and they obviously make me a bit
nervious about possible program states. I am giving serious thoughs
about using auto_ptr but unsure whether they can be placed in vectors.
This is approximaton of where I need to use them
/currently
class A {
//some members
virtual ~A();
|
by: Jason |
last post by:
I have a function (Inet_ntop) that returns const char * and if I try to
assign that return value to a char * variable, I get the gcc error message:
warning: assignment discards qualifiers from pointer target type
Does anyone know what this warning means? Why do I get it? The program
compiles and appears to work, but I'd like to understand the warning.
Here is basically what the code looks like:
char *str;
|
by: Lloyd Dupont |
last post by:
I try to use the auto_ptr in my code but that doesn't work.
even std::auto_ptr.
I guess I have to add an #include statement, but I can't figure out the
right file to add.
Also I want to use auto_ptr not to manage a single int but and int array.
something like
std::auto_ptr<int> adv = new int;
but from what I read auto_ptr doesn't seems to be the right solution for the
|
|
by: Andrew |
last post by:
Hello all:
After spending some time figuring out auto_ptr class' implementation, I
decided to write a small article detailing its use of the auto_ptr_ref
proxy class to enable construction and assignment from temporaries. I
have placed the manuscript at:
http://www.nd.edu/~ahenrick/auto_ptr.pdf
It develops the problem and its solution in an incremental manner,
which will hopefully make it accessible for most people without being
|
by: Shark |
last post by:
Hi, I was reading on http://www.kuro5hin.org/story/2005/10/31/53857/831
that auto_ptr uses "delete" in its destructor instead of delete. The
article is fairly recent, so I was wondering if this is true in general
for any hosted implementation.
|
by: Markus Dehmann |
last post by:
I am trying to make a pair with a string and an auto_ptr:
#include <iostream>
#include <map>
using namespace std;
int main(){
auto_ptr<intp(new int(3));
make_pair("x",p);
}
|
by: sandy |
last post by:
I am trying to make a simulated directory structure application for a
course.
I am using a Vector to store pointers to my Directory objects (as
subdirectories of the current object).
In my header it looks like this (private section)
vector<Directory*Directories;
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|