Skip to content

Commit

Permalink
I.30: use const c-string to pass filename and input string in example (
Browse files Browse the repository at this point in the history
…#2140)

to signal that they will not modified
  • Loading branch information
itmm authored Oct 12, 2023
1 parent 4ad63d7 commit 6d96d8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CppCoreGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -2310,8 +2310,8 @@ So, we write a class
public:
enum Opt { from_line = 1 };
Istream() { }
Istream(zstring p) : owned{true}, inp{new ifstream{p}} {} // read from file
Istream(zstring p, Opt) : owned{true}, inp{new istringstream{p}} {} // read from command line
Istream(czstring p) : owned{true}, inp{new ifstream{p}} {} // read from file
Istream(czstring p, Opt) : owned{true}, inp{new istringstream{p}} {} // read from command line
~Istream() { if (owned) delete inp; }
operator istream&() { return *inp; }
private:
Expand Down

0 comments on commit 6d96d8e

Please sign in to comment.