Skip to content

Commit

Permalink
运行 test_alloc( ) 的 main( ) 程序
Browse files Browse the repository at this point in the history
  • Loading branch information
Lammmmmmm committed Jan 6, 2020
1 parent 6f8eda2 commit 6b241f9
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
#include <iostream>
#include "allocator.h"
#include "alloc.h"
#include "type_traits.h"
#include <vector>
#include "test_alloc.h"

using std::cout;
using std::endl;
using FunPtr = void (*)(int&);
void bigger(int& num){
num += 1;
}
void (* set_m(FunPtr))(){

}

union obj {
union obj* next;
char data[1];
};

int main(){
std::vector<int,mystl::allocator<int>> vec(5,5);
for(auto &each: vec)
cout << each << " ";
cout << endl;
mystl::test_alloc();
return 0;
}

0 comments on commit 6b241f9

Please sign in to comment.