Re: Using c++11 right angle bracket in template code?

2014-10-06 Thread Neil
Ehsan Akhgari wrote: The usage of the iterator object which can also store state allows you to check for that exact pattern, so arguably you won't lose anything using range-based for loops if we added a good iterator implementation to nsTArray that checks for mutations. If you need to check

Re: Using c++11 right angle bracket in template code?

2014-10-06 Thread Ehsan Akhgari
On 2014-10-06, 11:20 AM, Trevor Saunders wrote: Hence, I suggest for cases like this, |auto| should be a recommendation. IIRC, it is one of the cases that |auto| was introduced for. For cases like: for (int32_t i = 0; i < array.Length(); i++) I even want to write it as for (decltype(array.

Re: Using c++11 right angle bracket in template code?

2014-10-06 Thread Neil
Trevor Saunders wrote: for (auto l = tarray.Length() - 1; l < tarray.Length(); l--) Which is how you'd iterate backwards over a non empty array. for (auto l = tarray.Length(); l-- > 0; ) -- Warning: May contain traces of nuts. ___ dev-platform mail

Re: Using c++11 right angle bracket in template code?

2014-10-06 Thread Trevor Saunders
On Thu, Oct 02, 2014 at 01:58:52PM -0400, Ehsan Akhgari wrote: > On 2014-10-02, 1:14 AM, Xidorn Quan wrote: > >On Wed, Oct 1, 2014 at 6:27 PM, Ehsan Akhgari >> wrote: > > > >On 2014-10-01, 7:42 PM, L. David Baron wrote: > > > >On Wednesday 2014-10-01 16:

Re: Using c++11 right angle bracket in template code?

2014-10-02 Thread Ehsan Akhgari
On 2014-10-02, 1:14 AM, Xidorn Quan wrote: On Wed, Oct 1, 2014 at 6:27 PM, Ehsan Akhgari mailto:ehsan.akhg...@gmail.com>> wrote: On 2014-10-01, 7:42 PM, L. David Baron wrote: On Wednesday 2014-10-01 16:24 -0700, Eric Rescorla wrote: Obviously, if you have some argument

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Xidorn Quan
On Wed, Oct 1, 2014 at 6:27 PM, Ehsan Akhgari wrote: > On 2014-10-01, 7:42 PM, L. David Baron wrote: > >> On Wednesday 2014-10-01 16:24 -0700, Eric Rescorla wrote: >> >>> Obviously, if you have some argument that auto is bad programming >>> practice >>> or a hazard and should thus be forbidden, t

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Ehsan Akhgari
On 2014-10-01, 7:42 PM, L. David Baron wrote: On Wednesday 2014-10-01 16:24 -0700, Eric Rescorla wrote: Obviously, if you have some argument that auto is bad programming practice or a hazard and should thus be forbidden, that's something you could make and see if people generally agree... I th

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Eric Rescorla
On Wed, Oct 1, 2014 at 4:42 PM, L. David Baron wrote: > On Wednesday 2014-10-01 16:24 -0700, Eric Rescorla wrote: > > Obviously, if you have some argument that auto is bad programming > practice > > or a hazard and should thus be forbidden, that's something you could make > > and > > see if peopl

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Cameron McCormack
On 02/10/14 09:24, Eric Rescorla wrote: Obviously, if you have some argument that auto is bad programming practice or a hazard and should thus be forbidden, that's something you could make and see if people generally agree... The style guide is probably a better place to describe where we want

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread L. David Baron
On Wednesday 2014-10-01 16:24 -0700, Eric Rescorla wrote: > Obviously, if you have some argument that auto is bad programming practice > or a hazard and should thus be forbidden, that's something you could make > and > see if people generally agree... I think there are cases where |auto| makes cod

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Eric Rescorla
On Wed, Oct 1, 2014 at 4:16 PM, Mike Hommey wrote: > On Wed, Oct 01, 2014 at 04:02:46PM -0700, Eric Rescorla wrote: > > On Wed, Oct 1, 2014 at 3:45 PM, Mike Hommey wrote: > > > > > On Wed, Oct 01, 2014 at 06:34:19PM -0400, Ehsan Akhgari wrote: > > > > On 2014-10-01, 6:26 PM, Mike Hommey wrote: >

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Mike Hommey
On Wed, Oct 01, 2014 at 04:02:46PM -0700, Eric Rescorla wrote: > On Wed, Oct 1, 2014 at 3:45 PM, Mike Hommey wrote: > > > On Wed, Oct 01, 2014 at 06:34:19PM -0400, Ehsan Akhgari wrote: > > > On 2014-10-01, 6:26 PM, Mike Hommey wrote: > > > >On Wed, Oct 01, 2014 at 11:00:28AM -0400, Ehsan Akhgari

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Eric Rescorla
On Wed, Oct 1, 2014 at 3:45 PM, Mike Hommey wrote: > On Wed, Oct 01, 2014 at 06:34:19PM -0400, Ehsan Akhgari wrote: > > On 2014-10-01, 6:26 PM, Mike Hommey wrote: > > >On Wed, Oct 01, 2014 at 11:00:28AM -0400, Ehsan Akhgari wrote: > > >>On 2014-10-01, 9:01 AM, Joshua Cranmer 🐧 wrote: > > >>>On 10

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Mike Hommey
On Wed, Oct 01, 2014 at 06:34:19PM -0400, Ehsan Akhgari wrote: > On 2014-10-01, 6:26 PM, Mike Hommey wrote: > >On Wed, Oct 01, 2014 at 11:00:28AM -0400, Ehsan Akhgari wrote: > >>On 2014-10-01, 9:01 AM, Joshua Cranmer 🐧 wrote: > >>>On 10/1/2014 4:23 AM, Nicholas Nethercote wrote: > On Wed, Oct 1

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Ehsan Akhgari
On 2014-10-01, 6:26 PM, Mike Hommey wrote: On Wed, Oct 01, 2014 at 11:00:28AM -0400, Ehsan Akhgari wrote: On 2014-10-01, 9:01 AM, Joshua Cranmer 🐧 wrote: On 10/1/2014 4:23 AM, Nicholas Nethercote wrote: On Wed, Oct 1, 2014 at 1:08 AM, Cameron McCormack wrote: On 01/10/14 17:57, Kan-Ru Chen (

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Mike Hommey
On Wed, Oct 01, 2014 at 11:00:28AM -0400, Ehsan Akhgari wrote: > On 2014-10-01, 9:01 AM, Joshua Cranmer 🐧 wrote: > >On 10/1/2014 4:23 AM, Nicholas Nethercote wrote: > >>On Wed, Oct 1, 2014 at 1:08 AM, Cameron McCormack wrote: > >>>On 01/10/14 17:57, Kan-Ru Chen (陳侃如) wrote: > It seems all the

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Jeff Walden
Bah, stupid broken newsgroup threading meaning I thought nobody'd replied to the original message yet. :-( Jeff ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Jeff Walden
On 10/01/2014 12:57 AM, Kan-Ru Chen (陳侃如) wrote: > It seems all the compilers we use support the c++11 ">>" in template, > could we start using it in new code? Go ahead. It's already in pretty wide use, actually, but old habits (and caution) die hard with a lot of people. Jeff _

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Ehsan Akhgari
On 2014-10-01, 9:01 AM, Joshua Cranmer 🐧 wrote: On 10/1/2014 4:23 AM, Nicholas Nethercote wrote: On Wed, Oct 1, 2014 at 1:08 AM, Cameron McCormack wrote: On 01/10/14 17:57, Kan-Ru Chen (陳侃如) wrote: It seems all the compilers we use support the c++11 ">>" in template, could we start using it i

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Kyle Huey
On Wed, Oct 1, 2014 at 12:57 AM, Kan-Ru Chen (陳侃如) wrote: > Hi, > > It seems all the compilers we use support the c++11 ">>" in template, > could we start using it in new code? > > Kanru > ___ > dev-platform mailing list > dev-platform@lists.mozilla.org

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Joshua Cranmer 🐧
On 10/1/2014 4:23 AM, Nicholas Nethercote wrote: On Wed, Oct 1, 2014 at 1:08 AM, Cameron McCormack wrote: On 01/10/14 17:57, Kan-Ru Chen (陳侃如) wrote: It seems all the compilers we use support the c++11 ">>" in template, could we start using it in new code? Yes we have some uses of that alread

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Cameron McCormack
On 01/10/14 19:23, Nicholas Nethercote wrote: Note the large, red warning at the top of that page "This page is a draft for expository and exploratory purposes. Do not trust the information listed here." I don't know why that page exists with such an authoritative-looking URL. We should make t

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Nicholas Nethercote
On Wed, Oct 1, 2014 at 1:08 AM, Cameron McCormack wrote: > On 01/10/14 17:57, Kan-Ru Chen (陳侃如) wrote: >> >> It seems all the compilers we use support the c++11 ">>" in template, >> could we start using it in new code? > > Yes we have some uses of that already. It's also mentioned in > https://de

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread 陳侃如
Cameron McCormack writes: > On 01/10/14 17:57, Kan-Ru Chen (陳侃如) wrote: >> It seems all the compilers we use support the c++11 ">>" in template, >> could we start using it in new code? > > Yes we have some uses of that already. It's also mentioned in > https://developer.mozilla.org/en-US/docs/Us

Re: Using c++11 right angle bracket in template code?

2014-10-01 Thread Cameron McCormack
On 01/10/14 17:57, Kan-Ru Chen (陳侃如) wrote: It seems all the compilers we use support the c++11 ">>" in template, could we start using it in new code? Yes we have some uses of that already. It's also mentioned in https://developer.mozilla.org/en-US/docs/Using_CXX_in_Mozilla_code. _

Using c++11 right angle bracket in template code?

2014-10-01 Thread 陳侃如
Hi, It seems all the compilers we use support the c++11 ">>" in template, could we start using it in new code? Kanru ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform