Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use using namespace std; #9213

Merged
merged 1 commit into from Jun 9, 2020

Conversation

omoerbeek
Copy link
Member

@omoerbeek omoerbeek commented Jun 9, 2020

it causes ambiguity if both std::string_view and boost::string_view are in scope
As seen on OpenBSD (sorry to have missed that earlier):

doh.cc:658:85: error: reference to 'string_view' is ambiguous
static bool getHTTPHeaderValue(const h2o_req_t* req, const std::string& headerName, string_view& value)
                                                                                    ^
./views.hh:31:14: note: candidate found by name lookup is 'string_view'
using boost::string_view;
             ^
/usr/include/c++/v1/string_view:771:37: note: candidate found by name lookup is 'std::__1::string_view'
typedef basic_string_view<char>     string_view;
                                    ^
doh.cc:662:3: error: reference to 'string_view' is ambiguous

Short description

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
  • checked that this code was merged to master

both std::string_view and boost::string_view are in scope
@omoerbeek omoerbeek requested a review from rgacogne Jun 9, 2020
@rgacogne rgacogne added the defect label Jun 9, 2020
@rgacogne rgacogne added this to the dnsdist-1.5.0 milestone Jun 9, 2020
@omoerbeek omoerbeek merged commit 0b03fd8 into PowerDNS:master Jun 9, 2020
3 of 5 checks passed
@omoerbeek omoerbeek deleted the dnsdist-stringview-ambiguous branch Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants