aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/winapi
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/winapi/handle.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/winapi/handle.hpp b/include/winapi/handle.hpp
index 5f813bc..f6f4c11 100644
--- a/include/winapi/handle.hpp
+++ b/include/winapi/handle.hpp
@@ -13,6 +13,7 @@
#include <cstddef>
#include <memory>
+#include <string>
#include <utility>
namespace winapi {
@@ -46,6 +47,11 @@ public:
void write(const void*, std::size_t nb) const;
void write(const Buffer& buffer) const;
+ template <typename CharT>
+ void write(const std::basic_string<CharT>& src) const {
+ write(src.c_str(), src.size() * sizeof(CharT));
+ }
+
void inherit(bool yes = true) const;
void dont_inherit() const { inherit(false); }