class Printable
Declaration
class Printable { /* full declaration omitted */ };
Description
Simple wrapper around std::function <void (raw_ostream & )>. This class is useful to construct print helpers for raw_ostream. Example: Printable printRegister(unsigned Register) { return Printable([Register](raw_ostream &OS ) { OS < < getRegisterName(Register); }); } ... OS < < printRegister(Register); ... Implementation note: Ideally this would just be a typedef, but doing so leads to operator < < being ambiguous as function has matching constructors in some STL versions. I have seen the problem on gcc 4.6 libstdc++ and microsoft STL.
Declared at: llvm/include/llvm/Support/Printable.h:38
Member Variables
- public std::function<void(raw_ostream&)> Print
Method Overview
- public Printable(std::function<void (raw_ostream &)> Print)
Methods
ΒΆPrintable(std::function<void(raw_ostream&)> Print)
Printable(std::function<void(raw_ostream&)> Print)
Declared at: llvm/include/llvm/Support/Printable.h:41
Parameters
- std::function<void(raw_ostream&)> Print