Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers module #74

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Headers module #74

wants to merge 7 commits into from

Conversation

rwdougla
Copy link
Contributor

@rwdougla rwdougla commented Feb 23, 2022

resolves #3


#### Background/Required Knowledge

* All of the above.

Choose a reason for hiding this comment

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

Is "All of the above" on line 77 referring to all of the foundational background? I think that it would be clearer to say this explicitly. Incidentally, is it implied that all background for a topic at the foundational level is also required for the main level? If so, then perhaps such a statement is unnecessary?

Would like to get cross-references in advance section to other modules which are coupled to headers, such as classes, templates, modules, etc.
@vulder vulder linked an issue Apr 29, 2022 that may be closed by this pull request
@vulder
Copy link
Collaborator

vulder commented Jul 8, 2022

/ok-to-test

feeling of small-group was to omit advanced section, as each advanced topic seemed more relevant to a different module
@rwdougla rwdougla marked this pull request as ready for review January 17, 2023 16:12
@rwdougla rwdougla changed the title WIP: Straw-man "Headers" for small-group session Straw-man "Headers" for small-group session Jan 17, 2023
@rwdougla rwdougla changed the title Straw-man "Headers" for small-group session Headers module Jan 17, 2023
* Usage of standard library code requires inclusion of various header files
* Give examples of various header files and when they may be needed for inclusion
* Include links to reference materials for finding out what headers are used for various feature sets
* When using standard library facilities, can either use `using std::vector; vector<int> v;`, or `std::vector<int> v;`, or `using namespace std; vector<int> v;`, though modern practice strongly discourages invoking `using namespace std;`
Copy link
Contributor

Choose a reason for hiding this comment

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

That is a nice example but that does not relates to headers. I think it relates to templates and I am not sure if we should mention it there.

Thoughts?

Copy link
Collaborator

@vulder vulder left a comment

Choose a reason for hiding this comment

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

Nice, work.

@rwdougla What's the status of this topic, should we table it for a SG20 discussion? It seems quite ready.

@@ -0,0 +1,106 @@
## Module name: Headers
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
## Module name: Headers
## C++ compilation model: Headers {#headers}

multiple distinct source files to share a single source of common
declarations.

### Foundational: Including code through standard library headers
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
### Foundational: Including code through standard library headers
### Foundational: Including code through standard library headers {#headers-found}

* Include links to reference materials for finding out what headers are used for various feature sets
* When using standard library facilities, can either use `using std::vector; vector<int> v;`, or `std::vector<int> v;`, or `using namespace std; vector<int> v;`, though modern practice strongly discourages invoking `using namespace std;`

### Main: Organizing function and class declarations for reuse
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
### Main: Organizing function and class declarations for reuse
### Main: Organizing function and class declarations for reuse {#headers-main}


A student should be able to:

1. Include common standard library headers to get access to standard library features
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
1. Include common standard library headers to get access to standard library features
1. include common standard library headers to get access to standard library features

Comment on lines +89 to +93
1. Create a declaration for an existing function, placed in a separate file
2. Utilize double-quote inclusion to include a header from the same directory
3. Utilize angular-bracket inclusion to include a header from standard library
4. Explain the meaning of the one-definition rule and how it applies to headers
5. Protect a header with include guards and explain why they are necessary
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
1. Create a declaration for an existing function, placed in a separate file
2. Utilize double-quote inclusion to include a header from the same directory
3. Utilize angular-bracket inclusion to include a header from standard library
4. Explain the meaning of the one-definition rule and how it applies to headers
5. Protect a header with include guards and explain why they are necessary
1. create a declaration for an existing function, placed in a separate file
2. utilize double-quote inclusion to include a header from the same directory
3. utilize angular-bracket inclusion to include a header from standard library
4. explain the meaning of the one-definition rule and how it applies to headers
5. protect a header with include guards and explain why they are necessary

alignment with other topic spellings

Comment on lines +63 to +64
implementation-defined, unspecified, or undefined behavior._

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
implementation-defined, unspecified, or undefined behavior._
implementation-defined, unspecified, or undefined behavior._
* The include directly actually copies the header file into the file it is included in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TOPIC] Headers
5 participants