Skip to content

Commit

Permalink
fixed pezy#105 make semantics more explict.
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Mar 12, 2017
1 parent fe1277a commit 308bf9c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ch06/ex6_23.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using std::endl;
using std::begin;
using std::end;

void print(const int* pi)
void print(int* pi)
{
if (pi) cout << *pi << endl;
}
Expand All @@ -29,7 +29,7 @@ void print(const int ia[], size_t size)
}
}

void print(int(&arr)[2])
void print(const int(&arr)[2])
{
for (auto i : arr) cout << i << endl;
}
Expand All @@ -43,7 +43,5 @@ int main()
print(begin(j), end(j));
print(&i);
print(j, end(j) - begin(j));
print(j);

return 0;
print(const_cast<const int(&)[2]>(j));
}

0 comments on commit 308bf9c

Please sign in to comment.