Different return types with same function
I prefer something like this, as its less to type and compile-time, you probably always know what kind of time you need on compile-time and even if not you can hack around that problem, so:

template&lt;TimeUnit time&gt;
struct TimeUnitImpl
{ using type = decltype(m_milliseconds); };

template&lt;&gt;
struct TimeUnitImpl&lt;Seconds&gt;
{ using type = decltype(m_seconds); };

template&lt;&gt;
struct TimeUnitImpl&lt;Minutes&gt;
{ using type = decltype(m_minutes); };

template&lt;&gt;
struct TimeUnitImpl&lt;Hours&gt;
{ using type = decltype(m_hours); };

template&lt;&gt;
struct TimeUnitImpl&lt;Days&gt;
{ using type = decltype(m_days); };

// used member function
template &lt;TimeUnit unit = Seconds&gt;
typename TimeUnitImpl&lt;unit&gt;::type getTime()
{
    switch (unit)
    {
    case Milliseconds: return m_milliseconds;
    case Seconds: return m_seconds;
    case Minutes: return m_minutes;
    case Hours: return m_hours;
    case Days: return m_days;
    default:
        break;
    }
}


In order to fetch a specific time unit you would have to use something like this: 

getTime&lt;Time::Milliseconds&gt;()


Try it online!

In order to keep a "good style" I would change the function name here, too. Probably simply to time rather than getTime, that get-prefix is pretty much useless here.

But anyways, you might consider just using getTimeMilliseconds or something like that.