Anton Polukhin
Company: Yandex.Taxi
When writing large frameworks, one has to face typical problems, solutions for which have long been known. However, these solutions are not effective enough and can be implemented much better.
We will talk about such effective tricks!
struct something {
int foo ();
private:
struct impl;
std :: unique_ptr < const impl> impl_; // dynamic allocation :(
};
Let's remove the dynamic allocation from it and add cache friendliness.
std :: ostream & operator << (std :: ostream & os, const user_data_type & udt);
my_debug_logger << user_data_type {"foo", "bar"};
Let's do it without std::ostream and without calculating the values of variables for the records that we do not log.
// This does not compile:
user_data_type1 Parse (const Json & value);
user_data_type2 Parse (const Json & value);
// Compiles, but...
template < class T> T Parse (const Json & value);
template <> user_data_type1 Parse (const Json & value);
template <> user_data_type2 Parse (const Json & value);
// ... gives us horrible unreadable error messages, and Parse<std::vector>(const Json & value) is odd.
Let's make it beautiful.
Company: Yandex.Taxi