16 #include <boost/range/algorithm/copy.hpp>
17 #include <boost/range/algorithm/for_each.hpp>
18 #include <boost/range/numeric.hpp>
19 #include <boost/shared_array.hpp>
26 template <
class Range,
bool Unicode>
30 using String =
typename Range::value_type;
31 using Char =
typename String::value_type;
34 add_size(std::size_t size,
const String&
s)
36 return size +
s.size() + 1u;
43 copy(Char* it) : it_(it)
48 operator()(
const String&
s)
58 size_(
boost::accumulate(envs, 0, add_size) + 1), env_(new Char[size_])
60 boost::for_each(envs,
copy(env_.get()));
64 template <
class WindowsExecutor>
71 e.creation_flags |= CREATE_UNICODE_ENVIRONMENT;
77 boost::shared_array<Char> env_;
80 #if defined(_UNICODE) || defined(UNICODE)
81 template <
class Range>
85 return set_env_<Range, true>(envs);
88 template <
class Range>
89 set_env_<Range, false>