mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add swallow assignment to nullObject
- similar to the behaviour of std::ignore and consistent with the no input / no output nature of nullObject. Similarly accept a const reference for its Istream operator. - make most nullObject methods constexpr
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2014 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -47,9 +47,8 @@ class SimpleClass
|
||||
{
|
||||
public:
|
||||
|
||||
//- Null constructor
|
||||
SimpleClass()
|
||||
{}
|
||||
//- Default construct
|
||||
SimpleClass() {}
|
||||
};
|
||||
|
||||
|
||||
@ -149,6 +148,12 @@ int main()
|
||||
printInfo(pointField::null());
|
||||
}
|
||||
|
||||
// Test swallow assigment (like std::ignore)
|
||||
// Looks pretty ugly though!
|
||||
|
||||
NullObject::nullObject = "hello world";
|
||||
NullObject::nullObject = labelList({1, 2, 3});
|
||||
|
||||
Info<< nl;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user