add tests for vector assign iterator, and tests script
This commit is contained in:
@@ -3,18 +3,6 @@
|
||||
|
||||
namespace ft {
|
||||
|
||||
//struct true_type {
|
||||
// typedef bool value_type;
|
||||
// typedef true_type type;
|
||||
// static const bool value = true;
|
||||
//};
|
||||
//
|
||||
//struct false_type {
|
||||
// typedef T value_type;
|
||||
// typedef false_type type;
|
||||
// static const bool value = false;
|
||||
//};
|
||||
|
||||
template <class T> struct is_integral
|
||||
{
|
||||
typedef char yes[1];
|
||||
@@ -39,51 +27,6 @@ template <class T> struct is_integral
|
||||
static yes& test(unsigned long int);
|
||||
static yes& test(unsigned long long int);
|
||||
|
||||
/*
|
||||
static yes& test(const bool);
|
||||
static yes& test(const char);
|
||||
static yes& test(const wchar_t);
|
||||
static yes& test(const signed char);
|
||||
static yes& test(const short int);
|
||||
static yes& test(const int);
|
||||
static yes& test(const long int);
|
||||
static yes& test(const long long int);
|
||||
static yes& test(const unsigned char);
|
||||
static yes& test(const unsigned short int);
|
||||
static yes& test(const unsigned int);
|
||||
static yes& test(const unsigned long int);
|
||||
static yes& test(const unsigned long long int);
|
||||
|
||||
static yes& test(volatile bool);
|
||||
static yes& test(volatile char);
|
||||
static yes& test(volatile wchar_t);
|
||||
static yes& test(volatile signed char);
|
||||
static yes& test(volatile short int);
|
||||
static yes& test(volatile int);
|
||||
static yes& test(volatile long int);
|
||||
static yes& test(volatile long long int);
|
||||
static yes& test(volatile unsigned char);
|
||||
static yes& test(volatile unsigned short int);
|
||||
static yes& test(volatile unsigned int);
|
||||
static yes& test(volatile unsigned long int);
|
||||
static yes& test(volatile unsigned long long int);
|
||||
|
||||
static yes& test(const volatile bool);
|
||||
static yes& test(const volatile char);
|
||||
static yes& test(const volatile wchar_t);
|
||||
static yes& test(const volatile signed char);
|
||||
static yes& test(const volatile short int);
|
||||
static yes& test(const volatile int);
|
||||
static yes& test(const volatile long int);
|
||||
static yes& test(const volatile long long int);
|
||||
static yes& test(const volatile unsigned char);
|
||||
static yes& test(const volatile unsigned short int);
|
||||
static yes& test(const volatile unsigned int);
|
||||
static yes& test(const volatile unsigned long int);
|
||||
static yes& test(const volatile unsigned long long int);
|
||||
*/
|
||||
|
||||
|
||||
// non-template function with direct matching are always considered first
|
||||
// then the function template with direct matching are considered
|
||||
// https://stackoverflow.com/questions/12877546/how-do-i-avoid-implicit-conversions-on
|
||||
@@ -95,19 +38,6 @@ template <class T> struct is_integral
|
||||
} // namespace ft
|
||||
|
||||
// "template <>" introduce a total specialization of a template :
|
||||
//
|
||||
// template <typename T>
|
||||
// class A
|
||||
// {
|
||||
// // body for the general case
|
||||
// };
|
||||
//
|
||||
// template <>
|
||||
// class A<bool>
|
||||
// {
|
||||
// // body that only applies for T = bool
|
||||
// };
|
||||
//
|
||||
// https://stackoverflow.com/questions/6288812/what-is-the-meaning-of-template-with-empty-angle-brackets-in-c
|
||||
|
||||
// SFINAE : https://jguegant.github.io/blogs/tech/sfinae-introduction.html
|
||||
|
||||
@@ -99,17 +99,11 @@ public:
|
||||
template <class InputIterator>
|
||||
typename enable_if< !is_integral<InputIterator>::value,void >::type
|
||||
assign(InputIterator first, InputIterator last);
|
||||
// template <class InputIterator>
|
||||
// void assign(InputIterator first, InputIterator last
|
||||
// typename enable_if< !is_integral<InputIterator>::value, bool >::type == true);
|
||||
// template <class InputIterator>
|
||||
// typename enable_if< is_integral<InputIterator>::value,void >::type
|
||||
// assign(size_type n, const value_type& val);
|
||||
void assign(size_type n, const value_type& val);
|
||||
// push_back ---------------------------------
|
||||
void push_back(const value_type & val);
|
||||
// pop_back ----------------------------------
|
||||
//void pop_back();
|
||||
void pop_back();
|
||||
// insert ------------------------------------
|
||||
//iterator insert(iterator position, const value_type& val);
|
||||
//void insert(iterator position, size_type n, const value_type& val);
|
||||
|
||||
Reference in New Issue
Block a user