- matrix();
- ~matrix();
- matrix(const matrix & other);
- const matrix & operator=(const matrix & other);
-protected:
- void copy(const matrix & other);
- void destroy(bool call_parent);
+ matrix_init(It i) : iter(i) {}
+
+ matrix_init<T, It> operator,(const T & x)
+ {
+ *iter = x;
+ return matrix_init<T, It>(++iter);
+ }
+
+ // The following specializations produce much tighter code than the
+ // general case above
+
+ matrix_init<T, It> operator,(int x)
+ {
+ *iter = T(x);
+ return matrix_init<T, It>(++iter);
+ }
+
+ matrix_init<T, It> operator,(unsigned int x)
+ {
+ *iter = T(x);
+ return matrix_init<T, It>(++iter);
+ }
+
+ matrix_init<T, It> operator,(long x)
+ {
+ *iter = T(x);
+ return matrix_init<T, It>(++iter);
+ }
+
+ matrix_init<T, It> operator,(unsigned long x)
+ {
+ *iter = T(x);
+ return matrix_init<T, It>(++iter);
+ }
+
+ matrix_init<T, It> operator,(double x)
+ {
+ *iter = T(x);
+ return matrix_init<T, It>(++iter);
+ }
+
+ matrix_init<T, It> operator,(const symbol & x)
+ {
+ *iter = T(x);
+ return matrix_init<T, It>(++iter);
+ }
+
+private:
+ matrix_init();
+ It iter;
+};
+