# Wrapper type

**URL:** <https://discourse.julialang.org/t/wrapper-type/72915>\
**Category:** General Usage\
**Created:** [December 10, 2021, 10:27pm UTC](https://discourse.julialang.org/t/wrapper-type/72915 "2021-12-10T22:27:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [December 10, 2021, 10:27pm UTC](https://discourse.julialang.org/t/wrapper-type/72915/1 "2021-12-10T22:27:17Z")

</div>

I want to make a

```julia
struct Wrapper{T}
  x::T
end

```

that forwards calls `f(w)` to `f(w.x)`. What are the options?

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [December 10, 2021, 10:33pm UTC](https://discourse.julialang.org/t/wrapper-type/72915/2 "2021-12-10T22:33:58Z")

</div>

[https://github.com/MikeInnes/Lazy.jl/blob/6705a0aa95b2d479e4ca5b5593313b0d6a857966/src/macros.jl#L293](https://github.com/MikeInnes/Lazy.jl/blob/6705a0aa95b2d479e4ca5b5593313b0d6a857966/src/macros.jl#L293)
