Y
Hacker News
new
|
ask
|
show
|
jobs
by
wazzaps
997 days ago
Copying a mutex by value (thus duplicating the lock, causing deadlocks or worse) is far too easy
2 comments
icholy
997 days ago
`go vet` catches this.
link
mhh__
996 days ago
I use a tool called "type theory"
link
icholy
996 days ago
Keep posting about D, I'm sure it will catch on soon.
link
erik_seaberg
997 days ago
Is there a way to declare any type uncopyable? This is something I always thought Ada got right.
link
smasher164
996 days ago
you stick this in your struct
type noCopy struct{} func (*noCopy) Lock() {} func (*noCopy) Unlock() {}
link
usefulcat
997 days ago
Wow, even c++ won't let you do that (without invoking undefined behavior, anyway).
link