Class: Benchcc::MPL::List

Inherits:
Sequence
  • Object
show all
Defined in:
lib/benchcc/mpl.rb

Instance Method Summary collapse

Methods inherited from Sequence

#includes

Instance Method Details

#headersObject



45
# File 'lib/benchcc/mpl.rb', line 45

def headers; super 'list'; end

#to_sObject



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/benchcc/mpl.rb', line 33

def to_s
  tail = map(&:to_s).last(50)
  init = map(&:to_s).first([size - tail.size, 0].max)
  listN = "boost::mpl::list#{tail.size}<#{tail.join(', ')}>"

  init.reverse.zip(51..Float::INFINITY).reduce(listN) do |tail, x_size|
    x, size = x_size
    # we emulate mpl::push_front
    "boost::mpl::l_item<boost::mpl::long_<#{size}>, #{x}, #{tail}>"
  end
end