Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78976492
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
Sat, Aug 24, 02:16
Size
343 B
Mime Type
text/x-c++
Expires
Mon, Aug 26, 02:16 (2 d)
Engine
blob
Format
Raw Data
Handle
20130464
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