【Tricks】各种类型的范围

今天看一份代码的时候,看到一个东西:

list[i].prev1 = list[i].prev2 = list[i].next1 = list[i].next2 = std::numeric_limits<size_t>::max();

然后发现这个东西,可以搞出所有基本类型的数据范围:

numeric_limits<size_t>::max();

需要

#include<limits>

详细情况见这里:http://www.cplusplus.com/reference/limits/numeric_limits/
当然,不仅可以搞出数据范围,还可以搞一点其他的东西,比如
12345453477854245874
感觉好强啊!居然有这么多彩蛋! *★,°*:.☆( ̄▽ ̄)/$:*.°★* 。

最后吐槽一下那份代码:http://paste.ubuntu.com/23101572/
感觉完全不是std,而是《浅谈c++基本语法》或者《使用基本语法教你做人》(╯‵□′)╯︵┻━┻

193 thoughts to “【Tricks】各种类型的范围”

  1. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to
    my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite
    some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I
    look forward to your new updates.

  2. Write more, thats all I have to say. Literally, it seems as though you relied on the
    video to make your point. You clearly know what youre talking about, why waste your
    intelligence on just posting videos to your site when you
    could be giving us something enlightening
    to read?

  3. Greetings from Los angeles! I’m bored to tears at work so
    I decided to check out your website on my iphone during lunch break.
    I love the information you present here and can’t wait to take a
    look when I get home. I’m amazed at how quick your blog loaded on my mobile ..
    I’m not even using WIFI, just 3G .. Anyhow, good blog!

  4. Pretty section of content. I just stumbled upon your
    weblog and in accession capital to assert that I acquire in fact enjoyed account your blog posts.
    Any way I’ll be subscribing to your augment and even I achievement you access consistently
    quickly.

  5. I was wondering if you ever thought of changing
    the structure of your website? Its very well written; I
    love what youve got to say. But maybe you could a little more in the
    way of content so people could connect with it better.

    Youve got an awful lot of text for only having 1 or two pictures.
    Maybe you could space it out better?

  6. Hi, i think that i saw you visited my blog so i came to
    “return the favor”.I am trying to find things to enhance my web site!I suppose its ok
    to use some of your ideas!!

  7. After I initially commented I seem to have clicked
    on the -Notify me when new comments are added-
    checkbox and now whenever a comment is added I receive four emails with the exact same
    comment. Perhaps there is an easy method you are able to remove me from that service?

    Kudos!

  8. Hello! This is kind of off topic but I need some help
    from an established blog. Is it tough to set up your own blog?

    I’m not very techincal but I can figure things out pretty fast.
    I’m thinking about creating my own but I’m not sure where
    to start. Do you have any points or suggestions? With thanks

  9. Today, I went to the beachfront with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed.
    There was a hermit crab inside and it pinched her ear.
    She never wants to go back! LoL I know this is completely off topic but I had to
    tell someone!

  10. Hello would you mind letting me know which web host
    you’re working with? I’ve loaded your blog in 3 different browsers and
    I must say this blog loads a lot quicker then most. Can you suggest a good hosting provider at a fair price?
    Many thanks, I appreciate it!

  11. Howdy, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam feedback?
    If so how do you stop it, any plugin or anything you can recommend?

    I get so much lately it’s driving me mad so any help is very much appreciated.

  12. Howdy are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get
    started and set up my own. Do you require any html coding expertise to make
    your own blog? Any help would be greatly appreciated!

  13. Link exchange is nothing else however it is simply placing the other
    person’s web site link on your page at suitable place and other person will also do same
    in favor of you.

Leave a Reply

Your email address will not be published. Required fields are marked *