We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb9cedb commit e49dc46Copy full SHA for e49dc46
examples/cpp/basic.cpp
@@ -5,11 +5,10 @@
5
#include <iostream>
6
7
int main() {
8
- char s[] = "memory";
9
std::vector<uint8_t> data = {'a', 'b', 'c'};
10
11
// Init operator
12
- opendal::Operator op = opendal::Operator(s);
+ opendal::Operator op = opendal::Operator("memory");
13
14
// Write data to operator
15
op.write("test", data);
@@ -19,8 +18,8 @@ int main() {
19
18
20
// Using reader
21
auto reader = op.reader("test");
22
- opendal::ReaderStream stream(reader);
+ opendal::ReaderStream stream(std::move(reader));
23
std::string res2;
24
stream >> res2; // res2 == "abc"
25
- std::cout<<res2<<std::endl;
26
-}
+ std::cout << res2 << std::endl;
+}
0 commit comments