Re: [Cppcms-users] Compilation errors using gcc 4.5 and c++0x
Brought to you by:
artyom-beilis
|
From: Artyom <art...@ya...> - 2010-06-28 10:32:16
|
No it is not quite possible,
1. unique_ptr and auto_ptr are different pointers with different semantics.
For example:
auto_ptr<foo> factory()
{
auto_ptr<foo> ptr(new foo());
return ptr;
}
Would not work with unique_ptr as it requires std::move.
2. They are different binary-incompatible classes. For example my code runs
on gcc-4.5 without C++0x, if in two years C++0x becomes default with
gcc then automatic replacement of auto_ptr with unique_ptr will break
backward binary compatibility of the library, so I can't relay
on this feature.
I think it is stupid to deprecate auto_ptr as it is the only smart pointer existing
in C++03 so I hope gcc will remove deprecation warning for most used C++ smart pointer.
I don't see any problem with it, the only problem is that some programmers
had used it inside STL Collections and got problems with it.
Artyom
----- Original Message ----
> From: Stanimir Mladenov <sta...@zo...>
> To: cpp...@li...
> Sent: Mon, June 28, 2010 12:06:38 PM
> Subject: Re: [Cppcms-users] Compilation errors using gcc 4.5 and c++0x
>
> Yes, but using C++0x gives much benefits already and it is really good
that
> you support it to some extend already.
Something that already was discussed,
> is the deprecation of auto_ptr
in favor of unique_ptr. At the moment c++0x is
> enabled, a warning
about this is emitted. Is it possible to substitute
> auto_ptr to
unique_ptr the same way you do with auto and
> __typeof__?
It is not a big deal but it looks much better this
> way.
Stanimir
On Sat, Jun 26, 2010 at 10:44 PM, Artyom <
> ymailto="mailto:art...@ya..."
> href="mailto:art...@ya...">art...@ya...>
> wrote:
>>
>> Actually, CppCms compiles fine without the
> --std=c++0x
>> flag. I saw you
>> are using the auto keyword
> in the templates loops if
>> available and
>> since I am using
> it too, decided to give it to CppCms
>> also.
>
> Note, I
> don't really need C++0x mode to get nice way to iterate
> over
> collections.
>
> Under gcc, intel and even SunStudo (I used to
> support)
> compilers I have typeof or __typeof__ which is very close to
> decltype
> so auto is not so necessary, but still I'm really looking
> forward
> for it in all modern compilers as for C++0x at
> all.
>
> If today C++0x was supported by most compilers I would not
> need
> half of Booster today.
>
> Regards
>
> Artyom
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> This SF.net email is sponsored by
> Sprint
> What will you do first with EVO, the first 4G phone?
>
> Visit sprint.com/first --
> http://p.sf.net/sfu/sprint-com-first
>
> _______________________________________________
> Cppcms-users mailing
> list
>
> href="mailto:Cpp...@li...">Cpp...@li...
>
>
> target=_blank
> >https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
------------------------------------------------------------------------------
This
> SF.net email is sponsored by Sprint
What will you do first with EVO, the
> first 4G phone?
Visit sprint.com/first --
> href="http://p.sf.net/sfu/sprint-com-first" target=_blank
> >http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Cppcms-users
> mailing list
> href="mailto:Cpp...@li...">Cpp...@li...
> href="https://lists.sourceforge.net/lists/listinfo/cppcms-users" target=_blank
> >https://lists.sourceforge.net/lists/listinfo/cppcms-users
|