struct tm get_timeinfo(){ struct tm timeinfo; .... return timeinfo; } struct tm timeinfo = std::move(get_timeinfo());