Re: [Boost-bugs] [Boost C++ Libraries] #3264: open config file

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3264: open config file
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-11-02 08:56:39

#3264: open config file
 Reporter: Diederick C. Niehorster <dcnieho@…> | Owner: vladimir_prus
     Type: Feature Requests | Status: new
Milestone: Boost 1.40.0 | Component: program_options
  Version: Boost 1.39.0 | Severity: Optimization
 Keywords: |
Changes (by s.ochsenknecht@…):

 * cc: s.ochsenknecht@… (added)


 I see one problem here. How to determine if a ifstream or a wifstream
 should be used? Both take (const char*) as type for the file name.

 One Solution could be:
 We can implement a template with a basic_string<char> and
 basic_string<wchar_t> instantiation for the file name. So, if the file
 name comes with a basic_string<wchar_t> then we use wifstream, the file
 name has to be converted to (const char* ).
 parse_config_file(const std::basic_string<charT>&, ...);

 Another solution could be:
 The function takes const char* parameter for file name which is directly
 passed to ifstream/wifstream:
 parse_config_file(const char*, ...);
 But how the user can choose now between ifstream and wifstream?

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC