Skip to content

fix(examples/cpp): display the results to standard output.#4040

Merged
Xuanwo merged 1 commit intoapache:mainfrom
SYaoJun:cpp
Jan 21, 2024
Merged

fix(examples/cpp): display the results to standard output.#4040
Xuanwo merged 1 commit intoapache:mainfrom
SYaoJun:cpp

Conversation

@SYaoJun
Copy link
Copy Markdown

@SYaoJun SYaoJun commented Jan 21, 2024

No description provided.

@SYaoJun SYaoJun requested review from PsiACE and Xuanwo as code owners January 21, 2024 13:22
@github-actions github-actions bot requested review from dqhl76 and oowl January 21, 2024 13:22
@github-actions github-actions bot added the releases-note/fix The PR fixes a bug or has a title that begins with "fix" label Jan 21, 2024
opendal::ReaderStream stream(reader);
std::string res2;
stream >> res2; // res2 == "abc"
std::cout<<res2<<std::endl;
Copy link
Copy Markdown
Member

@dqhl76 dqhl76 Jan 21, 2024

Choose a reason for hiding this comment

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

We have a comment on the last line to show the result.
// res2 == "abc"
I think it's not necessary to add an additional line for displaying this result to the standard output.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, I noticed the comment. But for a newbie,when he run a program, there is no any outputs and the program terminated. This seems a little strange. So I think print the result is better.

Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks!

@Xuanwo
Copy link
Copy Markdown
Member

Xuanwo commented Jan 21, 2024

Our cpp example is so simple that doesn't meet realistic use cases. Welcome to join in the improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants