# Struct wrapping NamedTuple is not \`isbits\` (depending on how it is defined)

**URL:** <https://discourse.julialang.org/t/struct-wrapping-namedtuple-is-not-isbits-depending-on-how-it-is-defined/72965>\
**Category:** General Usage\
**Tags:** memory-allocation, namedtuple\
**Created:** [December 12, 2021, 5:48am UTC](https://discourse.julialang.org/t/struct-wrapping-namedtuple-is-not-isbits-depending-on-how-it-is-defined/72965 "2021-12-12T05:48:49Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [December 12, 2021, 11:10pm UTC](https://discourse.julialang.org/t/struct-wrapping-namedtuple-is-not-isbits-depending-on-how-it-is-defined/72965/9 "2021-12-12T23:10:38Z")

</div>

Yeah, definitely looks like a bug to me:

```julia
julia> nt(::Wrapper{S,T}) where {S,T} = NamedTuple{S,T}
nt (generic function with 1 method)

julia> nt(X)
NamedTuple{(:a, :b, :c, :d), Tuple{Float64, Float64, Int64, SVector{3, Float64}}}

julia> nt(X) === typeof(X.x)
true

julia> isbits(X) # false
false

julia> isbits(X.x) # true
true

```

The wrapper seems to be matching the `NamedTuple` exactly.

---

_[View the full topic](https://discourse.julialang.org/t/struct-wrapping-namedtuple-is-not-isbits-depending-on-how-it-is-defined/72965)._
