[libcxx-commits] [PATCH] D148641: [libc++] Add C++20 stringstream::view()

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 16 10:11:15 PDT 2023


philnik accepted this revision.
philnik added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/include/sstream:492
+basic_string_view<_CharT, _Traits>
+basic_stringbuf<_CharT, _Traits, _Allocator>::view() const noexcept
+{
----------------
Mordante wrote:
> pfusik wrote:
> > Mordante wrote:
> > > pfusik wrote:
> > > > Mordante wrote:
> > > > > Please format the new code with clang-format so it matches our "normal" style. 
> > > > How do I do that?
> > > You can use git clang-format like `git clang-format-16 HEAD^` this formats the changes in the last commit.
> >     fox at wiesmac llvm-project % git clang-format HEAD^
> >     clang-format did not modify any files
> > 
> Odd it doesn't work for me either, normally it does. When I select this hunk manully and format it I get
> ```
> template <class _CharT, class _Traits, class _Allocator>
> _LIBCPP_HIDE_FROM_ABI basic_string_view<_CharT, _Traits>
> basic_stringbuf<_CharT, _Traits, _Allocator>::view() const noexcept {
>     if (__mode_ & ios_base::out) {
>         if (__hm_ < this->pptr())
>             __hm_ = this->pptr();
>         return basic_string_view<_CharT, _Traits>(this->pbase(), __hm_);
>     } else if (__mode_ & ios_base::in)
>         return basic_string_view<_CharT, _Traits>(this->eback(), this->egptr());
>     return basic_string_view<_CharT, _Traits>();
> }
> 
> ```
git-clang-format doesn't recognize `sstream` because it doesn't have a file ending.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148641/new/

https://reviews.llvm.org/D148641



More information about the libcxx-commits mailing list