Atmel CAVR-4 ユーザーズマニュアル
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
CAVR-4
118
Feature descriptions
AVR® IAR C/C++ Compiler
Reference Guide
Example
vector<int> d; // d placed in default memory, using
// the default heap, uses default
// pointers
vector<int _ _near> _ _near x; // x placed in near memory, heap
// allocation from near, uses
// pointers to near memory
vector<int _ _huge> _ _near y; // y placed in near memory, heap
// allocation from huge, uses
// pointers to huge memory
vector<int _ _near> _ _huge z; // Illegal
Note that
map<key,
T>
,
multimap<key,
T>
,
hash_map<key,
T>
, and
hash_multimap<key,
T>
all use the memory of
T
. This means that the
value_type
of these collections will be
pair<key,
const T>
mem
where
mem
is the memory type
of
T
. Supplying a key with a memory type is not useful.
Note that two containers that only differ by the data memory attribute they use cannot
be assigned to each other.
be assigned to each other.
Example
vector<int _ _near> x;
vector<int _ _huge> y;
x = y; // Illegal
y = x; // Illegal
However, the templated assign member method will work:
x.assign(y.begin(), y.end());
y.assign(x.begin(), x.end());
STL and the IAR C-SPY Debugger
C-SPY has built-in display support for the STL containers.
VARIANTS OF CASTS
In Extended EC++ the following additional C++ cast variants can be used:
const_cast<t2>(t), static_cast<t2>(t), reinterpret_cast<t2>(t).
MUTABLE
The mutable attribute is supported in Extended EC++. A mutable symbol can be
changed even though the whole class object is const.
changed even though the whole class object is const.