Skip to content

Compilation error when applying std::views::transform to std::array #48855

Closed
@Craffael

Description

@Craffael
mannequin
Bugzilla Link 49511
Version trunk
OS Linux
CC @craffael,@zygoloid

Extended Description

Unfortunately the following code fails to compile (using the STL of g++-10.2):

==== begin test program ====
#include
#include

std::array<int,2> points_;

auto foo() {
auto v = std::views::transform([](int p) {return p;});
return points_ | v;
}

int main() {
auto z = foo();
}
==== end test program ====

The same code compiles without problems using g++-10.2 so I think it should be valid code...

See also https://godbolt.org/z/e1ncvW

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++20conceptsC++20 conceptsduplicateResolved as duplicate

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions