kfr icon indicating copy to clipboard operation
kfr copied to clipboard

Fix cometa ambiguities

Open xkzl opened this issue 2 years ago • 6 comments

Hello,

I have been facing some issues installing KFR on a basic Ubuntu distribution. My setup is using a scientific framework (ROOT CERN) which is compiled with Clang10, and some other parts with GCC9.

I had to update many namespace to avoid ambiguities between cometa:: and std:: methods. Here is a working update, that I compile using : mkdir build && cd build cmake -DENABLE_TESTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER=clang++ -DENABLE_CAPI_BUILD=ON ../

Can somebody have a look at that ?

xkzl avatar May 20 '22 08:05 xkzl

https://github.com/kfrlib/kfr/issues/151

xkzl avatar May 20 '22 08:05 xkzl

Anybody here ? @dlevin256 ?

xkzl avatar Jun 10 '22 09:06 xkzl

I just provided an additional modification. I was using only "kfr/dft.h" header in my program and not "kfr/all.hpp", so some ambiguities were remaining.

xkzl avatar Jun 15 '22 07:06 xkzl

Hello,

Do you run the code in Cling interpreter? It adds using namespace std implicitly before user even gets chance to include any external header. This is against c++ namespace concept and causes all these errors.

The following (bad practice) code produces the same error:

// first merge the whole std namespace into current scope
using namespace std; // Cling does this

// then including kfr headers
#include <kfr/all.hpp>

dancazarin avatar Jun 17 '22 15:06 dancazarin

Right that is what I am using. However, it would not be a bad thing to avoid ambiguities between namespaces I suppose.

xkzl avatar Jun 18 '22 12:06 xkzl

(Side note: this 'using std' might change in the future, see https://github.com/root-project/root/pull/11027)

ferdymercury avatar Jul 26 '22 10:07 ferdymercury

I just tested kfr 5.0. This is now working fine !

xkzl avatar May 23 '23 02:05 xkzl