11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Feature descriptionsExamplevector d;// d placed in default memory, using// the default heap, uses default// pointersvector __data16 x; // x placed in data16 memory,// heap allocation from data16, uses// pointers to data16 memoryvector __data16 y; // y placed in data16 memory,// heap allocation from data20, uses// pointers to data20 memoryvector __data20 z; // IllegalNote that map, multimap, hash_map, andhash_multimap all use the memory of T. This means that the value_typeof these collections will be pair mem where mem is the memory typeof 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 cannotbe assigned to each other.Examplevector x;vector y;x = y; // Illegaly = x; // IllegalHowever, the templated assign member method will work:x.assign(y.begin(), y.end());y.assign(x.begin(), x.end());STL and the <strong>IAR</strong> C-SPY® DebuggerC-SPY has built-in display support for the STL containers. The logical structure ofcontainers is presented in the watch views in a comprehensive way that is easy tounderstand and follow.Note: To be able to watch STL containers with many elements in a comprehensiveway, the STL container expansion option—available by choosingTools>Options>Debugger—is set to display only a small number of items at first.VARIANTS OF CASTSIn Extended E<strong>C++</strong> the following additional <strong>C++</strong> cast variants can be used:const_cast(t), static_cast(t), reinterpret_cast(t).110<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!