<type_traits>
Hey,After an exciting first week of C++11 library support, here's an update on what is now allowed to be used in chromium code: http://chromium-cpp.appspot.com/#library-whitelistPlease see https://groups.google.com/a/chromium.org/forum/#!forum/cxx for previous and ongoing discussions (a few of them have bled out to chromium-dev as well, of course).1. Containers containing movable types: std::vector<scoped_ptr>- This allows getting rid of ScopedVector. A lot of people have been contributing to this from all over the codebase already! Feel free to join in the fun.2. Lexicographical struct comparison: std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c)- This can be used to implement comparison operators rather than writing a series of if a == rhs.a then.. else..- General use of std::tuple or std::tie has not been allowed outside of this use case.3. Move Semantics: std::move()- std::move() can be used in place of .Pass() for scoped_ptr, scoped_refptr, ScopedGeneric, and a few other move-only types already in our codebase.
- std::move() can be used with any standard library types which were previously allowed.- Please read https://sites.google.com/a/chromium.org/dev/rvalue-references to learn what move() does before you use it. (Hint: it doesn't move anything.)- Writing your own move constructors is not yet allowed without approval from styleguide/c++11 OWNERS.- These may be used where we do other tricks right now in templated code such as the implementation of base::Callback. We don't expect people to actually use these commonly (or at all).5. Type Traits: Class templates within<type_traits>
- These can replace some custom implementations of type traits in base/, but not all type traits are available on all platforms yet (eg std::underlying_type doesn't work in supported linux platforms).Happy hacking,Dana
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
On Wed, Nov 18, 2015 at 6:57 PM, 'Dana Jansens' via Chromium-dev <chromi...@chromium.org> wrote:Hey,After an exciting first week of C++11 library support, here's an update on what is now allowed to be used in chromium code: http://chromium-cpp.appspot.com/#library-whitelistPlease see https://groups.google.com/a/chromium.org/forum/#!forum/cxx for previous and ongoing discussions (a few of them have bled out to chromium-dev as well, of course).1. Containers containing movable types: std::vector<scoped_ptr>- This allows getting rid of ScopedVector. A lot of people have been contributing to this from all over the codebase already! Feel free to join in the fun.2. Lexicographical struct comparison: std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c)- This can be used to implement comparison operators rather than writing a series of if a == rhs.a then.. else..- General use of std::tuple or std::tie has not been allowed outside of this use case.3. Move Semantics: std::move()- std::move() can be used in place of .Pass() for scoped_ptr, scoped_refptr, ScopedGeneric, and a few other move-only types already in our codebase.
scoped_refptr isn't move-only. Can std::move be used for any movable type, or only move-only?
Hey,After an exciting first week of C++11 library support, here's an update on what is now allowed to be used in chromium code: http://chromium-cpp.appspot.com/#library-whitelistPlease see https://groups.google.com/a/chromium.org/forum/#!forum/cxx for previous and ongoing discussions (a few of them have bled out to chromium-dev as well, of course).1. Containers containing movable types: std::vector<scoped_ptr>- This allows getting rid of ScopedVector. A lot of people have been contributing to this from all over the codebase already! Feel free to join in the fun.2. Lexicographical struct comparison: std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c)- This can be used to implement comparison operators rather than writing a series of if a == rhs.a then.. else..- General use of std::tuple or std::tie has not been allowed outside of this use case.3. Move Semantics: std::move()- std::move() can be used in place of .Pass() for scoped_ptr, scoped_refptr, ScopedGeneric, and a few other move-only types already in our codebase.
- std::move() can be used with any standard library types which were previously allowed.- Please read https://sites.google.com/a/chromium.org/dev/rvalue-references to learn what move() does before you use it. (Hint: it doesn't move anything.)- Writing your own move constructors is not yet allowed without approval from styleguide/c++11 OWNERS.- These may be used where we do other tricks right now in templated code such as the implementation of base::Callback. We don't expect people to actually use these commonly (or at all).5. Type Traits: Class templates within<type_traits>
- These can replace some custom implementations of type traits in base/, but not all type traits are available on all platforms yet (eg std::underlying_type doesn't work in supported linux platforms).Happy hacking,Dana
--
On Wed, Nov 18, 2015 at 6:58 PM 'Dana Jansens' via Chromium-dev <chromi...@chromium.org> wrote:Hey,After an exciting first week of C++11 library support, here's an update on what is now allowed to be used in chromium code: http://chromium-cpp.appspot.com/#library-whitelistPlease see https://groups.google.com/a/chromium.org/forum/#!forum/cxx for previous and ongoing discussions (a few of them have bled out to chromium-dev as well, of course).1. Containers containing movable types: std::vector<scoped_ptr>- This allows getting rid of ScopedVector. A lot of people have been contributing to this from all over the codebase already! Feel free to join in the fun.2. Lexicographical struct comparison: std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c)- This can be used to implement comparison operators rather than writing a series of if a == rhs.a then.. else..- General use of std::tuple or std::tie has not been allowed outside of this use case.3. Move Semantics: std::move()- std::move() can be used in place of .Pass() for scoped_ptr, scoped_refptr, ScopedGeneric, and a few other move-only types already in our codebase."can" be used? Is there a preference or will the codebase become a random mix of both?