Home » U++ Library support » U++ Core » Doubt with Buffer<> of a trivially destructible type
Re: Doubt with Buffer<> of a trivially destructible type [message #61223 is a reply to message #61220] |
Thu, 12 December 2024 14:40   |
Oblivion
Messages: 1210 Registered: August 2007
|
Senior Contributor |
|
|
However, this should work too:
CONSOLE_APP_MAIN
{
typedef std::array<double, 3> Vector3;
Buffer<Vector3> vector3_data(10, {1.0, 2.0, 3.0});
for(int i = 0; i < 10; i++) {
auto a = vector3_data[i];
Cout() << a[0] << " "<< a[1] << " " << a[2] << "\r\n";
}
}
Or, C++17 style:
typedef std::array<double, 3> Vector3;
Vector<Vector3> vector3_data(10, {1.0, 2.0, 3.0});
for(auto& [a, b, c] : vector3_data) {
Cout() << a << " "<< b << " " << c << "\r\n";
}
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Thu, 12 December 2024 14:43] Report message to a moderator
|
|
|
 |
|
Doubt with Buffer<> of a trivially destructible type
By: koldo on Thu, 12 December 2024 12:58
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: Oblivion on Thu, 12 December 2024 14:15
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: Oblivion on Thu, 12 December 2024 14:40
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: koldo on Thu, 12 December 2024 16:05
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: Lance on Sat, 14 December 2024 19:19
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: koldo on Sat, 14 December 2024 20:45
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: Lance on Sat, 14 December 2024 20:53
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: Lance on Sat, 14 December 2024 21:02
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: Lance on Sat, 14 December 2024 21:37
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: koldo on Sun, 15 December 2024 12:25
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: koldo on Sun, 15 December 2024 12:45
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: Lance on Sun, 15 December 2024 14:29
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: mirek on Thu, 26 December 2024 18:47
|
 |
|
Re: Doubt with Buffer<> of a trivially destructible type
By: koldo on Fri, 27 December 2024 18:34
|
Goto Forum:
Current Time: Sat Jun 07 16:49:16 CEST 2025
Total time taken to generate the page: 0.04104 seconds
|