Skip to content

Commit d9ab755

Browse files
committed
DPL: proper SFINAE to support 1.3.X
1 parent 3df4e4d commit d9ab755

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ namespace
4545
struct FairMQDeviceLegacyWrapper {
4646
// If both APIs are available, this has precendence because of dummy.
4747
// Only the old API before the deprecation had FairMQSocket::TrySend().
48-
template <typename T>
49-
static auto ReceiveAsync(T* device, FairMQParts& parts, std::string const& channel, int dummy) -> typename std::enable_if<(sizeof(decltype(std::declval<FairMQSocket>().TrySend(parts.At(0)))) > 0), int>::type
48+
template <typename S>
49+
static auto ReceiveAsync(FairMQDevice* device, FairMQParts& parts, std::string const& channel, int dummy) -> typename std::enable_if<(sizeof(decltype(std::declval<S>().TrySend(parts.At(0)))) > 0), int>::type
5050
{
5151
return device->ReceiveAsync(parts, channel);
5252
}
5353

5454
// Otherwise if we are here it means that TrySend() is not there anymore
55-
template <typename T>
56-
static auto ReceiveAsync(T* device, FairMQParts& parts, std::string const& channel, long dummy) -> int
55+
template <typename S>
56+
static auto ReceiveAsync(FairMQDevice* device, FairMQParts& parts, std::string const& channel, long dummy) -> int
5757
{
5858
return device->Receive(parts, channel, 0, 0);
5959
}
@@ -125,7 +125,7 @@ bool DataProcessingDevice::ConditionalRun()
125125
bool active = false;
126126
for (auto& channel : mSpec.inputChannels) {
127127
FairMQParts parts;
128-
auto result = FairMQDeviceLegacyWrapper::ReceiveAsync(this, parts, channel.name, 0);
128+
auto result = FairMQDeviceLegacyWrapper::ReceiveAsync<FairMQSocket>(this, parts, channel.name, 0);
129129
if (result > 0) {
130130
this->handleData(parts);
131131
active |= this->tryDispatchComputation();

0 commit comments

Comments
 (0)