Skip to content
/ format Public

String interpolation. An example of using Parameter pack in C++.

License

Notifications You must be signed in to change notification settings

DronPop/format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

format

  • Introduction
  • Getting Started
    • Simple example using format
    • Basic Installation
  • Features
    • Advantages
    • Disadvantages

Introduction

This project is analogous to QString :: arg and other similar means of string interpolation. The key is the use of using C++ Parameter pack.

Getting Started

Simple example using format

std::string result = formated("int = %, double = %, std::string = %, const char * = %, bool = %",
                                     1,          3.14,            str,              "char*",  true);
//string = "int = 1, double = 3.140000, std::string = testString, const char * = char*, bool = 1".

Basic Installation

  1. git clone https://github.com/DronPop/format.git
  2. cd format/Example
  3. mkdir build
  4. cd build
  5. cmake .. -G "IDAName"
  6. open SolutionName

Features

Advantages

  • Strongly typed
  • Can be used with all standard types
  • Ability to use with custom types. For that overload operator<<(std::ostream& out_, const CustomClass& obj_);

Disadvantages

  • May be complile time.

About

String interpolation. An example of using Parameter pack in C++.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published