Re: [C++] Intent to eliminate: `using namespace std; ` at global scope

2019-08-29 Thread Eric Rescorla
headers that pull in definitions of `byte`, and > conflicts between the two when one has done `using namespace std;`, > particularly at global scope. Any use of `using namespace $NAME` is > not permitted by the style guide [4]. > > A quick perusal of our code shows that we h

[C++] Intent to eliminate: `using namespace std;` at global scope

2019-08-29 Thread Nathan Froyd
Hi all, In working on upgrading our C++ support to C++17 [1], we've run into some issues [2] surrounding the newly-introduced `std::byte` [3], various Microsoft headers that pull in definitions of `byte`, and conflicts between the two when one has done `using namespace std;`, particular

Re: using namespace

2014-05-21 Thread Ehsan Akhgari
On 2014-05-21, 7:40 AM, Nicolas Silva wrote: Sorry, my example was not clear enough. The issue with using namespace + unifoed builds is that the using namespace declaration applies to all (or most) of the headers included in the unified translation unit. So using namespace mozilla at the top of

Re: using namespace

2014-05-21 Thread Nicolas Silva
Sorry, my example was not clear enough. The issue with using namespace + unifoed builds is that the using namespace declaration applies to all (or most) of the headers included in the unified translation unit. So using namespace mozilla at the top of each .cpp is harmless until we include third

Re: using namespace

2014-05-20 Thread Ehsan Akhgari
On 2014-05-20, 10:00 PM, Joshua Cranmer 🐧 wrote: On 5/20/2014 8:37 PM, Ehsan Akhgari wrote: FWIW, I argued against nested namespaces a few years ago (couldn't find a link to it through Google unfortunately) and people let me "win" that battle by allowing me to edit the coding style to prohibit n

Re: using namespace

2014-05-20 Thread Joshua Cranmer 🐧
On 5/20/2014 8:37 PM, Ehsan Akhgari wrote: FWIW, I argued against nested namespaces a few years ago (couldn't find a link to it through Google unfortunately) and people let me "win" that battle by allowing me to edit the coding style to prohibit nested namespoaces in most cases

Re: using namespace

2014-05-20 Thread Robert O'Callahan
t names shouldn't feel overly verbose with only a > "using namespace mozilla"? > As Ehsan says, we already have that guideline. Rob -- Jtehsauts tshaei dS,o n" Wohfy Mdaon yhoaus eanuttehrotraiitny eovni le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o

Re: using namespace

2014-05-20 Thread Ehsan Akhgari
sonally will be strict about it the reviews I give. I don't think we should have rules that some reviewers enforce and others don't. That makes life hard for everyone. It's not clear to me how moving the "using namespace" declaration inside a namespace helps. Won't most fi

Re: using namespace

2014-05-20 Thread L. David Baron
the file. I personally will be strict about it the reviews I give. > > > > I don't think we should have rules that some reviewers enforce and others > don't. That makes life hard for everyone. > > It's not clear to me how moving the "using namespace" d

Re: using namespace

2014-05-20 Thread Brian Birtles
(2014/05/21 8:51), Robert O'Callahan wrote: Personally I find unified-build-related using-namespace errors are rare --- I've not encountered one yet. I'm not sure they're worth attempting to ameliorate. I wasted half a day recently due to a "using namespace mozilla:

Re: using namespace

2014-05-20 Thread Robert O'Callahan
rules that some reviewers enforce and others don't. That makes life hard for everyone. It's not clear to me how moving the "using namespace" declaration inside a namespace helps. Won't most files in a unified build translation unit put their declarations in the same namespac

Re: using namespace

2014-05-20 Thread Benjamin Smedberg
On 5/20/2014 12:36 PM, Nicolas Silva wrote: So, I strongly encourage everyone to stop using "using namespace". I think I disagree about the "mozilla" namespace specifically. Since basically all of gecko does or will end up being in the mozilla namespace, I'd like t

Re: using namespace

2014-05-20 Thread Boris Zbarsky
On 5/20/14, 2:23 PM, Bobby Holley wrote: In XPConnect, we have "using namespace JS" everywhere. This is pretty important, because the JS rooting/handle API is very cumbersome to use otherwise. Note that if every file in a directory has the same "using namespace" declaratio

Re: using namespace

2014-05-20 Thread Jonas Sicking
On Tue, May 20, 2014 at 9:36 AM, Nicolas Silva wrote: > Now that we have unified builds, writing "using namespace" in the global > scope of a .cpp file is almost as bad as writing it in a header. Regularly > build errors show up like this one: > https://tbpl.mozilla.org/p

Re: using namespace

2014-05-20 Thread Bobby Holley
In XPConnect, we have "using namespace JS" everywhere. This is pretty important, because the JS rooting/handle API is very cumbersome to use otherwise. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/li

using namespace

2014-05-20 Thread Nicolas Silva
Now that we have unified builds, writing "using namespace" in the global scope of a .cpp file is almost as bad as writing it in a header. Regularly build errors show up like this one: https://tbpl.mozilla.org/php/getParsedLog.php?id=40010766&tree=Try What's awesome about these