Created
November 15, 2017 13:01
-
-
Save yohhoy/52b9de2a9f9b3f05b263b5d979013356 to your computer and use it in GitHub Desktop.
std::string_view constructor and UDL (g++7.1 -std=c++1z -O1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.LC0: | |
.string "ABCDEFGHIJKLMNOP" | |
main: | |
subq $8, %rsp | |
movl $16, %edi | |
movl $.LC0, %esi | |
call sink(std::basic_string_view<char, std::char_traits<char> >) | |
movl $16, %edi | |
movl $.LC0, %esi | |
call sink(std::basic_string_view<char, std::char_traits<char> >) | |
movl $0, %eax | |
addq $8, %rsp | |
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string_view> | |
void sink(std::string_view); | |
int main() { | |
sink("ABCDEFGHIJKLMNOP"); | |
using namespace std::literals; | |
sink("ABCDEFGHIJKLMNOP"sv); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment