C++: Is it okay to use decltype to copy types from my header files?

Viewed 376

I want to reduce the amount of maintenance I have to do to my code when things change.

In a certain header file I have something long and kind of verbose like this:

extern std::map<event_t, std::multimap<real_t, event>> event_schedule;

Then, in a cpp file, I thought it would be easier to actually declare it like so;

decltype(event_schedule) event_schedule;

Is there any reason not to?

1 Answers
Related