Re: Glib::ustring move constructor and C++11 features



Can I use std::u16string, std::u32string or std::string (with u8 string
literals) with gettext and get perfect UTF-8 i18n-alized strings just
like I would get by using Glib::ustring and gettext (including
glibmm/i18n.h in source files and mark string with _("...") macro)?

If I can, there's one problem left: is it possible/fast enough/easy
enough to convert the strings to Glib::ustring every time I need to pass
them to the GUI (i.e. every time my data changes and I need to update
the GUI, or the GUI gets rendered for a GUI specific reason, i.e. a
window being hidden and then shown again)?

I'll happily use C++11 strings, but it may be easier to use
Glib::ustring directly, instead of converting strings (I don't really
gain much from the move constructor, it's just a little speed gain when
reading the document data from file and writing into the C++ objects
representing the document data. It's more a design issue: write the code
so that later later I'll need minimal changes to adapt to new features.
And get the move constuctor benefits (and other C++11 features) without
effort)

Anatoly Krasner

P.S. I want to handle all languages, using gettext. But how did you know
my local language is hebrew? Hmmm... *thinking: where did I mention my
nationality/language? Oh, probably while registering to the mailing
list*

On ×', 2013-02-13 at 10:03 -0500, Doesnt Stop wrote:
> you could use std::u16string or std::u32string instead of
> Glib::ustring; they would handle hebrew, no problem. Take advantage of
> C++11 new features!
>  
> 
>  
> 
> > ----- Original Message -----
> > 
> > From: tombackton gmail com
> > 
> > Sent: 02/12/13 01:13 PM
> > 
> > To: gtkmm-list gnome org
> > 
> > Subject: Glib::ustring move constructor and C++11 features
> > 
> >  
> > Hi everybody, 
> > 
> > I've been writing an application which loads a possibly long 
> > Glib::ustring from a file and stores it as a data member of a c++ class 
> > I wrote. I wanted to use a move-constructor to pass that string to the 
> > class constructor by rvlaue reference, but Glibmm doesn't use C++11 
> > features. 
> > 
> > Are glibmm and gtkmm going to use C++11 features? I mean, should I write 
> > my code while assuming I should expect glibmm and gtkmm to offer move 
> > constructors and other useful C++11 features (e.g. std::shared_ptr) in 
> > the near future? 
> > 
> > Anatoly Krasner 
> > 
> > _______________________________________________ 
> > gtkmm-list mailing list 
> > gtkmm-list gnome org 
> > https://mail.gnome.org/mailman/listinfo/gtkmm-list
> 
>  
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]