I would like to use this:
std::dequeboost::posix_time::time_period
But std::deque depends on (as does some of my other code) it's type having
a default constructor. I'm surprised it does not already exists.
An implementation that seems to work for me is trivial, although I'm not
sure it will work for everyone?
My changes to 'boost/date_time_time_period.hpp' follow. I have guarded
them with DATE_TIME_NO_DEFAULT_CONSTRUCTOR and simply set begin to
point_type() and end to begin_ -1;
Is this a change worth an eventual release?
Thanks,
SB
--- a/period.hpp 2015-04-29 15:13:28.040930833 -0700
+++ b/period.hpp 2015-04-29 15:15:01.201392793 -0700
@@ -57,6 +57,9 @@
typedef point_rep point_type;
typedef duration_rep duration_type;
+#if !defined(DATE_TIME_NO_DEFAULT_CONSTRUCTOR)
+ period();
+#endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR
period(point_rep first_point, point_rep end_point);
period(point_rep first_point, duration_rep len);
point_rep begin() const;
@@ -82,6 +85,16 @@
point_rep last_;
};
+#if !defined(DATE_TIME_NO_DEFAULT_CONSTRUCTOR)
+ //! default constructor
+ template