Skip to content

The CTAD of the standard container is still instantiated when Alloc does not satisfy Allocator. #4060

@hewillk

Description

@hewillk

Not sure if this is a language bug or a library bug:

https://godbolt.org/z/EY6K9eKP9

#include <vector>
#include <list>

template<template <class...> class Cnt, class Alloc>
concept can_ctad = requires (int* it) {
  Cnt(it, it, Alloc{});
};

struct NotAlloc { };

static_assert(!can_ctad<std::vector, NotAlloc>); // hard error in MSVC-STL
static_assert(!can_ctad<std::list, NotAlloc>); // hard error in MSVC-STL

Metadata

Metadata

Assignees

No one assigned

    Labels

    LWG issue neededA wording defect that should be submitted to LWG as a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions