Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Mar 7, 2015
1 parent 7d82c4b commit 179648c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions ch13/ex13_39.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
//
// ex13_39.cpp
// Exercise 13.39
// Exercise 13.39
//
// Created by pezy on 2/3/15.
// Copyright (c) 2015 pezy. All rights reserved.
//
// Write your own version of StrVec, including versions of
// reserve, capacity (9.4, p. 356), and resize (9.3.5, p. 352).
// Write your own version of StrVec, including versions of
// reserve, capacity (9.4, p. 356), and resize (9.3.5, p. 352).
//

#include "StrVec.h"
#include "ex13_39.h"

void StrVec::push_back(const std::string &s)
{
chk_n_alloc();
alloc.construct(first_free++, s);
}

std::pair<std::string*, std::string*>
std::pair<std::string*, std::string*>
StrVec::alloc_n_copy(const std::string *b, const std::string *e)
{
auto data = alloc.allocate(e-b);
Expand Down
6 changes: 3 additions & 3 deletions ch13/ex13_40.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
//
// ex13_40.cpp
// Exercise 13.40
// Exercise 13.40
//
// Created by pezy on 2/3/15.
// Copyright (c) 2015 pezy. All rights reserved.
//
// Add a constructor that takes an initializer_list<string> to your StrVec class.
//

#include "StrVec.h"
#include "ex13_40.h"

void StrVec::push_back(const std::string &s)
{
chk_n_alloc();
alloc.construct(first_free++, s);
}

std::pair<std::string*, std::string*>
std::pair<std::string*, std::string*>
StrVec::alloc_n_copy(const std::string *b, const std::string *e)
{
auto data = alloc.allocate(e-b);
Expand Down

0 comments on commit 179648c

Please sign in to comment.