diff options
Diffstat (limited to 'include/LibNectar/utility.h')
| -rw-r--r-- | include/LibNectar/utility.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/LibNectar/utility.h b/include/LibNectar/utility.h new file mode 100644 index 0000000..834b1a6 --- /dev/null +++ b/include/LibNectar/utility.h @@ -0,0 +1,27 @@ +// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (See accompanying +// file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0) +// Official repository: https://github.com/nekernel-org/nectar + +#ifndef LIBNECTAR_UTILITY_H +#define LIBNECTAR_UTILITY_H + +/// @brief Forward object. +/// @tparam Args the object type. +/// @param arg the object. +/// @return object's rvalue +template <typename Args> +inline auto forward(Args& arg) -> Args&& { + return static_cast<const Args&&>(arg); +} + +/// @brief Move object. +/// @tparam Args the object type. +/// @param arg the object. +/// @return object's rvalue +template <typename Args> +inline auto move(Args&& arg) -> Args&& { + return static_cast<Args&&>(arg); +} + +#endif // LIBNECTAR_UTILITY_H |
