14 #include <boost/range/numeric.hpp>
15 #include <boost/range/algorithm/copy.hpp>
16 #include <boost/range/algorithm/for_each.hpp>
17 #include <boost/shared_array.hpp>
24 template <
class Range,
bool Unicode>
28 using String =
typename Range::value_type;
29 using Char =
typename String::value_type;
31 static std::size_t add_size(std::size_t size,
const String&
s)
33 return size +
s.size() + 1u;
40 copy(Char* it) : it_(it) {}
42 void operator()(
const String&
s)
52 : size_(
boost::accumulate(envs, 0, add_size) + 1),
55 boost::for_each(envs,
copy(env_.get()));
59 template <
class WindowsExecutor>
65 e.creation_flags |= CREATE_UNICODE_ENVIRONMENT;
71 boost::shared_array<Char> env_;
74 #if defined(_UNICODE) || defined(UNICODE)
75 template <
class Range>
76 set_env_<Range, true>
set_env(
const Range& envs)
78 return set_env_<Range, true>(envs);
81 template <
class Range>