Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • That operator<< is in a .cpp file, and it isn't going to instantiate itself. You instantiate array, so it looks like you know what to do when a templete is defined in a .cpp file. But array instantiations are not doing anything to operator<<. You need explicit instantiations for it as well. Commented May 1, 2024 at 17:39
  • Note to whoever closed that as a dupe of this: that was a mistake. Note explicit instantiations of array in the .cpp file. Un-closing. Note to others who are tempted to repeat the same mistake: please don't. Commented May 1, 2024 at 18:06
  • @n.m.couldbeanAI Thanks, it now works but I get a warning now for each explicit declaration. Commented May 1, 2024 at 19:23
  • @Kominops And the warning is difficult to copy-paste, or why aren't you telling? Just trying to make things more interesting for everyone, I guess? Commented May 1, 2024 at 19:32
  • @ChristianStieber sorry, I placed an answer to my question with the warning in it, that's why I didn't add it as a comment. Commented May 1, 2024 at 20:01