-
Notifications
You must be signed in to change notification settings - Fork 113
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
Remove using namespace directives in header #1496
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for putting this PR up.
@MikeDvorskiy should probably weigh in before merging.
namespace internal | ||
{ | ||
|
||
enum class search_algorithm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really needed to have only one brick struct custom_brick
+ user visible enum class search_algorithm
+ parametrizations by their enum values? What about three bricks without enum class search_algorithm
at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, but I don't quite follow the question. I have updated the forward declaration of custom_brick
to now use a forward declared search_algorithm
enum class. Are you suggesting a different approach?
@@ -24,6 +24,8 @@ | |||
#ifndef _ONEDPL_SYCL_TRAITS_H | |||
#define _ONEDPL_SYCL_TRAITS_H | |||
|
|||
#include <oneapi/dpl/internal/binary_search_extension_defs.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it should be a relative patch, via ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed this include.
namespace internal | ||
{ | ||
|
||
enum class search_algorithm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only a forward declaration is not enough?
Like this?
enum class search_algorithm;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that this enum
required at all: see #1496 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not realize forward declaring enum classes were possible. Thanks for pointing that out. I have removed the changes to the binary search files and just forward declared the enum class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK: forward declaration is enough too.
My idea was to split this brick into three separate bricks and remove this enum
.
But I am fine with forward declaration too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR #1394 introduced a few
using namespace
directives in a header, which would pull everything from our internal namespaces to be visible in user code.This PR removes the
using
directives by explicitly writing the namespaces and wrapping the forward declarations in their appropriate namespace.