Skip to content

Add file hint in namespaces-cpp.md #4849

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

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/cpp/namespaces-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The **`using`** directive allows all the names in a **`namespace`** to be used w
Typically, you declare a namespace in a header file. If your function implementations are in a separate file, then qualify the function names, as in this example.

```cpp
//contosoData.h
// contosoData.h
#pragma once
namespace ContosoDataServer
{
Expand Down Expand Up @@ -144,7 +144,7 @@ Ordinary nested namespaces can be used to encapsulate internal implementation de
In contrast to an ordinary nested namespace, members of an inline namespace are treated as members of the parent namespace. This characteristic enables argument dependent lookup on overloaded functions to work on functions that have overloads in a parent and a nested inline namespace. It also enables you to declare a specialization in a parent namespace for a template that is declared in the inline namespace. The following example shows how external code binds to the inline namespace by default:

```cpp
//Header.h
// Header.h
#include <string>

namespace Test
Expand All @@ -160,6 +160,7 @@ namespace Test
}
}

// main.cpp
#include "header.h"
#include <string>
#include <iostream>
Expand Down