@@ -186,11 +186,7 @@ template <typename V, typename U, typename R>
186186auto cross(const V &a, const Quantity<U, R> &b);
187187```
188188
189- !!! warning "Lifetime risk"
190- This operation is ** lazy** : its result is an expression template, which refers to its operands
191- instead of owning its own copy of the data. The result is valid only as long as its operands
192- are alive. If it needs to outlive them, materialize it with [ ` eval() ` ] ( #eval ) . See our
193- [ Eigen safety guide] ( ../discussion/concepts/eigen_safety.md ) to learn more.
189+ --8<-- "lifetime-risk-lazy.md"
194190
195191### ` normalized `
196192
@@ -225,11 +221,7 @@ template <typename V, typename U, typename R>
225221auto cwiseProduct(const V &a, const Quantity<U, R> &b);
226222```
227223
228- !!! warning "Lifetime risk"
229- This operation is ** lazy** : its result is an expression template, which refers to its operands
230- instead of owning its own copy of the data. The result is valid only as long as its operands
231- are alive. If it needs to outlive them, materialize it with [ ` eval() ` ] ( #eval ) . See our
232- [ Eigen safety guide] ( ../discussion/concepts/eigen_safety.md ) to learn more.
224+ --8<-- "lifetime-risk-lazy.md"
233225
234226### ` cwiseQuotient `
235227
@@ -249,11 +241,7 @@ template <typename V, typename U, typename R>
249241auto cwiseQuotient(const V &a, const Quantity<U, R> &b);
250242```
251243
252- !!! warning "Lifetime risk"
253- This operation is **lazy**: its result is an expression template, which refers to its operands
254- instead of owning its own copy of the data. The result is valid only as long as its operands
255- are alive. If it needs to outlive them, materialize it with [`eval()`](#eval). See our
256- [Eigen safety guide](../discussion/concepts/eigen_safety.md) to learn more.
244+ --8<-- "lifetime-risk-lazy.md"
257245
258246### `cwiseAbs`
259247
@@ -264,11 +252,7 @@ template <typename U, typename R>
264252auto cwiseAbs(const Quantity<U, R> &q);
265253```
266254
267- !!! warning "Lifetime risk"
268- This operation is ** lazy** : its result is an expression template, which refers to its operands
269- instead of owning its own copy of the data. The result is valid only as long as its operands
270- are alive. If it needs to outlive them, materialize it with [ ` eval() ` ] ( #eval ) . See our
271- [ Eigen safety guide] ( ../discussion/concepts/eigen_safety.md ) to learn more.
255+ --8<-- "lifetime-risk-lazy.md"
272256
273257### ` cwiseSqrt `
274258
@@ -279,11 +263,7 @@ template <typename U, typename R>
279263auto cwiseSqrt (const Quantity<U, R> &q);
280264```
281265
282- !!! warning "Lifetime risk"
283- This operation is **lazy**: its result is an expression template, which refers to its operands
284- instead of owning its own copy of the data. The result is valid only as long as its operands
285- are alive. If it needs to outlive them, materialize it with [`eval()`](#eval). See our
286- [Eigen safety guide](../discussion/concepts/eigen_safety.md) to learn more.
266+ --8<-- "lifetime-risk-lazy.md"
287267
288268## Views and accessors
289269
@@ -298,11 +278,7 @@ template <typename U, typename R>
298278auto transpose(const Quantity<U, R> &q);
299279```
300280
301- !!! warning "Lifetime risk"
302- This operation is ** lazy** : its result is an expression template, which refers to its operands
303- instead of owning its own copy of the data. The result is valid only as long as its operands
304- are alive. If it needs to outlive them, materialize it with [ ` eval() ` ] ( #eval ) . See our
305- [ Eigen safety guide] ( ../discussion/concepts/eigen_safety.md ) to learn more.
281+ --8<-- "lifetime-risk-lazy.md"
306282
307283### ` diagonal `
308284
@@ -317,11 +293,7 @@ template <typename U, typename R>
317293auto diagonal(const Quantity<U, R> &q, std::ptrdiff_t index);
318294```
319295
320- !!! warning "Lifetime risk"
321- This operation is **lazy**: its result is an expression template, which refers to its operands
322- instead of owning its own copy of the data. The result is valid only as long as its operands
323- are alive. If it needs to outlive them, materialize it with [`eval()`](#eval). See our
324- [Eigen safety guide](../discussion/concepts/eigen_safety.md) to learn more.
296+ --8<-- "lifetime-risk-lazy.md"
325297
326298### `row`, `col`
327299
@@ -335,11 +307,7 @@ template <typename U, typename R>
335307auto col(const Quantity<U, R> &q, std::ptrdiff_t j);
336308```
337309
338- !!! warning "Lifetime risk"
339- This operation is ** lazy** : its result is an expression template, which refers to its operands
340- instead of owning its own copy of the data. The result is valid only as long as its operands
341- are alive. If it needs to outlive them, materialize it with [ ` eval() ` ] ( #eval ) . See our
342- [ Eigen safety guide] ( ../discussion/concepts/eigen_safety.md ) to learn more.
310+ --8<-- "lifetime-risk-lazy.md"
343311
344312### ` reverse `
345313
@@ -350,11 +318,7 @@ template <typename U, typename R>
350318auto reverse (const Quantity<U, R> &q);
351319```
352320
353- !!! warning "Lifetime risk"
354- This operation is **lazy**: its result is an expression template, which refers to its operands
355- instead of owning its own copy of the data. The result is valid only as long as its operands
356- are alive. If it needs to outlive them, materialize it with [`eval()`](#eval). See our
357- [Eigen safety guide](../discussion/concepts/eigen_safety.md) to learn more.
321+ --8<-- "lifetime-risk-lazy.md"
358322
359323### `conjugate`
360324
@@ -365,11 +329,7 @@ template <typename U, typename R>
365329auto conjugate(const Quantity<U, R> &q);
366330```
367331
368- !!! warning "Lifetime risk"
369- This operation is ** lazy** : its result is an expression template, which refers to its operands
370- instead of owning its own copy of the data. The result is valid only as long as its operands
371- are alive. If it needs to outlive them, materialize it with [ ` eval() ` ] ( #eval ) . See our
372- [ Eigen safety guide] ( ../discussion/concepts/eigen_safety.md ) to learn more.
332+ --8<-- "lifetime-risk-lazy.md"
373333
374334### ` head ` , ` tail ` , ` segment `
375335
@@ -397,11 +357,7 @@ template <typename U, typename R>
397357auto segment(const Quantity<U, R> &q, std::ptrdiff_t start, std::ptrdiff_t n);
398358```
399359
400- !!! warning "Lifetime risk"
401- This operation is **lazy**: its result is an expression template, which refers to its operands
402- instead of owning its own copy of the data. The result is valid only as long as its operands
403- are alive. If it needs to outlive them, materialize it with [`eval()`](#eval). See our
404- [Eigen safety guide](../discussion/concepts/eigen_safety.md) to learn more.
360+ --8<-- "lifetime-risk-lazy.md"
405361
406362### `block`
407363
@@ -421,11 +377,7 @@ auto block(const Quantity<U, R> &q,
421377 std::ptrdiff_t cols);
422378```
423379
424- !!! warning "Lifetime risk"
425- This operation is ** lazy** : its result is an expression template, which refers to its operands
426- instead of owning its own copy of the data. The result is valid only as long as its operands
427- are alive. If it needs to outlive them, materialize it with [ ` eval() ` ] ( #eval ) . See our
428- [ Eigen safety guide] ( ../discussion/concepts/eigen_safety.md ) to learn more.
380+ --8<-- "lifetime-risk-lazy.md"
429381
430382### ` replicate `
431383
@@ -441,11 +393,7 @@ template <typename U, typename R>
441393auto replicate(const Quantity<U, R> &q, std::ptrdiff_t row_factor, std::ptrdiff_t col_factor);
442394```
443395
444- !!! warning "Lifetime risk"
445- This operation is **lazy**: its result is an expression template, which refers to its operands
446- instead of owning its own copy of the data. The result is valid only as long as its operands
447- are alive. If it needs to outlive them, materialize it with [`eval()`](#eval). See our
448- [Eigen safety guide](../discussion/concepts/eigen_safety.md) to learn more.
396+ --8<-- "lifetime-risk-lazy.md"
449397
450398## Matrix operations
451399
@@ -459,8 +407,4 @@ template <typename U, typename R>
459407auto inverse(const Quantity<U, R> &q);
460408```
461409
462- !!! warning "Lifetime risk"
463- This operation is ** lazy** : its result is an expression template, which refers to its operands
464- instead of owning its own copy of the data. The result is valid only as long as its operands
465- are alive. If it needs to outlive them, materialize it with [ ` eval() ` ] ( #eval ) . See our
466- [ Eigen safety guide] ( ../discussion/concepts/eigen_safety.md ) to learn more.
410+ --8<-- "lifetime-risk-lazy.md"
0 commit comments