# How to use ClassDefInline?

**URL:** <https://root-forum.cern.ch/t/how-to-use-classdefinline/25127>\
**Category:** ROOT\
**Created:** [June 14, 2017, 9:55am UTC](https://root-forum.cern.ch/t/how-to-use-classdefinline/25127 "2017-06-14T09:55:36Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![ahesam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahesam/32/19455_2.png) [@ahesam](https://root-forum.cern.ch/u/ahesam)\
**Post date:** [June 14, 2017, 1:23pm UTC](https://root-forum.cern.ch/t/how-to-use-classdefinline/25127/7 "2017-06-14T13:23:43Z")

</div>

Unfortunately the situation is a little more complicated to solve this problem with partial specialization (at least to my knowledge). The `CellExt<T, Q>` class takes for T one of the three predefined structs, of which one is defined as the following:

```auto
struct SoaRef {
  template <typename T>
  using vec = std::vector<T>&;
  ...(more stuff)
};

```

This is the template argument that is giving me the uninitialized reference members errors as show in the third post. The `vec` data members in `CellExt` will namely become references, which will not be initialized (and don’t need to be initialized) when ROOT creates the IO methods, hence the error messages.

But partial specialization (even if it would work) would seem like a less elegant way then to just do the `ClassDef` expansion I mentioned earlier. I had hoped `ClassDefInline` could just ignore the reference-containing struct as the template parameter argument when generating the IO methods.

---

_[View the full topic](https://root-forum.cern.ch/t/how-to-use-classdefinline/25127)._
