tfc / pprintpp

Typesafe Python Style Printf Formatting for C++
MIT License
233 stars 12 forks source link

pprintpp needs extra cstdio include #16

Closed blitz closed 4 years ago

blitz commented 4 years ago

pprintf() expands to a call to printf() yet it doesn't include cstdio. This leads to the somewhat confusing error seen below:

src/main.cpp: In function ‘int main()’:
src/main.cpp:65:3: error: ‘printf’ was not declared in this scope
   65 |   pprintf("Hello World!\n");
      |   ^~~~~~~
user-virtio-net/src/main.cpp:8:1: note: ‘printf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?

Minimal example of the problem:

#include <pprintpp/pprintpp.hpp>

int main()
{
  pprintf("Hello World!\n");
  return 0;
}

For me the expected behavior would be for this to work without manually including other headers.