$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Eric Friedman (ebf_at_[hidden])
Date: 2003-04-07 20:23:19
Gennadiy Rozental wrote:
> Could you clarify in which case loop-unrolling would provide O(1)
> complexity?
Assuming your assertion that a switch-based visitation algorithm is indeed
O(1), then the following loop-unrolling approach would provide O(1) for the
first N types:
switch (which_) {
case 1: visitor( reinterpret_cast<T1>( ... ) ); break;
...
case N: visitor( reinterpret_cast<TN>( ... ) ); break;
default:
<some code to handle next N types>
}
Let me know if this resolves the issue.
Thanks,
Eric