Skip to content

Instantly share code, notes, and snippets.

@amoe
Created April 25, 2019 09:13
Show Gist options
  • Save amoe/f7a7e5fb59efed06a3a4f8aded6907f8 to your computer and use it in GitHub Desktop.
Save amoe/f7a7e5fb59efed06a3a4f8aded6907f8 to your computer and use it in GitHub Desktop.
spdlog extension example
#include "spdlog/fmt/ostr.h"
class Person {
public:
Person(string name, int age): name(name), age(age) { }
template<typename OStream>
friend OStream &operator<<(OStream &os, const Person& p) {
return os << "<Person name=" << p.name << ">";
}
string name;
int age;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment