public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tejasvi Singh <tejasvisingh48@outlook.com>
To: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Subject: Code style enforcement
Date: Fri, 24 Dec 2021 10:44:29 +0000	[thread overview]
Message-ID: <BM1PR01MB2579B1C4E951E6CA01838ACADD7F9@BM1PR01MB2579.INDPRD01.PROD.OUTLOOK.COM> (raw)

Hi,

While going through include/bits/stl-algo.h I noticed the return type is indented after template declaration. See below the indentation of return type _Function. The code formatting is enforced by clang-formatter (config at /contrib/clang-format) which does not indent the return type after template declaration. Is the inconsistency due to limitation of clang-format or a missing config option?

template<typename _InputIterator, typename _Function>
  _Function
  for_each(_InputIterator __first, _InputIterator __last, _Function __f)
  {
    // concept requirements
    __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
    __glibcxx_requires_valid_range(__first, __last);
    for (; __first != __last; ++__first)
  __f(*__first);
    return __f; // N.B. [alg.foreach] says std::move(f) but it's redundant.
  }

Tejasvi

             reply	other threads:[~2021-12-24 10:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24 10:44 Tejasvi Singh [this message]
2021-12-24 12:18 ` Jonathan Wakely
2021-12-24 12:21   ` Jonathan Wakely
2021-12-24 12:21   ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BM1PR01MB2579B1C4E951E6CA01838ACADD7F9@BM1PR01MB2579.INDPRD01.PROD.OUTLOOK.COM \
    --to=tejasvisingh48@outlook.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).