On 03/04/14 01:22 PM, Ziad Hatahet wrote: > Would it be useful to look at what other languages are doing? For > instance, slices in Go are appendable, so perhaps it would be worth > looking at code bases written in Go to see how they deal with slices, or > how often they append to slices returned from standard library routines. > > -- > Ziad
Go doesn't have an equivalent to what `~[T]` will be. std::unique_ptr<T[]> is rarely used in C++, and exists solely for interoperability with legacy code. This is a common use case for std::unique_ptr in C++, which is why it takes a destructor parameter. For example, a lone function returning a FILE * pointer can be dealt with by doing `auto file = make_unique(get_file(), fclose)`, which gives you a `std::unique_ptr<FILE, decltype(&fclose)>`.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
