Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122047545
myvector_template_dim.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jul 15, 11:42
Size
343 B
Mime Type
text/x-c++
Expires
Thu, Jul 17, 11:42 (2 d)
Engine
blob
Format
Raw Data
Handle
27427538
Attached To
R9360 PCSC_git
myvector_template_dim.hh
View Options
// a generic Vector for any scalar type
// template dimension (default: 3)
template <typename T, int dim = 3> class MyVector {
public:
T &operator[](unsigned int d) { return value[d]; }
const T &operator[](unsigned int d) const { return value[d]; }
private:
T value[dim];
};
MyVector<double> vector_3d;
MyVector<double, 2> vector_2d;
Event Timeline
Log In to Comment