This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4609. Deduction guide for std::thread::name_hint from std::basic_string should ignore the allocator type

Section: 32.4.3.1 [thread.thread.class.general] Status: New Submitter: Jiang An Opened: 2026-07-24 Last modified: 2026-07-28

Priority: Not Prioritized

View all issues with New status.

Discussion:

Currently, there is a deduction guide for std::thread::name_hint that only accepts std::basic_string<T>. Given the corresponding constructor (see 32.4.3.2.2 [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).

Proposed resolution:

This wording is relative to N5054.

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

    namespace std {
      class thread {
      public:
        […]
        // 32.4.3.2 [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>;
        […]
      };
    }