Bruneau B60743

Member since: Tuesday, 13 March 2018
Last login: 4 months ago
Profile viewed: 60 views

No Rank
Points: 0

Bruneau B60743 replied to the topic 'STL set_intersection with classes' in the forum. 4 months ago

Hello Digby,

It should work:

#include <vector>
#include <algorithm>
#include <iterator>
#include <iostream>

struct data {
  int field1;
  int commonfield;
};

std::vector<data> data1 = {{100, 1}, {200, 2}, {300, 3}, {400, 4}, {500, 5}},
                  data2 = {{40 , 4}, {50, 5}, {60, 6}, {70, 7}, {80, 8}}, 
                  data3;

struct comp {
  bool operator()(const data& lhs, const data& rhs) const {
    return (lhs.commonfield < rhs.commonfield);
  }
};

int main()
{
  std::set_intersection(data1.begin(), data1.end(),
                        data2.begin(), data2.end(),
                        std::back_inserter(data3), comp());
  for (auto item: data3)
    std::cout << "field1:" << item.field1 << "\t" << "commonfield:" << item.commonfield << "\n";
}

Cheers,

Bruneau

Read More...

Bruneau B60743 replied to the topic ' header missing, C++ Builder Seattle' in the forum. 4 months ago

Hello Brian,

We provide <chrono> w/ the dinkumware64 library. So it's only usable w/ the clang-based compiler. I do not have a copy of Seattle handy to verify but it should be under $bds/include/dinkumware64. I hope this helps.

Cheers,

Bruneau

Read More...

Bruneau B60743 replied to the topic 'REST Calls - Abort or Timeout for calls > 30 seconds' in the forum. 4 months ago

Hello,

Both WinInet and WINHTTP default to 30secs timeout (see here ). I am sure this is the issue here, but I would investigate the HTTP component handling the request.

Cheers,

Bruneau

Read More...