tmp update

This commit is contained in:
张壹 2025-01-11 21:18:26 +08:00
parent 363a4499ca
commit fc8442bacd

View File

@ -30,6 +30,11 @@
using namespace gctl; using namespace gctl;
double get_x(const point3dc &p)
{
return p.x;
}
int main(int argc, char const *argv[]) try int main(int argc, char const *argv[]) try
{ {
// create a new array and give initial values // create a new array and give initial values
@ -64,7 +69,8 @@ int main(int argc, char const *argv[]) try
P.sequence(point3dc(0, 0, 0), point3dc(2, 1, 0.5)); P.sequence(point3dc(0, 0, 0), point3dc(2, 1, 0.5));
P.show(std::cout, '\n'); P.show(std::cout, '\n');
array<double> Px = P.extract<double>([](const point3dc &p)->double{return p.x;}); //array<double> Px = P.extract<double>([](const point3dc &p)->double{return p.x;});
array<double> Px = P.extract<double>(get_x);
Px.show(); Px.show();
// create a new 2D array // create a new 2D array