Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct TimedEvent {
- EventType_t event;
- std::chrono::duration<long double> timestamp;
- /* //adding this section makes it work
- template <class T, class U>
- TimedEvent(EventType_t && e, std::chrono::duration<T, U> && t) {
- event = std::move(e);
- timestamp = std::move(t);
- }
- */
- };
- std::vector<TimedEvent> timedEvents;
- auto t1 = TimedEvent{a1, std::chrono::seconds(1000)}; //works
- auto t2 = TimedEvent(a1, std::chrono::seconds(1000)); //doesn't compile without the added constructor
- //also doesn't work, probably for the same reason:
- //timedEvents.emplace_back(std::move(a1), std::chrono::seconds(1000)); //doesn't compile without the added constructor
Advertisement
Add Comment
Please, Sign In to add comment