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

Fix C++ namespace in README #156

Merged
merged 1 commit into from
Apr 12, 2021
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ instructions) at runtime.
<a name="codesample"></a>
## Code samples

**Note:** For C++ code, the library functions are defined in the `CpuFeatures` namespace.
**Note:** For C++ code, the library functions are defined in the `cpu_features` namespace.

### Checking features at runtime

Expand All @@ -42,7 +42,7 @@ AES and the SSE4.2 instruction sets:
```c
#include "cpuinfo_x86.h"

// For C++, add `using namespace CpuFeatures;`
// For C++, add `using namespace cpu_features;`
static const X86Features features = GetX86Info().features;

void Compute(void) {
Expand All @@ -64,7 +64,7 @@ features and then check whether AES and NEON are supported.
#include <stdbool.h>
#include "cpuinfo_arm.h"

// For C++, add `using namespace CpuFeatures;`
// For C++, add `using namespace cpu_features;`
static const ArmFeatures features = GetArmInfo().features;
static const bool has_aes_and_neon = features.aes && features.neon;

Expand All @@ -84,7 +84,7 @@ instruction set (e.g., `g++ -mavx`) and sets `has_avx` accordingly.
#include <stdbool.h>
#include "cpuinfo_x86.h"

// For C++, add `using namespace CpuFeatures;`
// For C++, add `using namespace cpu_features;`
static const X86Features features = GetX86Info().features;
static const bool has_avx = CPU_FEATURES_COMPILED_X86_AVX || features.avx;

Expand All @@ -107,7 +107,7 @@ set&mdash;but only if it's not Sandy Bridge.
#include <stdbool.h>
#include "cpuinfo_x86.h"

// For C++, add `using namespace CpuFeatures;`
// For C++, add `using namespace cpu_features;`
static const X86Info info = GetX86Info();
static const X86Microarchitecture uarch = GetX86Microarchitecture(&info);
static const bool has_fast_avx = info.features.avx && uarch != INTEL_SNB;
Expand Down