unity-dev team mailing list archive
-
unity-dev team
-
Mailing list archive
-
Message #00185
Re: [Ayatana-dev] C++0x in unity - call for objections
- To: Ayatana Dev <ayatana-dev@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [Ayatana-dev] C++0x in unity - call for objections
- From: Sam Spilsbury <smspillaz@xxxxxxxxx>
- Date: Tue, 14 Jun 2011 16:37:22 +0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=xTILwLEsv/faPvrXzrhY35b9x9AfzlSwCm2ieZvbs6M=; b=C6EJKY2nu0BwPEDGdt/MylZ1Pn/tZECBpHx7iIhzVjD0V3KRkr1CaMiEO9Ow/aQQUN XD/A39TOD6vS6bHzNxUGAFOtSrJ24HNZd0D2ENG6tv3vwlFXm/O//HLz61Dk5yUi3+tk F5Rrlkcm9cLsWesTJLh5lenUMURRdM87t8aPA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=NgCYEWhZaXVlhCU2VLvK6uN+qm028j0kN3Nmon9lq5iG2SS9JmG/ExTyRe8qaU0mJ1 XaM66O0XWMToCBA8MHyzq6iEP2sCRAi3Tt+dtAZlnTouQRPHu+uSMEpuYl3J1KLAV6+j 5ggyLLcZojvedxxrKXZaUSmuWLVJA6eLsbvXk=
- In-reply-to: <1307976782.2399.31.camel@scar>
- List-archive: <http://lists.launchpad.net/ayatana-dev>
- List-help: <https://help.launchpad.net/ListHelp>
- List-id: <ayatana-dev.lists.launchpad.net>
- List-owner: <https://launchpad.net/~ayatana-dev>
- List-post: <mailto:ayatana-dev@lists.launchpad.net>
- List-subscribe: <https://launchpad.net/~ayatana-dev>
- List-unsubscribe: <https://launchpad.net/~ayatana-dev>
- References: <1307976782.2399.31.camel@scar>
On Mon, Jun 13, 2011 at 10:53 PM, Gordon Allott
<gord.allott@xxxxxxxxxxxxx> wrote:
> Hi all,
>
> So C++0x, the latest C++ standard is just about ready for final, and its
> damn sexy. G++ supports it with the -std=x++0x flag but before we go
> ahead and start putting crack in to unity, I'd like to hear reasons that
> we shouldn't start using C++0x stuff like lambda's in unity. speak now
> or I’m gonna add lambda's to everything I see.
>
> I don't expect all of you to have read the C++0x spec, but some
> highlights are:
>
> Type inference with the auto keyword, kind of like vala's var keyword,
> you can negate the need to strongly type a variable if you are not sure
> what a function is going to receive, dangerous, but useful with template
> programming.
>
>
>> auto some_strange_callable_type = boost::bind(&some_function, _2,
> _1, some_object);
>> auto other_variable = 5; "
>
>
A quick note on auto here:
The fact that we want to use auto isn't a licence to go crazy with it,
instead in the coding style guidelines we will have something like:
// Don't use it here
auto i = 16;
auto j = 16.0;
Only use it when you know very well what your're expecting:
std::list <unity::component::foo::bar::reallylongnamebaz> bazzes;
// Bad
std::list <unity::component::foo::bar::reallylongnamebaz>::iterator it =
bazzes.begin();
// Good!
auto it = bazzes.begin ()
>
> Thoughts, opinions? yay? nay? +1? -1?
> --
> Gordon Allott
> Canonical Ltd.
> 27 Floor, Millbank Tower
> London SW1P 4QP
> www.canonical.com
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ayatana-dev
> Post to : ayatana-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ayatana-dev
> More help : https://help.launchpad.net/ListHelp
>
>
--
Sam Spilsbury
References