例えば、以下のコードはassertion failedとなる。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// assert.cpp | |
// CplusplusPractice | |
// | |
// Created by masai on 2015/05/19. | |
// Copyright (c) 2015年 masai. All rights reserved. | |
// | |
#include <iostream> | |
#include <limits> | |
#include <cstdlib> | |
#include <assert.h> | |
typedef long long_type; | |
long base(); | |
int main(int argc, const char * argv[]) { | |
long v = 32; | |
assert(v * base() > std::numeric_limits<long_type>::max()); | |
return 0; | |
} | |
long base(){ | |
return 200; | |
} |
0 件のコメント:
コメントを投稿