Skip to content

Commit c23a009

Browse files
committed
Enhance code comments for improved clarity and readability
1 parent ffe874f commit c23a009

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

PrettyTable.h

+10-9
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,22 @@
1919
#include <iostream>
2020
#endif
2121

22-
// 1. The function gets a reference to an array as a parameter
23-
// 2. The return value of the function is the reference to a char array
24-
// 3. The function doesn't have a definition, it is never called
25-
// 4. The reference to an array keeps the size of the array
26-
// 5. sizeof operator returns the size of the char array
22+
// 1. The function receives a reference to an array as its parameter.
23+
// 2. It returns a reference to a char array as its output.
24+
// 3. The function lacks a definition and is never invoked.
25+
// 4. The reference to the array retains its size information.
26+
// 5. The `sizeof` operator correctly returns the size of the char array.
2727
template <typename T, size_t size>
2828
char (&arraysize_helper(T (&)[size]))[size];
2929

3030
#define ARRAYSIZE(arr) (sizeof(arraysize_helper(arr)))
3131
#define ARRAYEND(arr) ((arr) + ARRAYSIZE(arr))
3232

33-
// A class to disallow the copy constructor and operator= functions.
34-
// Private copy constructor and copy assignment ensure classes derived from
35-
// class CNonCopyable cannot be copied. Should be used as:
36-
// class CFooBar : CNonCopyable {};
33+
// A class designed to disable the copy constructor and copy assignment
34+
// operator. By making the copy constructor and assignment operator private,
35+
// any class derived from CNonCopyable becomes non-copyable.
36+
// Usage example:
37+
// class CFooBar : public CNonCopyable {};
3738
class CNonCopyable
3839
{
3940
protected:

0 commit comments

Comments
 (0)