0

I was reading the manual for std::string::data() on cppreference.com and noticed that in C++20 the definition of the method is going to change to:

constexpr CharT* data() noexcept;

How is that possible that the address of a dynamically allocated memory is known at compile time?

majakthecoder
  • 177
  • 3
  • 14
  • Related: [Will std::string end up being our compile-time string after all?](https://stackoverflow.com/q/57129245/9716597) – L. F. Sep 04 '20 at 02:25
  • TL;DR: it knows the address of dynamically allocated memory at compile time when the memory is dynamically allocated *at compile time*. – Nicol Bolas Sep 04 '20 at 02:26

0 Answers0