LIPH's C++ Codes
print.h File Reference
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <string_view>
#include <unordered_map>
#include <utility>
#include <vector>
#include "liph/format.h"

Go to the source code of this file.

Namespaces

namespace  liph
 

Concepts

concept  liph::Printable
 

Macros

#define __FILENAME__   ((strrchr(__FILE__, '/') ?: __FILE__ - 1) + 1)
 
#define SOURCE_LOCATION_FORMAT   liph::format("[{}:{}]", __FILENAME__, __LINE__)
 
#define PRINT(...)   liph::print(SOURCE_LOCATION_FORMAT, __VA_ARGS__)
 
#define DEBUG(x)   liph::print(SOURCE_LOCATION_FORMAT, #x, "=", x)
 
#define TRACE(x)
 

Functions

template<class T1 , class T2 >
std::ostream & liph::operator<< (std::ostream &o, const std::pair< T1, T2 > &p)
 
std::ostream & liph::operator<< (std::ostream &o, const std::vector< bool > &vb)
 
std::ostream & liph::operator<< (std::ostream &o, const char *s)
 
std::ostream & liph::operator<< (std::ostream &o, const std::string &s)
 
std::ostream & liph::operator<< (std::ostream &o, std::string_view s)
 
template<std::ranges::input_range Range>
std::ostream & liph::operator<< (std::ostream &o, const Range &range)
 
template<class K , class V >
std::ostream & liph::operator<< (std::ostream &o, const std::map< K, V > &map)
 
template<class K , class V >
std::ostream & liph::operator<< (std::ostream &o, const std::unordered_map< K, V > &map)
 
void liph::println ()
 
void liph::print (bool b)
 
template<Printable T>
void liph::print (T &&t)
 
template<Printable T, Printable... Args>
void liph::print (T &&head, Args &&...args)
 
template<Printable... Args>
void liph::print (bool head, Args &&...args)
 

Macro Definition Documentation

◆ __FILENAME__

#define __FILENAME__   ((strrchr(__FILE__, '/') ?: __FILE__ - 1) + 1)

◆ DEBUG

#define DEBUG (   x)    liph::print(SOURCE_LOCATION_FORMAT, #x, "=", x)

◆ PRINT

#define PRINT (   ...)    liph::print(SOURCE_LOCATION_FORMAT, __VA_ARGS__)

◆ SOURCE_LOCATION_FORMAT

#define SOURCE_LOCATION_FORMAT   liph::format("[{}:{}]", __FILENAME__, __LINE__)

◆ TRACE

#define TRACE (   x)
Value:
x
void print(bool b)
Definition: print.h:72
#define SOURCE_LOCATION_FORMAT
Definition: print.h:100