tmp
This commit is contained in:
parent
8b294f61d6
commit
2ce5da95b0
@ -145,7 +145,7 @@ namespace gctl
|
|||||||
*
|
*
|
||||||
* @param init_val Initial values
|
* @param init_val Initial values
|
||||||
*/
|
*/
|
||||||
array(std::initializer_list<ArrValType> init_val);
|
array(std::vector<ArrValType> init_val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Construct a new array object as a sequence
|
* @brief Construct a new array object as a sequence
|
||||||
@ -394,7 +394,7 @@ namespace gctl
|
|||||||
*
|
*
|
||||||
* @param init_val Initial values
|
* @param init_val Initial values
|
||||||
*/
|
*/
|
||||||
void resize(std::initializer_list<ArrValType> init_val);
|
void resize(std::vector<ArrValType> init_val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Resize a new array object as a sequence
|
* @brief Resize a new array object as a sequence
|
||||||
@ -894,7 +894,7 @@ namespace gctl
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename ArrValType>
|
template <typename ArrValType>
|
||||||
array<ArrValType>::array(std::initializer_list<ArrValType> init_val)
|
array<ArrValType>::array(std::vector<ArrValType> init_val)
|
||||||
{
|
{
|
||||||
length_ = 0;
|
length_ = 0;
|
||||||
val_ = nullptr;
|
val_ = nullptr;
|
||||||
@ -1244,15 +1244,12 @@ namespace gctl
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename ArrValType>
|
template <typename ArrValType>
|
||||||
void array<ArrValType>::resize(std::initializer_list<ArrValType> init_val)
|
void array<ArrValType>::resize(std::vector<ArrValType> init_val)
|
||||||
{
|
{
|
||||||
resize(init_val.size());
|
resize(init_val.size());
|
||||||
|
|
||||||
typename std::initializer_list<ArrValType>::iterator iter = init_val.begin();
|
|
||||||
for (size_t i = 0; i < length_; i++)
|
for (size_t i = 0; i < length_; i++)
|
||||||
{
|
{
|
||||||
val_[i] = *iter;
|
val_[i] = init_val[i];
|
||||||
iter++;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
runtime_error() : std::runtime_error("GCTL: Unexpected runtime error."){}
|
runtime_error() : std::runtime_error("GCTL: Unexpected runtime error."){}
|
||||||
runtime_error(std::string estr) : std::runtime_error(("GCTL: Unexpected runtime error. "+estr).c_str()){}
|
runtime_error(std::string estr) : std::runtime_error(("GCTL: Unexpected runtime error. "+estr).c_str()){}
|
||||||
virtual ~runtime_error(){}
|
//virtual ~runtime_error(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
class range_error : public std::range_error
|
class range_error : public std::range_error
|
||||||
@ -122,7 +122,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
range_error() : std::range_error("GCTL: Invalid range detected."){}
|
range_error() : std::range_error("GCTL: Invalid range detected."){}
|
||||||
range_error(std::string estr) : std::range_error(("GCTL: Invalid range detected. "+estr).c_str()){}
|
range_error(std::string estr) : std::range_error(("GCTL: Invalid range detected. "+estr).c_str()){}
|
||||||
virtual ~range_error(){}
|
//virtual ~range_error(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
class overflow_error : public std::overflow_error
|
class overflow_error : public std::overflow_error
|
||||||
@ -130,7 +130,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
overflow_error() : std::overflow_error("GCTL: Overflow error."){}
|
overflow_error() : std::overflow_error("GCTL: Overflow error."){}
|
||||||
overflow_error(std::string estr) : std::overflow_error(("GCTL: Overflow error. "+estr).c_str()){}
|
overflow_error(std::string estr) : std::overflow_error(("GCTL: Overflow error. "+estr).c_str()){}
|
||||||
virtual ~overflow_error(){}
|
//virtual ~overflow_error(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
class underflow_error : public std::underflow_error
|
class underflow_error : public std::underflow_error
|
||||||
@ -138,7 +138,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
underflow_error() : std::underflow_error("GCTL: Underflow error."){}
|
underflow_error() : std::underflow_error("GCTL: Underflow error."){}
|
||||||
underflow_error(std::string estr) : std::underflow_error(("GCTL: Underflow error. "+estr).c_str()){}
|
underflow_error(std::string estr) : std::underflow_error(("GCTL: Underflow error. "+estr).c_str()){}
|
||||||
virtual ~underflow_error(){}
|
//virtual ~underflow_error(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
logic_error() : std::logic_error("GCTL: Logic error."){}
|
logic_error() : std::logic_error("GCTL: Logic error."){}
|
||||||
logic_error(std::string estr) : std::logic_error(("GCTL: Logic error. "+estr).c_str()){}
|
logic_error(std::string estr) : std::logic_error(("GCTL: Logic error. "+estr).c_str()){}
|
||||||
virtual ~logic_error(){}
|
//virtual ~logic_error(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
class domain_error : public std::domain_error
|
class domain_error : public std::domain_error
|
||||||
@ -155,7 +155,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
domain_error() : std::domain_error("GCTL: Domain error."){}
|
domain_error() : std::domain_error("GCTL: Domain error."){}
|
||||||
domain_error(std::string estr) : std::domain_error(("GCTL: Domain error. "+estr).c_str()){}
|
domain_error(std::string estr) : std::domain_error(("GCTL: Domain error. "+estr).c_str()){}
|
||||||
virtual ~domain_error(){}
|
//virtual ~domain_error(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
class invalid_argument : public std::invalid_argument
|
class invalid_argument : public std::invalid_argument
|
||||||
@ -163,7 +163,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
invalid_argument() : std::invalid_argument("GCTL: Invalid argument."){}
|
invalid_argument() : std::invalid_argument("GCTL: Invalid argument."){}
|
||||||
invalid_argument(std::string estr) : std::invalid_argument(("GCTL: Invalid argument. "+estr).c_str()){}
|
invalid_argument(std::string estr) : std::invalid_argument(("GCTL: Invalid argument. "+estr).c_str()){}
|
||||||
virtual ~invalid_argument(){}
|
//virtual ~invalid_argument(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
class length_error : public std::length_error
|
class length_error : public std::length_error
|
||||||
@ -171,7 +171,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
length_error() : std::length_error("GCTL: Length error."){}
|
length_error() : std::length_error("GCTL: Length error."){}
|
||||||
length_error(std::string estr) : std::length_error(("GCTL: Length error. "+estr).c_str()){}
|
length_error(std::string estr) : std::length_error(("GCTL: Length error. "+estr).c_str()){}
|
||||||
virtual ~length_error(){}
|
//virtual ~length_error(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
class out_of_range : public std::out_of_range
|
class out_of_range : public std::out_of_range
|
||||||
@ -179,7 +179,7 @@ namespace gctl
|
|||||||
public:
|
public:
|
||||||
out_of_range() : std::out_of_range("GCTL: Out of range."){}
|
out_of_range() : std::out_of_range("GCTL: Out of range."){}
|
||||||
out_of_range(std::string estr) : std::out_of_range(("GCTL: Out of range. "+estr).c_str()){}
|
out_of_range(std::string estr) : std::out_of_range(("GCTL: Out of range. "+estr).c_str()){}
|
||||||
virtual ~out_of_range(){}
|
//virtual ~out_of_range(){}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user