Created
April 25, 2019 09:13
-
-
Save amoe/f7a7e5fb59efed06a3a4f8aded6907f8 to your computer and use it in GitHub Desktop.
spdlog extension example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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