Ignore:
Timestamp:
Apr 15, 2017, 7:09:59 PM (4 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
c57d1935
Parents:
308880c
Message:

Minor cleanup, also filled in benchmark source appendix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cpp-print.hpp

    r308880c ra381b46  
    11#pragma once
    2 
    32#include <iomanip>
    43#include <iostream>
    54#include <utility>
    65
    7 template<typename T>
    8 void print(std::ostream& out, const T& x) { out << x; }
     6template<typename T> void print(std::ostream& out, const T& x) { out << x; }
    97
    10 template<>
    11 void print<bool>(std::ostream& out, const bool& x) { out << (x ? "true" : "false"); }
     8template<> void print<bool>(std::ostream& out, const bool& x) { out << (x ? "true" : "false"); }
    129
    13 template<>
    14 void print<char>(std::ostream& out, const char& x ) {
     10template<> void print<char>(std::ostream& out, const char& x ) {
    1511        if ( 0x20 <= x && x <= 0x7E ) { out << "'" << x << "'"; }
    1612        else { out << "'\\" << std::hex << (unsigned int)x << std::setbase(0) << "'"; }
    1713}
    1814
    19 template<typename R, typename S>
     15template<typename R, typename S> 
    2016std::ostream& operator<< (std::ostream& out, const std::pair<R, S>& x) {
    2117        out << "[";
     
    2622}
    2723
    28 template<typename T, typename... Args>
     24template<typename T, typename... Args> 
    2925void print(std::ostream& out, const T& arg, const Args&... rest) {
    3026        out << arg;
Note: See TracChangeset for help on using the changeset viewer.