Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

intelligent_cast

A simple c++11 type converter between string and numeric value.

Basic usage

#include "IntelligentCast.h"

// convert to string from integer  
std::string string_from_int = intelligent_cast<std::string>(100);

// convert to integer from string
int int_from_char = intelligent_cast<int>("100");

// convert to wchar from char
std::wstring wstring_from_string  = intelligent_cast<std::wstring>("test");

All of a combination of the two from below is possible.

char unsigned char float
int unsigned int double
short unsigned short std::string
long unsigned long std::wstring
long long unsigned long long -

Advance usage

Including "OperatorOverloadExtension.h", a combination of operator+ of several types is available.

such as:

#include "IntelligentCast.h"
#include "OperatorOverloadExtension.h"

//  std::string + integer
std::string str="results are ";
std::string converted = str + 10 + " and " + 5.5;
// converted should be "results are 10 and 5.5"

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages