diff options
author | Igor Murashkin <iam@google.com> | 2015-01-26 10:55:53 -0800 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2015-02-04 13:29:19 -0800 |
commit | aaebaa0121be3b9d9f13630585304482cbcaeb4b (patch) | |
tree | 0f47257e497fdf920c8d703d2d00adab53934a76 /runtime/utils.h | |
parent | babecc483276b46d84cb83d4f01e577228827305 (diff) | |
download | art-aaebaa0121be3b9d9f13630585304482cbcaeb4b.tar.gz art-aaebaa0121be3b9d9f13630585304482cbcaeb4b.tar.bz2 art-aaebaa0121be3b9d9f13630585304482cbcaeb4b.zip |
art: Refactor RuntimeOptions/ParsedOptions
Refactor the RuntimeOptions to be a
type-safe map (VariantMap, see runtime_options.h) and the ParsedOptions
to delegate the parsing to CmdlineParser (see cmdline/cmdline_parser.h).
This is the start of a command line parsing refactor, and may include
more in the future (dex2oat, patchoat, etc).
For more details of the command line parsing generator usage see cmdline/README.md
Change-Id: Ic67c6bca5e1f33bf2ec60e2e3ff8c366bab91563
Diffstat (limited to 'runtime/utils.h')
-rw-r--r-- | runtime/utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/utils.h b/runtime/utils.h index b5413e75b6..1c2576c2d4 100644 --- a/runtime/utils.h +++ b/runtime/utils.h @@ -549,6 +549,13 @@ struct FreeDelete { template <typename T> using UniqueCPtr = std::unique_ptr<T, FreeDelete>; +// C++14 from-the-future import (std::make_unique) +// Invoke the constructor of 'T' with the provided args, and wrap the result in a unique ptr. +template <typename T, typename ... Args> +std::unique_ptr<T> MakeUnique(Args&& ... args) { + return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); +} + } // namespace art #endif // ART_RUNTIME_UTILS_H_ |