Fix formatting
This commit is contained in:
parent
4c69a855a1
commit
548f19462a
1 changed files with 12 additions and 12 deletions
|
@ -244,21 +244,21 @@ template<class C> bool all_of(const C &container)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T> struct remove_cvref
|
||||||
struct remove_cvref
|
|
||||||
{
|
{
|
||||||
using type =
|
using type =
|
||||||
typename std::remove_cv<typename std::remove_reference<T>::type>::type;
|
typename std::remove_cv<typename std::remove_reference<T>::type>::type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T> using remove_cvref_t = typename remove_cvref<T>::type;
|
||||||
using remove_cvref_t = typename remove_cvref<T>::type;
|
|
||||||
|
|
||||||
template<template<class> class C, class T>
|
template<template<class> class C, class T>
|
||||||
class Container: public C<remove_cvref_t<T>> {
|
class Container : public C<remove_cvref_t<T>>
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
explicit Container(size_t count, T&& initval):
|
explicit Container(size_t count, T &&initval)
|
||||||
C<remove_cvref_t<T>>(count, initval) {}
|
: C<remove_cvref_t<T>>(count, initval)
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T> using DefaultContainer = std::vector<T>;
|
template<class T> using DefaultContainer = std::vector<T>;
|
||||||
|
@ -268,8 +268,8 @@ template<class T, class I, template<class> class C = DefaultContainer>
|
||||||
inline C<remove_cvref_t<T>> linspace(const T &start, const T &stop, const I &n)
|
inline C<remove_cvref_t<T>> linspace(const T &start, const T &stop, const I &n)
|
||||||
{
|
{
|
||||||
Container<C, T> vals(n, T());
|
Container<C, T> vals(n, T());
|
||||||
T stride = (stop - start) / n;
|
|
||||||
|
|
||||||
|
T stride = (stop - start) / n;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
std::generate(vals.begin(), vals.end(), [&i, start, stride] {
|
std::generate(vals.begin(), vals.end(), [&i, start, stride] {
|
||||||
return start + i++ * stride;
|
return start + i++ * stride;
|
||||||
|
|
Loading…
Add table
Reference in a new issue