diff options
author | Naios <naios-dev@live.de> | 2015-07-21 20:23:21 +0200 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2015-07-22 01:59:50 +0200 |
commit | 4c0c6348144f0dc9de3e5aa97e0a5c43b164f443 (patch) | |
tree | dc172f69b4d7f217b3f4f51a38ffc7cc92a38c2e /src/server/shared/Utilities/Duration.h | |
parent | e2974746aed7cbcb6112ac7a1fa27137316d22e2 (diff) |
Core/Utilities: Seperate std::chrono::duration typedefs into its own file.
* add std::chrono_literals using decl. comment for future usage.
(cherry picked from commit 6e4a1b3e1e5a735f26284c560b1463cdd527b2fe)
Diffstat (limited to 'src/server/shared/Utilities/Duration.h')
-rw-r--r-- | src/server/shared/Utilities/Duration.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/server/shared/Utilities/Duration.h b/src/server/shared/Utilities/Duration.h new file mode 100644 index 00000000000..58a08e5842f --- /dev/null +++ b/src/server/shared/Utilities/Duration.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _DURATION_H_ +#define _DURATION_H_ + +#include <chrono> + +/// Milliseconds shorthand typedef. +typedef std::chrono::milliseconds Milliseconds; + +/// Seconds shorthand typedef. +typedef std::chrono::seconds Seconds; + +/// Minutes shorthand typedef. +typedef std::chrono::minutes Minutes; + +/// Hours shorthand typedef. +typedef std::chrono::hours Hours; + +/// Makes std::chrono_literals globally available. +// ToDo: Enable this when TC supports C++14. +// using namespace std::chrono_literals; + +#endif // _DURATION_H_ |