Giter Site home page Giter Site logo

triviality of pair about container HOT 6 CLOSED

boostorg avatar boostorg commented on July 18, 2024
triviality of pair

from container.

Comments (6)

igaztanaga avatar igaztanaga commented on July 18, 2024

Many thanks. Included in the commit:

9a22431

from container.

mglisse avatar mglisse commented on July 18, 2024

Thanks. I thought you would want to make pair trivial, so I only listed the most important trait, but if we are going to specialize traits, it isn't the only one that is relevant.

template<class A, class B> struct is_trivially_copy_constructible<boost::container::dtl::pair<A,B>>
: and_<is_trivially_copy_constructible<A>, is_trivially_copy_constructible<B> > {};

(copy vs assign)
also gives some (smaller) gains on different testcases. I didn't test if is_trivially_default_constructible, is_trivially_move_(constructi|assigna)ble or some of the other specialized traits (is_memzero_initializable) make a difference.

from container.

igaztanaga avatar igaztanaga commented on July 18, 2024

I think "is_trivially_default_constructible" would break code as pair is expected to be value initialized. move variants and "is_trivially_destructible" seem safer. Thanks again for the additional comments. Commited in:

4faa05e

from container.

mglisse avatar mglisse commented on July 18, 2024

Nice, thanks for all the recent patches. Recent gcc warns (-Wclass-memaccess) about using mem* on a non-trivial type, but I just ignore it. Supposedly we could suppress the warning with some extra casts.

from container.

igaztanaga avatar igaztanaga commented on July 18, 2024

Let's see if

62a8b66

helps

from container.

mglisse avatar mglisse commented on July 18, 2024

Looks like it does, great πŸ‘

from container.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.