Title
Deduction guide for `std::thread::name_hint` from `std::basic_string` should ignore the allocator type
Status
new
Section
[thread.thread.class.general]
Submitter
Jiang An

Created on 2026-07-24.00:00:00 last changed 1 week ago

Messages

Date: 2026-07-28.15:08:32

Proposed resolution:

This wording is relative to N5054.

  1. Modify [thread.thread.class.general] as indicated:

    namespace std {
      class thread {
      public:
        […]
        // [thread.attributes], thread attributes
        template<same_as<char> T>
          class name_hint;
        template<class T>
          name_hint(const T*) -> name_hint<T>;
        template<class T, class Allocator>
          name_hint(basic_string<T, char_traits<T>, Allocator>) -> name_hint<T>;
        […]
      };
    }
    
Date: 2026-07-24.00:00:00

Currently, there is a deduction guide for `std::thread::name_hint` that only accepts std::basic_string<T>. Given the corresponding constructor (see [thread.attributes.hint]) actually takes std::basic_string_view<T>, presumably it's more reasonable to make the deduction guide accept `basic_string` specializations with different allocator types (e.g. `std::pmr::string`).

History
Date User Action Args
2026-07-28 15:08:32adminsetmessages: + msg16532
2026-07-24 00:00:00admincreate