namespace std {
template<typename T>
using raw_ptr = T*;
}
// mutable pointer to const value
int const *a_old;
std::raw_ptr<int const> a_new;
std::raw_ptr<const int> a_new_var;
// const pointer to mutable value
int *const b_old;
std::raw_ptr<int> const b_new;
const std::raw_ptr<int> b_new_var;
// const pointer to const value
int const *const c_old;
std::raw_ptr<int const> const c_new;
const std::raw_ptr<const int> c_new_var;
I’ve actually used this before to parameterise a struct/class with an ownership policy, for example: template<template<typename T, typename...> class P>
struct Wrapper {
P<int> value;
};
Now Wrapper<std::raw_ptr> is a non-owning Wrapper, while Wrapper<std::unique_ptr> is an owning one.Meaning ANSI C does not refer at all to inline Assembly, from its point of view it does not exist.
ANSI C++ on other hand, specifies the asm keyword and that it should enable a compiler specific way to write inline Assembly.
But yeah, neither of them actually specifies how it should look.
Quoted from the C++ standard: "the asm declaration is conditionally-supported; its meaning is implementation-defined". ISO C does not differ much in conformance (the asm keyword is common extension listed in annex J). There exists implementation without inline assembly support, e.g. MSVC x64. There are alternative keywords used in practice (e.g. `__asm` or `__asm__ __volatile__`). Actually the contents are not supposed to be assembly language in all cases when it is supported, as I know there exists implementation with JavaScript as the "assembly" (Cheerp). Even the implementation supports "genuine" assembly, it varies in syntax, e.g. for x86, Intel (MSVC), AT&T (Clang), or both (GCC) ?
So no, you can't expect it too much, if you have to.