# Question regarding @inbounds usage

**URL:** <https://discourse.julialang.org/t/question-regarding-inbounds-usage/5241>\
**Category:** General Usage\
**Created:** [August 5, 2017, 4:39pm UTC](https://discourse.julialang.org/t/question-regarding-inbounds-usage/5241 "2017-08-05T16:39:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeLenz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/codelenz/32/3419_2.png) [@CodeLenz](https://discourse.julialang.org/u/CodeLenz)\
**Post date:** [August 5, 2017, 4:39pm UTC](https://discourse.julialang.org/t/question-regarding-inbounds-usage/5241/1 "2017-08-05T16:39:20Z")

</div>

Hi there.

Consider an Array of integers and a vector

> a = [1 3 5 6 ; 4 7 9 2 ; 3 5 7 4];  
> T = rand(10);

and the operations

> r1 = T[a[1,:]]  
> r2 = @inbounds T[a[1,:]]

Observe that r1 would return T in positions 1, 3, 5 and 6, as expected, but r2 is Void. Is this the intended behaviour ?

I am using Julia V0.6,

Julia Version 0.6.0  
Commit 903644385b\* (2017-06-19 13:05 UTC)  
Platform Info:  
OS: Linux (x86\_64-pc-linux-gnu)  
CPU: Intel(R) Core™ i5 CPU M 450 @ 2.40GHz  
WORD\_SIZE: 64  
BLAS: libblas  
LAPACK: liblapack  
LIBM: libm  
LLVM: libLLVM-4.0.0 (ORCJIT, westmere)

Thank you.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 5, 2017, 4:59pm UTC](https://discourse.julialang.org/t/question-regarding-inbounds-usage/5241/2 "2017-08-05T16:59:20Z")

</div>

[https://github.com/JuliaLang/julia/pull/15558](https://github.com/JuliaLang/julia/pull/15558)

Do `@inbounds r2 = T[a[1,:]]`

---

<div class="post-metadata">

**Author:** ![CodeLenz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/codelenz/32/3419_2.png) [@CodeLenz](https://discourse.julialang.org/u/CodeLenz)\
**Post date:** [August 6, 2017, 11:59pm UTC](https://discourse.julialang.org/t/question-regarding-inbounds-usage/5241/3 "2017-08-06T23:59:25Z")

</div>

Thank you !!
