search for: foo_object

Displaying 2 results from an estimated 2 matches for "foo_object".

2016 Oct 12
2
RFC: General purpose type-safe formatting library
...does it choose the type? It seems there is no d in there. > > > 4. os << format_string("{0:X}", 255); // writes "0xFF" > 5. os << format_string("{0:X7}", 255); // writes "0x000FF" > 6. os << format_string("{0}", foo_object); // fails to compile! > > Here is another example of an improvement over traditional formatting > mechanisms. If you pass an object for which it cannot find a formatter, it > fails to compile. > > However, you can always define custom formatters for your own types. If > you...
2016 Oct 12
15
RFC: General purpose type-safe formatting library
...if it's expensive to compute, this means you have to save it into a temporary. 4. os << format_string("{0:X}", 255); // writes "0xFF" 5. os << format_string("{0:X7}", 255); // writes "0x000FF" 6. os << format_string("{0}", foo_object); // fails to compile! Here is another example of an improvement over traditional formatting mechanisms. If you pass an object for which it cannot find a formatter, it fails to compile. However, you can always define custom formatters for your own types. If you write: namespace llvm { templa...