Skip to content

inplace_vector is not trivially copyable #168

@lurtz

Description

@lurtz

Description

The folllowing code fails to compile:

#include <score/inplace_vector.hpp>
#include <type_traits>

static_assert(std::is_trivially_copyable_v<score::cpp::inplace_vector<int, 1>>);

The C++26 inplace_vector should be trivially copyable, if T is. At least that is the impression I get, when looking at some special member functions (constructor, destructor, assignment operator).

Thus if the score type aims to be a drop-in replacement it needs to be trivially copyable as well.

Analysis results

It looks like non trivial constructors, assignment operators and destructors are used.

Solution

No response

Error Occurrence Rate

Reproducible

How to reproduce

No response

Supporting Information

No response

Classification

Minor

First Affected Release

not released (main)

Last Affected Release

not released (main)

Expected Fixed Release

before release (main)

Category

  • Safety Relevant
  • Security Relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions