if you're ok with a var object, you can do:
type Person = object
first, last: string
proc init(self: var Person, first, last: string) =
self.first = first
self.last = last
proc `=`*[T](d: var Person; src: Person) {.error.} =
discard
var person : Person
person.init("John", "Doe")
echo person.first, " ", person.last
- Prevent accidental object copies Nycto
- Re: Prevent accidental object copies sendell
- Re: Prevent accidental object copies Udiknedormin
- Re: Prevent accidental object copies cdome
- Re: Prevent accidental object copies Udiknedormin
- Re: Prevent accidental object copies Araq
- Re: Prevent accidental object copie... Udiknedormin
- Re: Prevent accidental object c... Serenitor
- Re: Prevent accidental object c... Udiknedormin
- Re: Prevent accidental object c... mratsim
