public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: Add std:: prefix for forward_iterator_tag
@ 2022-08-19 18:00 whh8b
  2022-08-19 18:00 ` whh8b
  0 siblings, 1 reply; 4+ messages in thread
From: whh8b @ 2022-08-19 18:00 UTC (permalink / raw)
  To: libstdc++

Hello! First, I know this patch is incredibly tiny but I hope it is helpful.

Second, I've been a longtime reader of the libstdc++ source code but never been
able to overcome the fear of attempting to contribute. I have attempted to
follow all the rules. Please correct what I have done wrong.

Thank you for all the work you put in to developing the library!

Will



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] libstdc++: Add std:: prefix for forward_iterator_tag
  2022-08-19 18:00 [PATCH] libstdc++: Add std:: prefix for forward_iterator_tag whh8b
@ 2022-08-19 18:00 ` whh8b
  2022-08-19 18:48   ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: whh8b @ 2022-08-19 18:00 UTC (permalink / raw)
  To: libstdc++

From: Will Hawkins <whh8b@obs.cr>

libstdc++-v3/ChangeLog:

        * include/bits/basic_string (basic_string(const _CharT*, size_type _, const _Alloc&)):
        Add std:: prefix to forward_iterator_tag.
---
 libstdc++-v3/include/bits/basic_string.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index b04fba95678..e7d7833e002 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -639,7 +639,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
 	  std::__throw_logic_error(__N("basic_string: "
 				       "construction from null is not valid"));
 	const _CharT* __end = __s + traits_type::length(__s);
-	_M_construct(__s, __end, forward_iterator_tag());
+	_M_construct(__s, __end, std::forward_iterator_tag());
       }
 
       /**
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libstdc++: Add std:: prefix for forward_iterator_tag
  2022-08-19 18:00 ` whh8b
@ 2022-08-19 18:48   ` Jonathan Wakely
  2022-08-19 20:06     ` Will Hawkins
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2022-08-19 18:48 UTC (permalink / raw)
  To: whh8b; +Cc: libstdc++

On Fri, 19 Aug 2022, 20:01 , <whh8b@obs.cr> wrote:

> From: Will Hawkins <whh8b@obs.cr>
>
> libstdc++-v3/ChangeLog:
>
>         * include/bits/basic_string (basic_string(const _CharT*, size_type
> _, const _Alloc&)):
>         Add std:: prefix to forward_iterator_tag.
>

This qualification is not necessary, there is no ADL for that expression,
so name lookup cannot possibly find anything except
std::forward_iterator_tag.

N.B. patches for libstdc++ need to be CC'd to gcc-patches as well as the
libstdc++ list.




---
>  libstdc++-v3/include/bits/basic_string.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libstdc++-v3/include/bits/basic_string.h
> b/libstdc++-v3/include/bits/basic_string.h
> index b04fba95678..e7d7833e002 100644
> --- a/libstdc++-v3/include/bits/basic_string.h
> +++ b/libstdc++-v3/include/bits/basic_string.h
> @@ -639,7 +639,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
>           std::__throw_logic_error(__N("basic_string: "
>                                        "construction from null is not
> valid"));
>         const _CharT* __end = __s + traits_type::length(__s);
> -       _M_construct(__s, __end, forward_iterator_tag());
> +       _M_construct(__s, __end, std::forward_iterator_tag());
>        }
>
>        /**
> --
> 2.34.1
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libstdc++: Add std:: prefix for forward_iterator_tag
  2022-08-19 18:48   ` Jonathan Wakely
@ 2022-08-19 20:06     ` Will Hawkins
  0 siblings, 0 replies; 4+ messages in thread
From: Will Hawkins @ 2022-08-19 20:06 UTC (permalink / raw)
  To: libstdc++

Okay! Thank you!

It was the only use of forward_iterator_tag in basic_string that did
not have that qualification so I just thought that it would be good to
have for consistency.

Thanks again,
Will

On Fri, Aug 19, 2022 at 2:48 PM Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
>
>
> On Fri, 19 Aug 2022, 20:01 , <whh8b@obs.cr> wrote:
>>
>> From: Will Hawkins <whh8b@obs.cr>
>>
>> libstdc++-v3/ChangeLog:
>>
>>         * include/bits/basic_string (basic_string(const _CharT*, size_type _, const _Alloc&)):
>>         Add std:: prefix to forward_iterator_tag.
>
>
> This qualification is not necessary, there is no ADL for that expression, so name lookup cannot possibly find anything except std::forward_iterator_tag.
>
> N.B. patches for libstdc++ need to be CC'd to gcc-patches as well as the libstdc++ list.
>
>
>
>
>> ---
>>  libstdc++-v3/include/bits/basic_string.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
>> index b04fba95678..e7d7833e002 100644
>> --- a/libstdc++-v3/include/bits/basic_string.h
>> +++ b/libstdc++-v3/include/bits/basic_string.h
>> @@ -639,7 +639,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
>>           std::__throw_logic_error(__N("basic_string: "
>>                                        "construction from null is not valid"));
>>         const _CharT* __end = __s + traits_type::length(__s);
>> -       _M_construct(__s, __end, forward_iterator_tag());
>> +       _M_construct(__s, __end, std::forward_iterator_tag());
>>        }
>>
>>        /**
>> --
>> 2.34.1
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-19 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19 18:00 [PATCH] libstdc++: Add std:: prefix for forward_iterator_tag whh8b
2022-08-19 18:00 ` whh8b
2022-08-19 18:48   ` Jonathan Wakely
2022-08-19 20:06     ` Will Hawkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).