Skip to content

c10::string_view#26616

Closed
smessmer wants to merge 31 commits intogh/smessmer/58/basefrom
gh/smessmer/58/head
Closed

c10::string_view#26616
smessmer wants to merge 31 commits intogh/smessmer/58/basefrom
gh/smessmer/58/head

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Sep 22, 2019

Stack from ghstack:

Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace const std::string& with throughout our codebase.

Differential Revision: D17518992

Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
@pytorchbot pytorchbot added the module: internals Related to internal abstractions in c10 and ATen label Sep 22, 2019
@smessmer smessmer changed the title [wip] c10::util::string_view [wip] c10::string_view Sep 22, 2019
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
@smessmer smessmer changed the title [wip] c10::string_view c10::string_view Sep 24, 2019
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
@smessmer smessmer requested a review from ezyang September 24, 2019 23:33
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrieval which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.

Differential Revision: [D17518992](https://our.internmc.facebook.com/intern/diff/D17518992/)

[ghstack-poisoned]
Copy link
Collaborator

@dzhulgakov dzhulgakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I read it diagonally and looks plausible. Given extensive testing and that it's mostly constexpr it should be good

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 70e9ef5.

}

template <class T>
constexpr const T& min(const T& a, const T& b) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is constexpr in C++14, right? Is there a reason we aren't tracking C++14 / C++17 separately so we can kill the C++14 stuff once we move to that?

@facebook-github-bot facebook-github-bot deleted the gh/smessmer/58/head branch October 28, 2019 22:19
thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
Summary:
Pull Request resolved: pytorch#26616

Implement C++17 std::string_view for C++11.

This is useful for compile time type name retrievaly which I'm going to stack on top of this.
It is also useful to replace `const std::string&` with throughout our codebase.
ghstack-source-id: 92100314

Test Plan: unit tests

Differential Revision: D17518992

fbshipit-source-id: 48e31c677d51b0041f4b37e89a92bd176d4a0b08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: internals Related to internal abstractions in c10 and ATen

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants