tisel 0.1.1

Effective type-based pseudodynamic dispatch to impls, enums and typeid
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Tools to help with deducing the type to use for [cisness::LiveWitness] things when you have a
//! concrete type but no type ascription.

use cisness::LiveWitness;

/// Create a [`cisness::LiveWitness`] - provide a target type, and also a reference to the source
/// type you want to deduce, and create a live witness that asserts the pointed-to type is the
/// same as the target type.
#[inline(always)]
pub const fn deduce_livewitness_from_ref<Target, SrcDeduced>(
    _deduce_from_ref: &SrcDeduced,
) -> LiveWitness<SrcDeduced, Target> {
    LiveWitness::only_executed_if_same()
}

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.