lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 3129898 4/5: Improve concinnity


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 3129898 4/5: Improve concinnity
Date: Tue, 7 Feb 2017 04:40:19 +0000 (UTC)

branch: master
commit 3129898fbaf76ee6737bdafdb992d7be26e8906f
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Improve concinnity
    
    Uniform initialization made constructing a vector of strings much
    simpler, and now the closely parallel examples nearby construct
    their vectors of numbers in the same way.
    
    The tests for the many-argument constructor should also be rewritten
    someday. The only reason they were written with arrays is that only
    arrays had braced initializers in C++98.
---
 input_seq_test.cpp |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index a7b2b32..6d9492a 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -326,9 +326,7 @@ int test_main(int, char*[])
 
     // Test construction from numeric vector.
     {
-    int const n = 5;
-    double const d[n] = {1, 1, 1, 2, 2};
-    std::vector<double> const v(d, d + n);
+    std::vector<double> const v{1, 1, 1, 2, 2};
     BOOST_TEST(v == InputSequence(v).linear_number_representation());
     BOOST_TEST_EQUAL
         ("1 [0, 3); 2 [3, maturity)"
@@ -348,9 +346,7 @@ int test_main(int, char*[])
 
     // Test construction from one-element vector.
     {
-    int const n = 1;
-    double const d[n] = {3};
-    std::vector<double> const v(d, d + n);
+    std::vector<double> const v{3};
     BOOST_TEST(v == InputSequence(v).linear_number_representation());
     BOOST_TEST_EQUAL("3", InputSequence(v).mathematical_representation());
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]