Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Did `#pragma once` make it into C++0x?

The title says it all. Have #pragma once been standardized for C++0x? I don't know any compiler that doesn't provide an implementation of it, with almost always the same semantics and name.

like image 987
Klaim Avatar asked Dec 30 '10 14:12

Klaim


1 Answers

All #pragma directives cause the implementation to behave in an implementation defined way.

This hasn't changed between C++03 and the latest C++0x draft (n3225.pdf). Include guards are the portable alternative.

like image 183
CB Bailey Avatar answered Oct 15 '22 11:10

CB Bailey