[Trilinos-Users] [Sacado-users] [EXTERNAL] Sacado compilation error

Hoemmen, Mark mhoemme at sandia.gov
Tue Oct 7 11:19:10 MDT 2014


This is also the approach that the QD library takes with its 128-bit and
256-bit floating-point types.

mfh

On 10/7/14, 8:25 AM, "Phipps, Eric T" <etphipp at sandia.gov> wrote:

>Generally yes, however in this case I think it is a reasonable thing to do
>in that we are just providing overloads for things that are already in the
>std namespace.  The issue is that people using sacado tend to want to
>write template code such as this:
>
>template <typename T>
>T func(const T& x) {
>  return std::sin(x);
>}
>
>and then to be able to call func on builtin types and sacado types.
>Without these overloads, that fails for any sacado type.  The alternative
>would be to write code like this:
>
>template <typename T>
>T func(const T& x) {
>  using std::sin;
>  return sin(x);
>}
>
>Generally the feedback that I have received from sacado users is they
>prefer the first approach, so I am trying to preserve that.
>
>-Eric
>
>On 10/7/14, 3:08 AM, "Marco Morandini" <marco.morandini at polimi.it> wrote:
>
>>On 10/06/2014 06:44 PM, Phipps, Eric T wrote:
>>> Hi Simone,
>>>
>>> This is a problem that I¹ve known about ever since Apple replaced their
>>> system compiler with clang, and stems from Sacado¹s injections of its
>>> overloads into the std namespace (so you can do things like std::sin(x)
>>> where x is a Sacado type and have it do the right thing).
>>
>>Isn't this dangerous in view of
>>
>>C++ 2003, Section 17.4.3.1 "Reserved names"
>>
>>https://www.securecoding.cert.org/confluence/display/cplusplus/MSC34-CPP.
>>+
>>Do+not+modify+the+standard+namespace
>>
>>?
>>
>>Marco
>>
>
>_______________________________________________
>Sacado-users mailing list
>Sacado-users at software.sandia.gov
>https://software.sandia.gov/mailman/listinfo/sacado-users



More information about the Trilinos-Users mailing list