Jul 21, 2025

[C++] P1787R6: Declarations and where to find them

P1787R6: Declarations and where to find them


https://timsong-cpp.github.io/cppwp/n4868/temp.local#7

https://timsong-cpp.github.io/cppwp/n4950/temp.local#7


https://godbolt.org/z/hrE3YEzPd

<source>:12:53: error: 'Write' is not a type

#include <cstdint>

class Foo {
  template <typename Write>
  void WriteNestedMessage(uint32_t field_number, Write write_message);

 protected:
  void Write();
};

template <typename Write>
void Foo::WriteNestedMessage(uint32_t field_number, Write write_message) {}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.