Ignore:
Timestamp:
2018-07-05T21:41:24Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8349334
Parents:
58ff673
git-author:
Dzejrou <dzejrou@…> (2018-05-15 17:59:36)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:24)
Message:

cpp: fixed default underlying container of stack and finally fixed noexcept attribute of stack::swap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/impl/stack.hpp

    r58ff673 r3adbbda  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3030#define LIBCPP_STACK
    3131
     32#include <deque>
    3233#include <initializer_list>
    3334#include <utility>
    34 #include <vector>
    3535
    3636namespace std
     
    4141     */
    4242
    43     // TODO: the default container should be deque<T>
    44     template<class T, class Container = vector<T>>
     43    template<class T, class Container = deque<T>>
    4544    class stack
    4645    {
     
    131130            }
    132131
    133             void swap(stack& other)
    134                 /* noexcept(noexcept(swap(c, other.c))) */
     132            void swap(stack& other) // We cannot use c in the noexcept :/
     133                noexcept(noexcept(declval<container_type>().swap(declval<container_type&>())))
    135134            {
    136135                std::swap(c, other.c);
Note: See TracChangeset for help on using the changeset viewer.