-
Notifications
You must be signed in to change notification settings - Fork 0
Utils
Zome edited this page Dec 3, 2021
·
1 revision
Struct that holds a boolean value. True for the following types: bool, char, int, short int, long int, long int, long long int, unsigned int, unsigned short int, unsigned long int, unsigned long long int, char, signed char, unsigned char and wchar_t. False for anything else.
typename ft::enable_if< !ft::is_integral<InputIterator>::value, InputIterator>::type* = nullptr i don’t really understand this
std::pair <std::string,double> product ("tomatoes",2.30); product.first = "shoes"; // the type of first is string product.second = 39.90; // the type of second is double std::cout << "The price of " << product1.first << " is $" << product1.second << '\n';
ft::equal(first1, last1, first2) Checks if every element iterating from first1 to last1 is equal to the elements iterating from first2
bool is_palindrome(const std::string& s) { return ft::equal(s.begin(), s.begin() + s.size()/2, s.rbegin()); }
char foo[]="Apple"; char bar[]="apartment"; std::cout << std::lexicographical_compare(foo,foo+5,bar,bar+9);