From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15779 invoked by alias); 15 Aug 2014 20:36:58 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 15767 invoked by uid 89); 15 Aug 2014 20:36:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailout12.t-online.de Received: from mailout12.t-online.de (HELO mailout12.t-online.de) (194.25.134.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 15 Aug 2014 20:36:55 +0000 Received: from fwd41.aul.t-online.de (fwd41.aul.t-online.de [172.20.27.139]) by mailout12.t-online.de (Postfix) with SMTP id 451A44BD989; Fri, 15 Aug 2014 22:36:52 +0200 (CEST) Received: from [192.168.0.103] (XjgVrTZQrhnnVYymiEFkzals71lUkWGrQIIAeOc-Oga1utxEhgN2I99Zt-f4XpmglR@[93.195.19.145]) by fwd41.t-online.de with (TLSv1:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1XIOF1-2JzZpI0; Fri, 15 Aug 2014 22:36:51 +0200 Message-ID: <1408135010.10959.8.camel@yam-132-YW-E178-FTW> Subject: Re: wifstream From: Oleg Endo To: ArbolOne Cc: gcc-help@gcc.gnu.org Date: Fri, 15 Aug 2014 20:36:00 -0000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00112.txt.bz2 On Fri, 2014-08-15 at 15:40 -0400, ArbolOne wrote: > I see, VC has it's own way of doing things, thank you for advice. One > more question, where can I have reference to standard library? http://en.cppreference.com is usually a good place to start. > > On 15/08/2014 11:54 AM, Jonathan Wakely wrote: > > On 15 August 2014 16:49, ArbolOne wrote: > >> In my Windows 7 this code doesn't work: > >> std::wstring& getFileName() { > >> return file_name; > >> } > >> myMethod(){ > >> wchar_t tmp = *getFileName().c_str() ; > >> std::wifstream infile( tmp ); // <<-- error: invalid conversion > >> from 'wchar_t' to 'const char*' [-fpermissive] > >> return infile.good( ); > >> } > >> > >> > >> It seems to me that std::wifstream does not accept wchar_t as a value > >> type, but only const char*, contrary to to what is explained in > >> http://msdn.microsoft.com/en-us/library/3b5w4311.aspx > > That is describing the MS library, it's not the standard. > > > >> Where did I go wrong? or, is this a bug? > > No, the standard says that basic_fstream always takes narrow character > > strings to specify the filename, even if the stream itself uses wide > > characters. >