Jakub Kucharski <[email protected]> writes:

> On Sun, 2016-05-29 at 22:50 +0200, Albert Astals Cid wrote:
>> Hi guys, what do you think of us adding "some" of the C++11 features
>> in 
>> poppler?
>> 
>> One that would be useful for example is std::unique_ptr, that is a
>> class that 
>> will take ownership of a pointer and delete it when it goes out of
>> scope.
>
> I think *some* C++11 features (e.g. std::unique_ptr) would make things
> easier. However there are some which could make things harder, e.g.
> type inference (auto) - it sometimes makes it hard to reason about the
> code when you don't know what type a function returns. So yes, some
>  C++11 features would be OK, but perhaps we could make guidelines for
> it.

Well, we could just document the cases where it could be used. We don't
use templates in poppler, so we don't have huge types where auto is
quite useful, but still there are cases where things look much better,
like in modern for loops:

for (auto foo : fooList)

also in cases where the type is twice like:

Foo* f = reinterpret_cast<Foo*>(b); -> auto f = reinterpret_cast<Foo*>(b);
or
Foo* f = std::make_unique<Foo>(); -> auto f = std::make_unique<Foo>();

>               Jakub
> _______________________________________________
> poppler mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/poppler

-- 
Carlos Garcia Campos
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462

Attachment: signature.asc
Description: PGP signature

_______________________________________________
poppler mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to