cling icon indicating copy to clipboard operation
cling copied to clipboard

Variable template instantiation does not create static constexpr member

Open Eximius opened this issue 5 years ago • 1 comments

This breaks ROOT::RDataFrame, among other things.

In RDataFrame's case TypeTraits<ArgTypes>::list_size does not exist.

Even though the static member exists in TypeTraits.hxx:

namespace ROOT {

/// ROOT type_traits extensions
namespace TypeTraits {
/// Lightweight storage for a collection of types.
/// Differently from std::tuple, no instantiation of objects of stored types is performed
template <typename... Types>
struct TypeList {
   static constexpr std::size_t list_size = sizeof...(Types);
};
} // end ns TypeTraits

Reproduce with:

ROOT::RDataFrame d(50);
int i = 0;
d.Define("test", [&i]() { return (double)i; }).Filter("test > 10");

Or with:

ROOT::RDataFrame d(50);
int i = 0;
d.Define("test", [&i]() { return (double)i; });
d.Filter([](double test){ return test > 0;}, {"test"});

Exists both on latest swan image

and local archlinux:

Name            : root
Version         : 6.22.06-2

Eximius avatar Jan 27 '21 23:01 Eximius

It needed

#include "TROOT.h"

in the macro .C file for some reason. Confusing. Never written in the reference docs seemingly.

Eximius avatar Jan 28 '21 01:01 Eximius

@Eximius please marked this issue as resolved if you've fixed your problem

Mallchad avatar Mar 29 '24 21:03 Mallchad

Seems to work with latest master, please reopen if you reproduce the failure, thanks.

ferdymercury avatar Apr 12 '24 15:04 ferdymercury