mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
WIP
This commit is contained in:
@ -31,7 +31,6 @@ template <class T, class Allocator = std::allocator<T>> class Result {
|
||||
Result() = default;
|
||||
Result(std::initializer_list<T> list) : vec(list){};
|
||||
|
||||
|
||||
/** Custom constructor from integer type to Result<ns> or Result<bool> */
|
||||
template <typename V, typename = typename std::enable_if<
|
||||
std::is_integral<V>::value &&
|
||||
@ -98,9 +97,14 @@ template <class T, class Allocator = std::allocator<T>> class Result {
|
||||
vec.push_back(std::forward<V>(value));
|
||||
}
|
||||
|
||||
/** Disable emplace_back if the underlying vector does not support it
|
||||
* vector<bool> gcc 4.8
|
||||
*/
|
||||
template <typename... Args>
|
||||
auto emplace_back(Args &&... args) -> decltype(vec.emplace_back(args...)){
|
||||
vec.emplace_back(std::forward<Args>(args)...);
|
||||
auto emplace_back(Args &&... args) ->
|
||||
typename std::enable_if<has_emplace_back<std::vector<T>>::value,
|
||||
decltype(vec.emplace_back(args...))>::type {
|
||||
return vec.emplace_back(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
auto operator[](size_type pos) -> decltype(vec[pos]) { return vec[pos]; }
|
||||
|
Reference in New Issue
Block a user