Framework for adding more
Adding more functionality to primitive datatypes. As C++ grows old it need to be updated in a morden way.
We will be using namespace easycpp in our following documentation.
using namespace easycpp;
Tupple Methods
STL contains tupple but its not very easy to use.easycpp tupple adds more functionality and simplicity.
Header only Library. Clone is repo.
*String
*Int
*Double
- iostream
- string
- map
Tupple y = {50,70,"ram"};
Return Type should be set by the developer.
Possible return types are
long double for all double,float types
long for int,long types
std::string for strings and const char*
std::string x = y.get_value<std::string>(2); // x now contains "ram"
std::cout<< x;
//OR USE
// Non - Premitive class
String x = y.get_value<String>(2); // x now contains "ram"
x.debug();
You must give return type in getValue function. Argument is the position of array.
Return type void
Tupple y = {50,70,"ram"};
y.set_value(1,19); // now y = {50,19,"ram"}
It will change the value of exsisting index with new value. Type should be same. You must give return type in getValue function. Argument is the position of array and the new value.
Return type is size_t
Tupple y = {50,70,"ram"};
size_t tupple_size = y.length();
std::cout << array_size; // Prints 3
Return type is void
Tupple y = {50,70,"ram"};
y.push("hello");
y.push(65.4);
// y = {50,70,"ram","hello",65.4}
Add an element at the end of the array.
Return type is void
Tupple y = {50,70,"ram"};
y.pop(0);
// y = {70,"ram"}
Add an element at the end of the array.
Return type is Array
Tupple y = {50,70,"ram"};
Tupple x = {36.1,12,"shyam"};
Tupple z = x + y;
// z = {50,70,"ram",36.1,12,"shyam"}
Add an element at the end of the array.
In process to create it UTF-8 support.
Return type is size_t
String y = "Hello World";
size_t length = y.length();
std::cout << length; // Prints 11