From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20898 invoked by alias); 7 Oct 2014 11:48:15 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 20886 invoked by uid 89); 7 Oct 2014 11:48:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f52.google.com Received: from mail-wg0-f52.google.com (HELO mail-wg0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 07 Oct 2014 11:48:08 +0000 Received: by mail-wg0-f52.google.com with SMTP id a1so8967368wgh.23 for ; Tue, 07 Oct 2014 04:48:05 -0700 (PDT) X-Received: by 10.194.246.166 with SMTP id xx6mr4187396wjc.37.1412682485088; Tue, 07 Oct 2014 04:48:05 -0700 (PDT) Received: from [192.168.5.5] (156-149.dsl.iskon.hr. [89.164.156.149]) by mx.google.com with ESMTPSA id lk6sm20445250wjb.26.2014.10.07.04.48.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 04:48:04 -0700 (PDT) Message-ID: <5433D2D3.4040300@gmail.com> Date: Tue, 07 Oct 2014 11:48:00 -0000 From: Ivo Doko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Jonathan Wakely CC: gcc-help Subject: Re: A possible bug References: <54337368.4070407@gmail.com> <5433B232.6070401@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00038.txt.bz2 On 2014-10-07 12:48, Jonathan Wakely wrote: > That's almost certainly an improvement anyway, the compiler can pass > an int_fast8_t in a register more efficiently than passing by > reference. > > But you haven't actually fixed the root cause of the problem, which is > that you haven't defined your static variables. Well, where exactly should I "define" them? Inside the body of the xorshift_engine class I have: static constexpr size_t word_size = std::numeric_limits::digits; static constexpr size_t state_size = n; static constexpr int_fast8_t shift_1 = a >= 0 ? a : -a; static constexpr int_fast8_t shift_2 = b >= 0 ? b : -b; static constexpr int_fast8_t shift_3 = c >= 0 ? c : -c; static constexpr result_type multiplier = m; static constexpr result_type default_seed = 5489u; I don't use these anywhere but inside the bodies of xorshift_engine member functions. I fail to see where else I am supposed to define these variables for use inside the class.