/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2021-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM, distributed under GPL-3.0-or-later. Description Basic tests of expression traits \*---------------------------------------------------------------------------*/ #include "IOstreams.H" #include "ITstream.H" #include "uLabel.H" #include "exprTraits.H" #include "error.H" #include "stringList.H" #include "exprScanToken.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template void printTraits() { const auto typeCode = exprTypeTraits::value; Info<< "Type '" << pTraits::typeName << "' = code:" << int(typeCode) << " rank:" << exprTypeTraits::rank << " cmpt:" << exprTypeTraits::nComponents << " name:" << exprTypeTraits::name; if (pTraits::typeName != word(exprTypeTraits::name)) { Info<< " (UNSUPPORTED)"; } Info << endl; } void print(const expressions::scanToken& tok) { Info<< " type:" << int(tok.type_); if (tok.is_pointer()) { Info<< " ptr:" << Foam::name(tok.name_); } Info<< nl; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main() { Info<< nl << "Traits:" << nl; printTraits(); printTraits(); printTraits(); printTraits