Skip to content

Lifetime Object

Spice
import "std/test/lifetime-object";

LifetimeObject struct

Object that prints to cout when one of its lifetime methods is called. This is useful for language verification and debugging purposes.

Constructors

ctor

Spice
public p LifetimeObject.ctor(int objectNumber = ++OBJECT_COUNTER)

Construct a lifetime object, logging the construction to stdout

Parameters

Name Type Description
objectNumber int Identifying number of the object, defaults to a global running counter (default: ++OBJECT_COUNTER)

ctor

Spice
public p LifetimeObject.ctor(const LifetimeObject& other)

Construct a lifetime object as a copy of another one, logging the copy to stdout

Parameters

Name Type Description
other const LifetimeObject& Lifetime object to copy

dtor

Spice
public p LifetimeObject.dtor()

Destruct the lifetime object, logging the destruction to stdout