strange syntax in stl (gnu version) - c++
This is a discussion on strange syntax in stl (gnu version) - c++ ; I saw something really wierld in g++ version of stl source.
void construct(pointer __p, const _Tp& __val) { ::new(__p)
_Tp(__val); }
anybody knows about the syntax new(__p) means? can new really take a
pointer as a parameter?...
-
strange syntax in stl (gnu version)
I saw something really wierld in g++ version of stl source.
void construct(pointer __p, const _Tp& __val) { ::new(__p)
_Tp(__val); }
anybody knows about the syntax new(__p) means? can new really take a
pointer as a parameter?
-
Re: strange syntax in stl (gnu version)
Ningyu Shi wrote:
> I saw something really wierld in g++ version of stl source.
>
> void construct(pointer __p, const _Tp& __val) { ::new(__p)
> _Tp(__val); }
>
> anybody knows about the syntax new(__p) means? can new really take a
> pointer as a parameter?
>
Look up placement new.
--
Ian Collins.
Similar Threads
-
By Application Development in forum C
Replies: 19
Last Post: 12-08-2007, 09:14 PM
-
By Application Development in forum C
Replies: 3
Last Post: 07-09-2007, 10:41 PM
-
By Application Development in forum REXX
Replies: 0
Last Post: 12-20-2005, 05:56 AM
-
By Application Development in forum Perl
Replies: 1
Last Post: 03-20-2005, 02:08 AM
-
By Application Development in forum Perl
Replies: 1
Last Post: 09-15-2004, 01:23 AM