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.

3055. path::operator+=(single-character) misspecified

Section: 28.11.7.4.4 [fs.path.concat] Status: New Submitter: Tim Song Opened: 2018-01-24 Last modified: 2018-10-15

Priority: 3

View all other issues in [fs.path.concat].

View all issues with New status.

Discussion:

28.11.7.4.4 [fs.path.concat] uses the expression path(x).native() to specify the effects of concatenating a single character x. However, there is no path constructor taking a single character.

[2018-06-18 after reflector discussion]

Priority set to 3

[2018-10-12 Tim updates PR to avoid suggesting the creation of a temporary path.]

Previous resolution [SUPERSEDED]:

This wording is relative to N4713.

  1. Modify 28.11.7.4.4 [fs.path.concat] as indicated:

    path& operator+=(const path& x);
    path& operator+=(const string_type& x);
    path& operator+=(basic_string_view<value_type> x);
    path& operator+=(const value_type* x);
    path& operator+=(value_type x);
    template<class Source>
      path& operator+=(const Source& x);
    template<class EcharT>
      path& operator+=(EcharT x);
    template<class Source>
      path& concat(const Source& x);
    

    -1- Effects: […]

    -2- Returns: *this.

    path& operator+=(value_type x);
    template<class EcharT>
      path& operator+=(EcharT x);
    

    -?- Effects: Equivalent to: return *this += path(&x, &x + 1);.

Proposed resolution:

This wording is relative to N4762.

  1. Modify 28.11.7.4.4 [fs.path.concat] as indicated:

    path& operator+=(const path& x);
    path& operator+=(const string_type& x);
    path& operator+=(basic_string_view<value_type> x);
    path& operator+=(const value_type* x);
    path& operator+=(value_type x);
    template<class Source>
      path& operator+=(const Source& x);
    template<class EcharT>
      path& operator+=(EcharT x);
    template<class Source>
      path& concat(const Source& x);
    

    -1- Effects: […]

    -2- Returns: *this.

    path& operator+=(value_type x);
    template<class EcharT>
      path& operator+=(EcharT x);
    

    -?- Effects: Equivalent to: return *this += basic_string_view(&x, 1);