+Andy My understanding based on discussions with Andy last month is that the ICU namespace ...
6 years, 5 months ago
(2017-10-23 08:50:50 UTC)
#4
+Andy
My understanding based on discussions with Andy last month is that the ICU
namespace macros are obsolete and new code should use "icu" instead of the
macros. Andy, can you please confirm?
On 2017/10/23 08:50:50, sffc wrote: > +Andy > > My understanding based on discussions with ...
6 years, 5 months ago
(2017-10-23 16:35:49 UTC)
#5
On 2017/10/23 08:50:50, sffc wrote:
> +Andy
>
> My understanding based on discussions with Andy last month is that the ICU
> namespace macros are obsolete and new code should use "icu" instead of the
> macros. Andy, can you please confirm?
Thanks. Didn't know that change. In the 'new world', how is namespace renaming
handled? Automagically, somehow?
Version renaming for the icu namespace is set up in uversion.h, lines 114-117, # define ...
6 years, 5 months ago
(2017-10-23 18:12:32 UTC)
#6
Version renaming for the icu namespace is set up in uversion.h, lines
114-117,
# define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu)
namespace U_ICU_NAMESPACE { }
namespace icu = U_ICU_NAMESPACE;
I would like to see us use fewer macros and more direct use of the language
features in places where we no longer need to allow for varying platforms
or configurations. The macros, for me at least, tend to add a layer of
obfuscation to what is actually going on.
For Number format, where we have namespaces icu::number
and icu::number::impl, using the macros for namespace icu but not the
others would look weird.
-- Andy
On Mon, Oct 23, 2017 at 9:35 AM, <jshin@chromium.org> wrote:
> On 2017/10/23 08:50:50, sffc wrote:
>
>> +Andy
>>
>
> My understanding based on discussions with Andy last month is that the
>>
> ICU
>
>> namespace macros are obsolete and new code should use "icu" instead of
>>
> the
>
>> macros. Andy, can you please confirm?
>>
>
> Thanks. Didn't know that change. In the 'new world', how is namespace
> renaming handled? Automagically, somehow?
>
>
> https://codereview.appspot.com/332050043/
>
On 2017/10/23 18:12:32, andy.heninger wrote: > Version renaming for the icu namespace is set up ...
6 years, 5 months ago
(2017-10-24 20:38:08 UTC)
#7
On 2017/10/23 18:12:32, andy.heninger wrote:
> Version renaming for the icu namespace is set up in uversion.h, lines
> 114-117,
>
> # define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu)
> namespace U_ICU_NAMESPACE { }
> namespace icu = U_ICU_NAMESPACE;
>
> I would like to see us use fewer macros and more direct use of the language
> features in places where we no longer need to allow for varying platforms
> or configurations. The macros, for me at least, tend to add a layer of
> obfuscation to what is actually going on.
>
> For Number format, where we have namespaces icu::number
> and icu::number::impl, using the macros for namespace icu but not the
> others would look weird.
My memory of this from years ago is that, as long as we use renaming where the
real namespace is icu_some_suffix, we need to use that for declaring stuff.
Users who turn off renaming completely can use "namespace icu".
At the same time, we don't want to add macros for nested namespaces, so I think
we are stuck in ICU library code with macros for the outer layer and direct
namespaces on the inside.
If it turns out that the compilers don't care whether we declare things inside
"namespace icu" vs. U_NAMESPACE_BEGIN //and they generate the same code// then
we can change to that.
markus
In terms of this particular code review, we are only touching the implementation files. The ...
6 years, 5 months ago
(2017-10-25 00:23:45 UTC)
#9
In terms of this particular code review, we are only touching the implementation
files. The header files have the macro, but the macro for declarations is
different than a "using" line. Since there were already "using" lines, it seems
that this approach works for what we need. Also, there are several other
implementation files that have "using namespace icu" without the macro:
icuplug.cpp, locutil.cpp, uresbund.cpp, and others.
Issue 332050043: ticket:13411 Making "using namespace" statements consistent across number formatting cpp files.
(Closed)
Created 6 years, 5 months ago by sffc
Modified 6 years, 5 months ago
Reviewers: jeff.genovy_microsoft.com, jshin, andy.heninger, markus.icu
Base URL: svn+icussh://source.icu-project.org/repos/icu/trunk/icu4c/source/
Comments: 2