mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Clang-format tests, examples, libraries, benchmarks, etc.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
3252ecc7a4
commit
46e9cdb7fe
@@ -1,24 +1,20 @@
|
||||
|
||||
// A Scalar with internal representation T+1 so that zero is internally
|
||||
// represented by T(1). This is used to test memory fill.
|
||||
//
|
||||
//
|
||||
#pragma once
|
||||
template<typename T>
|
||||
template <typename T>
|
||||
class OffByOneScalar {
|
||||
public:
|
||||
OffByOneScalar() : val_(1) {}
|
||||
OffByOneScalar(const OffByOneScalar& other) = default;
|
||||
OffByOneScalar& operator=(const OffByOneScalar& other) = default;
|
||||
|
||||
|
||||
OffByOneScalar(T val) : val_(val + 1) {}
|
||||
OffByOneScalar& operator=(T val) {
|
||||
val_ = val + 1;
|
||||
}
|
||||
|
||||
operator T() const {
|
||||
return val_ - 1;
|
||||
}
|
||||
|
||||
OffByOneScalar& operator=(T val) { val_ = val + 1; }
|
||||
|
||||
operator T() const { return val_ - 1; }
|
||||
|
||||
private:
|
||||
T val_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user