cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Voyager
Voyager
838 Views
Registered: ‎05-30-2018

Using C++ containers (e.g. "array", "list", "set", "map") in ARM9 application

Hello,

I've tried to use C++ containers like array, map, set, etc. in my ARM9 application, but it seems that they aren't supported.

At least theirs headers aren't recognized by SDK.

Would it be possible to add container support in Xilinx SDK.

Thanks in advance.

 

0 Kudos
3 Replies
Highlighted
Mentor
Mentor
829 Views
Registered: ‎04-26-2015

Re: Using C++ containers (e.g. "array", "list", "set", "map") in ARM9 application

Bare metal, or under Linux?

 

A lot of the C++ libraries require an operating system, because they rely on that to manage dynamic memory allocation (among other things).

0 Kudos
Highlighted
Voyager
Voyager
812 Views
Registered: ‎05-30-2018

Re: Using C++ containers (e.g. "array", "list", "set", "map") in ARM9 application

For the moment Bare metal

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
771 Views
Registered: ‎11-02-2011

Re: Using C++ containers (e.g. "array", "list", "set", "map") in ARM9 application

Hi,

I have created a sample array c++ application for ZC706_hw_platform and it worked fine

#include <string>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <array>

int main()
{
std::array<int, 3> a1{ {1, 2, 3} }; // double-braces required in C++11 (not in C++14)
std::array<int, 3> a2 = {1, 2, 3}; // never required after =
std::array<std::string, 2> a3 = { std::string("a"), "b" };
std::sort(a1.begin(), a1.end());
std::reverse_copy(a2.begin(), a2.end(),
std::ostream_iterator<int>(std::cout, " "));

std::cout << '\n';
for(const auto& s: a3)
std::cout << s << ' ';
}

 

Have you tried something similar?

array.png
0 Kudos