-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
329c8ab
commit 8d0b736
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
project(cf_dummy LANGUAGES CXX) | ||
cmake_minimum_required(VERSION 3.12) | ||
find_package(absl REQUIRED CONFIG) | ||
|
||
add_executable(re2_example re2_example.cpp) | ||
target_link_libraries(re2_example absl::flags absl::strings) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// try that conversion from absl::string_view to re2::StringPiece works | ||
|
||
#include "absl/strings/string_view.h" | ||
#include "re2/stringpiece.h" | ||
|
||
absl::string_view some_function(absl::string_view text) { | ||
return text; | ||
} | ||
|
||
int main() { | ||
re2::StringPiece sp = "hello, world"; | ||
// should be transformable between types by compiler | ||
some_function(sp) | ||
|
||
return 0; | ||
} |
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