divyanshuGupta's blog

By divyanshuGupta, history, 6 years ago, In English

can anyone tell me why does it show that reference is ambiguous on custom invocation of codeforces although it works fine on sublime and when i just change the name of array it works fine .. ... code link...

...thank you

  • Vote: I like it
  • +4
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

in c++17 you can't name a global variable data. You probably use an older c++ standard locally that's why its works for oyu.

»
6 years ago, hide # |
Rev. 2  
Vote: I like it +7 Vote: I do not like it

Because of global namespace pollution (using namespace std;)

Edit: to be more clear, there are several utility function templates defined in the std namespace with the same name (data).