Good C++ practices

Pages: 1234
Mar 26, 2014 at 12:18am
there are no small letters in my post. they are only small if you make them small.
Mar 26, 2014 at 12:20am
Nathan and Bobby you should stop arguing over grammar. You are getting way off topic on yet another thread. Let me put this back on topic:
http://www.cplusplus.com/forum/lounge/127166/#msg688151

There is also a WIP faq for this site that could come in handy.
http://www.cplusplus.com/faq/
Mar 26, 2014 at 12:23am
yeah im sorry. also there is the webkit one.
http://www.webkit.org/coding/coding-style.html
Mar 26, 2014 at 8:46am
Is it just me or is there "Under construction" written over here: http://www.cplusplus.com/faq/style/
Mar 26, 2014 at 8:48am
Yes, the FAQ on this site is still under active development (and from the look of things, probably won't be ready for a while).
Mar 26, 2014 at 8:48am
As I mentioned it is a work in progress(WIP).
Mar 26, 2014 at 2:52pm
closed account (iAk3T05o)
It looks good although i don't understand the code under "strings & arrays". I believe it will be sorted out when it's done. A good reference.
Mar 26, 2014 at 5:02pm
@ Nathan2222: The code is very clear and understandable. What part do you not understand?
Mar 26, 2014 at 6:37pm
closed account (iAk3T05o)
I can't seem to find it. It had a lot of
 
bool::
Mar 26, 2014 at 6:43pm
are you sure? i just did ctrl+f for just bool and it found nothing. also i dont think you can legally do bool::anything in c++. although, i would appreciate it if one of the more knowledgable members backed me up or corrected me on this
Mar 26, 2014 at 7:55pm
closed account (iAk3T05o)
I've still not found it.
@little bobby: i hope i find it to confirm. :(
Mar 26, 2014 at 10:11pm
@ Bobby: bool is a datatype. It is neither a class nor a namespace. So you cannot do bool::something and get away with it ;).
Last edited on Mar 26, 2014 at 10:11pm
Mar 27, 2014 at 5:00am
Stormboy is right, bool is a datatype. There is no part of this site (outside of his post and your reply) that has bool:: in it.
Last edited on Mar 27, 2014 at 5:22am
Mar 27, 2014 at 6:40am
closed account (iAk3T05o)
I've found it :). It's under strings & arrays, under that, you'll find comparing strings without case sensitivity and you'll see the codes. I was confusing things because bool was the datatype of that thing.
It was boost:: i was seeing.
Mar 27, 2014 at 2:25pm
boost is a library. You use boost:: to access something in the boost namespace.
Mar 27, 2014 at 5:37pm
bool is a datatype. It is neither a class nor a namespace. So you cannot do bool::something and get away with it ;).
thats what i was saying. i didnt think you could but im no expert, so i just wanted to make sure.

You use boost:: to access something in the boost namespace

except, for whatever reason, when its not in actual code they refer to a library as boost.name, for example boost.any
Mar 27, 2014 at 6:02pm
If they are doing boost.any that means boost is a class/struct object accessing a member.

1
2
3
4
5
6
struct someName{
         std::string name;
};

someName boost;
boost.name;

For the boost library it uses boost:: due to it being the namespace for the library. Unless I'm misunderstanding what you mean by boost.any.
Mar 27, 2014 at 6:47pm
yes you are. if they arent referencing actual code, they do it like this:
to do such and such, you would use boost.foo to do that.
Mar 27, 2014 at 6:52pm
@ Little Bobby Tables:
Where do they refer it to as boost.something? In their documentation?
Mar 27, 2014 at 6:55pm
im sorry... im wrong. i just went to check, and i couldnt find them doing that except in the <title> tag. i must be thinking of another library
Pages: 1234